jan@imm.dtu.dk
Jan Madsen
Informatics and Mathematical Modeling Technical University of Denmark Richard Petersens Plads, Building 321
DK2800 Lyngby, Denmark
Embedded Systems
introduction
Wireless Sensor Networks
Dataopsamling
02131 Embedded Systems Jan Madsen [3]
Sensor Node Architecture
rtos
Mem
cpu
radiosensor
sensing
processing communicating battery
Sensor Node Architecture
rtos
1Kbps - 1Mbps, 3-100 Meter,
Lossy Transmissions
8-bit, 10 MHz
Slow
computation
02131 Embedded Systems Jan Madsen [5]
02131 Embedded Systems
rtos
Mem
cpu
radiosensor
battery C programming
practice, test, verification Assembly language basics Operating systems usage
Processor design
Microprocessor basics Specialized hardware Interfaces
SW-SW, HW-HW, SW-HW
? ”Det er ok at vise din kærste din nye
computer, hvis du selv har lavet den”
02131 Embedded Systems Jan Madsen [9]
Computing systems
?Desktop, workstations, mainframes and servers
?Millions of such systems built every year!
?But, billions of computing systems are built every year for a very
different purpose ...
?Embedded systems accounts for 99% of all computing systems!!!
Embedded systems
if ...
then ... else ...
for { ...
..}
func
001010100101101 101011101101010 001010011101101 110101001010011 101010101010001 111101010111101 010111101101010
bit-pattern
02131 Embedded Systems Jan Madsen [11]
Embedded systems
? Systems which use a computer to perform a specific function, but are neither used nor perceived as a computer
? They are embedded within larger electronic devices
? Repeatedly carrying out a particular function
? Often completely unrecognized by the device’s user
? Heavily resource constrained
Embedded Computing Systems?
? Fabrication equipment
? Automotives
? fuel injection, anti-lock brakes, airbags, etc.
? Avionics
? Flight control systems, anti-collision systems, etc.
? Telecommunication
? Mobile phones
? Authentication systems
? SMARTpen
? Consumer electronics
? Game consoles, TV sets, video, DVD, mp3, etc.
? Microwave ovens, washing machines, etc.
? Medical systems
? Hearing aid, smart pills, etc.
02131 Embedded Systems Jan Madsen [13]
Medical systems: Hearing aid
Medical systems: Diagnostics
02131 Embedded Systems Jan Madsen [15]
Smart pills – 1st generation
Smart pills – 2nd generation
02131 Embedded Systems Jan Madsen [17]
Embedded Computing Systems?
?Smart buildings
?Energy control, air-conditioning, safety systems, etc.
?Sensor networks
?Environmental monitoring, animal monitoring, etc.
?Wearable computing
Wearable computing
02131 Embedded Systems Jan Madsen [19]
Wearable computing
Embedded Computing Systems?
?Smart buildings
?Energy control, air-conditioning, safety systems, etc.
?Sensor networks
?Environmental monitoring, animal monitoring, etc.
?Wearable computing
?Robotics
?Humanoid, micro-insects, etc.
02131 Embedded Systems Jan Madsen [21]
Flying micro-insects
How do we design these
embedded systems?
02131 Embedded Systems Jan Madsen [24]
Embedded systems design
hardware software
validation validation
hardware prototype
software prototype
Several design groups
Separated validations
Prototype realization
hardware model
software model
Problems arise at a very late point in the design process
Embedded systems design
Size and speed requirements
void UnitControl() {
up = down = 0; open = 1;
while (1) { while (req == floor);
open = 0;
if (req > floor) { up = 1;}
else {down = 1;}
while (req != floor);
open = 1;
delay(10);
} } }
C/C++/Java
001010100101101 101011101101010 001010011101101 110101001010011 101010101010001 111101010111101 010111101101010
bit-pattern DSP chip
Need to know about hardware!
02131 Embedded Systems Jan Madsen [26]
Hardware (chip) design
Size and speed requirements
ASIC netlist Layout
void UnitControl() {
up = down = 0; open = 1;
while (1) { while (req == floor);
open = 0;
if (req > floor) { up = 1;}
else {down = 1;}
while (req != floor);
open = 1;
delay(10);
} } }
C/C++/Java
architecture
+ energy
Principples of Codesign
void UnitControl() {
up = down = 0; open = 1;
while (1) {
void UnitControl() {
up = down = 0; open = 1;
while (1) { while (req == floor);
open = 0;
SW
synthesis
CPU
02131 Embedded Systems Jan Madsen [28]
Principples of Codesign
void UnitControl() {
up = down = 0; open = 1;
while (1) { while (req == floor);
open = 0;
if (req > floor) { up = 1;}
else {down = 1;}
while (req != floor);
open = 1;
delay(10);
} } }
void UnitControl() {
up = down = 0; open = 1;
while (1) { while (req == floor);
open = 0;
if (req > floor) { up = 1;}
else {down = 1;}
while (req != floor);
open = 1;
delay(10);
} } }
SW synthesis
HW synthesis Interface
synthesis
System-on-Chip
BREAK
02131 Embedded Systems Jan Madsen [30]
Processor technology
?Architecture of computation engine
?Does not have to be programmable
?Differs in its specialization towards a particular application
?Manifests different design metrics
Processor: General-purpose
?Designed to:
?maximize the number of devices sold
?suitable for a variety of applications
?Architecture contains:
?program memory
02131 Embedded Systems Jan Madsen [32]
Processor: General-purpose
?Used by the embedded system designer to
program the processor’s memory to carry out the required functionality
?This portion of an implementation is often referred to as the “software” portion
Software
? Elements of computation
? Transform data
? Store data
? Move data
if ...
then ... else ...
for { ...
..}
func
cpu
02131 Embedded Systems Jan Madsen [34]
Processor
? Architecture components
? Processing elements – transform data
? Memories – store data
? Interconnect – move data
if ...
then ... else ...
for { ...
..}
func
Processor: General-purpose
if ...
then ... else ...
for { ...
func
inst mem controller datapath data mem
func ir cu
*
reg02131 Embedded Systems Jan Madsen [36]
Processor: General-purpose - example
if ...
then ... else ...
for { ...
..}
func
inst mem controller datapath data mem
func
pc
ir cu
reg +/-
x = x + A[i] * p1
* A[i]
p1
5 cycles
Processor: Single-purpose
?Digital circuit designed to execute exactly one program
?This portion of an implementation is often referred to as the “hardware” portion
?Other common terms:
?Co-processor
?Accelerator
02131 Embedded Systems Jan Madsen [38]
Processor: Single-purpose (ASIC)
? High performance
? Low power
? Complex design flow
? No flexibility
if ...
then ... else ...
for { ...
..}
func
controller datapath cu
+/-
*
+mem
Processor: Single-purpose – example
if ...
then ... else ...
for { ...
func
controller datapath cu
*
+mem
A[i]
p1
02131 Embedded Systems Jan Madsen [40]
Processor: Application-specific
?Designed for a particular class of applications with common characteristics
?Serve as a compromise between the two other processor types
?Examples are digital signal processors (DSPs)
Processor: Application-specific
?May require large NRE cost to build the processor itself and to build a compiler
?Automatically generating such processors and associated retargetable compilers are currently very hot research topics
?Lack of good compilers requires many embedded system designers to program in assembly
language
02131 Embedded Systems Jan Madsen [42]
Processor: Application-specific (ASIP)
? Costumized datapath – 16, 8 or 4 bit
? Optimized for particular class of programs - MACC
? ”Simple” design flow
? High flexibility
if ...
then ... else ...
for { ...
..}
func
inst mem controller datapath data mem
func
pc
ir cu
reg +/-
*
+Processor: Application-specific - example
if ...
then ... else ...
for { ...
func
inst mem controller datapath data mem
func ir cu
+ reg
* p1
A[i]
02131 Embedded Systems Jan Madsen [44]
Summary
?Processors
?General-purpose
?Single-purpose (ASIC)
?Application-specific (ASIP)
?Common model
?FSMD - Finite State Machine with Datapath
controller datapath
What you will do!
if ...
then ... else ...
for { ...
..}
func