Embedded Systems introduction Jan Madsen Informatics and Mathematical Modeling Technical University of Denmark Richard Petersens Plads, Building 321 DK2800 Lyngby, Denmark jan@imm.dtu.dk Wireless Sensor Networks Dataopsamling 02131 Embedded Systems Jan Madsen [2] 02131 Embedded Systems 1
Sensor Node Architecture sensor rtos cpu radio Mem battery sensing communicating processing 02131 Embedded Systems Jan Madsen [3] Sensor Node Architecture 8-bit, 10 MHz Slow computation sensor rtos cpu 1Kbps - 1Mbps, 3-100 Meter, Lossy Transmissions radio 128KB-1MB Limited Memory Mem battery Limited life 02131 Embedded Systems Jan Madsen [4] 02131 Embedded Systems 2
02131 Embedded Systems C programming practice, test, verification Assembly language basics Operating systems usage Interfaces SW-SW, HW-HW, SW-HW Processor design Microprocessor basics Specialized hardware sensor rtos cpu Mem radio battery 02131 Embedded Systems Jan Madsen [5] Det er ok at vise din kærste din nye computer, hvis du selv har lavet den 02131 Embedded Systems Jan Madsen [6] 02131 Embedded Systems 3
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!!! 02131 Embedded Systems Jan Madsen [9] Embedded systems if... bit-pattern then... else... for {..... 001010100101101 101011101101010 001010011101101 110101001010011 101010101010001 111101010111101 010111101101010 mem io CPU rom 02131 Embedded Systems Jan Madsen [10] 02131 Embedded Systems 4
Embedded systems Systems which use a computer to perform a specific tion, but are neither used nor perceived as a computer They are embedded within larger electronic devices Repeatedly carrying out a particular tion Often completely unrecognized by the device s user Heavily resource constrained 02131 Embedded Systems Jan Madsen [11] 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 [12] 02131 Embedded Systems 5
Medical systems: Hearing aid 02131 Embedded Systems Jan Madsen [13] Medical systems: Diagnostics 02131 Embedded Systems Jan Madsen [14] 02131 Embedded Systems 6
Smart pills 1st generation 02131 Embedded Systems Jan Madsen [15] Smart pills 2nd generation 02131 Embedded Systems Jan Madsen [16] 02131 Embedded Systems 7
Embedded Computing Systems? Smart buildings Energy control, air-conditioning, safety systems, etc. Sensor networks Environmental monitoring, animal monitoring, etc. Wearable computing 02131 Embedded Systems Jan Madsen [17] Wearable computing 02131 Embedded Systems Jan Madsen [18] 02131 Embedded Systems 8
Wearable computing 02131 Embedded Systems Jan Madsen [19] 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 [20] 02131 Embedded Systems 9
Flying micro-insects 02131 Embedded Systems Jan Madsen [21] How do we design these embedded systems? 02131 Embedded Systems Jan Madsen [23] 02131 Embedded Systems 10
Embedded systems design hardware software Several design groups hardware model validation software model validation Separated validations hardware prototype software prototype Prototype realization Problems arise at a very late point in the design process 02131 Embedded Systems Jan Madsen [24] Embedded systems design C/C++/Java 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); bit-pattern 001010100101101 101011101101010 001010011101101 110101001010011 101010101010001 111101010111101 010111101101010 DSP chip Size and speed requirements Need to know about hardware! 02131 Embedded Systems Jan Madsen [25] 02131 Embedded Systems 11
Hardware (chip) design C/C++/Java 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); architecture netlist Layout ASIC Size and speed requirements + energy 02131 Embedded Systems Jan Madsen [26] 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 Interface synthesis HW synthesis CPU ASIC 02131 Embedded Systems Jan Madsen [27] 02131 Embedded Systems 12
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 Interface synthesis HW synthesis System-on-Chip 02131 Embedded Systems Jan Madsen [28] BREAK 02131 Embedded Systems Jan Madsen [29] 02131 Embedded Systems 13
Processor technology Architecture of computation engine Does not have to be programmable Differs in its specialization towards a particular application Manifests different design metrics 02131 Embedded Systems Jan Madsen [30] Processor: General-purpose Designed to: maximize the number of devices sold suitable for a variety of applications Architecture contains: program memory general datapath large register file 02131 Embedded Systems Jan Madsen [31] 02131 Embedded Systems 14
Processor: General-purpose Used by the embedded system designer to program the processor s memory to carry out the required tionality This portion of an implementation is often referred to as the software portion 02131 Embedded Systems Jan Madsen [32] Software if... then... else... for {... cpu.. Elements of computation Transform data Store data Move data 02131 Embedded Systems Jan Madsen [33] 02131 Embedded Systems 15
Processor if... then... else... for {..... Architecture components Processing elements transform data Memories store data Interconnect movedata 02131 Embedded Systems Jan Madsen [34] Processor: General-purpose if... then... else... for {..... inst mem controller datapath data mem ir cu reg * pc +/- Availability Low cost (mass production) Simple design flow High flexibility 02131 Embedded Systems Jan Madsen [35] 02131 Embedded Systems 16
Processor: General-purpose - example if... then... else... for {..... inst mem controller datapath data mem ir cu reg pc * +/- p1 A[i] x = x + A[i] * p1 5 cycles 02131 Embedded Systems Jan Madsen [36] 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 [37] 02131 Embedded Systems 17
Processor: Single-purpose (ASIC) if... then... else... for {..... controller cu datapath * + +/- mem High performance Low power Complex design flow No flexibility 02131 Embedded Systems Jan Madsen [38] Processor: Single-purpose example if... then... else... for {..... controller cu datapath * + +/- p1 mem A[i] x = x + A[i] * p1 1 cycle 02131 Embedded Systems Jan Madsen [39] 02131 Embedded Systems 18
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) 02131 Embedded Systems Jan Madsen [40] 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 [41] 02131 Embedded Systems 19
Processor: Application-specific (ASIP) if... then... else... for {..... inst mem controller datapath data mem ir cu reg * + pc +/- Costumized datapath 16, 8 or 4 bit Optimized for particular class of programs - MACC Simple design flow High flexibility 02131 Embedded Systems Jan Madsen [42] Processor: Application-specific - example if... then... else... for {..... inst mem controller datapath data mem ir cu reg * + pc +/- p1 A[i] x = x + A[i] * p1 2 cycles 02131 Embedded Systems Jan Madsen [43] 02131 Embedded Systems 20
Summary Processors General-purpose Single-purpose (ASIC) Application-specific (ASIP) Common model FSMD - Finite State Machine with Datapath controller datapath 02131 Embedded Systems Jan Madsen [44] What you will do! if... Pentium IV Speed Size Energy then... else... for {... IJVM.. ASIC 02131 Embedded Systems Jan Madsen [45] 02131 Embedded Systems 21