Embedded Systems Octav Chipara
Caught between two worlds Embedded systems PC world 2
What are embedded systems? Any device that includes a computer (but you don t think of it as a computer) iphone digital camera game console wrist watch automobile airplanes mars rover >95% of microprocessors are used for embedded systems. Typically embedded systems interact closely with the physical environment in which they operate 3
What s special about embedded systems? It is not enough for a system to be functionally correct! Non-functional requirements are equally important real-time low power reliability form factor cost drives the selection of computer architectures and programming paradigm Typically developed by small engineering teams Short development cycles 4
Real-time requirements System works properly only when it meets timing constraints deadlines: a task must be completed within D seconds rate: complete N tasks per second 5
Real-time requirements Hard real-time systems violations lead to catastrophic failures mars rover anti-lock braking system air traffic control cd burning Soft real-time system violations lead to degraded performance video audio GPS 6
Driving down the cost Constrained memory, processor speeds, I/O Example: Intel imote 2 7
Pricing options 8
Sensor network hardware 9
Energy consumption Average full operation ~ 15 ma AA batteries provide 1800ma => 5 days of continuous operation Significant energy consumed for: radio flash 10
Power Battery powered devices - battery life is essential to optimize cell phones, ipods, remote sensors Wall powered devices - must minimize energy consumption lower operating costs cooling essential in data centers! 11
Great Duck Island - 9 month battery life 12
Hardware options for embedded systems ASIC FPGA Microprocessors 13
ASIC Ex: digital signal processing in cell phones Performance: Fast! Power: Fewer logic elements low power Development cost: Very high 2 million $ for producing a new ASIC Needs a long time and a large team Reprogrammability: None Single-purpose devices Difficult to patch and upgrade 14
Microprocessors Programmable computers are fundamentally slow fetch, decode, execute cycles Engineers developed methods to mitigate these limitations: pipeline cache clock frequency multi-core Performance is improved at the code of power use performance per watt remains low solution: aggressive power management 15
Microprocessors/Microcontrollers Software does the work faster and lower cost to developed than ASIC easy to upgrade and patch simplify the design for family of products this is a big deal! Micro-controllers vs. Micro-processors MCU: a system on chip with extra support for dealing with the real world analog to digital and digital to analog converters embedded networks: serial, I2C, CAN, USB, 802.15.4, etc general-purpose I/O pins lots of interrupt lines low-power sleep modes voltage / frequency scaling temperature / vibration / radiation resistance onboard volatile and nonvolatile RAM What else? 16
Since Wednesday, its 19th day on Mars, the Spirit had sent back to Earth only meaningless radio noise or simple beeps acknowledging receipt of commands If the software is awry, NASA can fix it from Earth by beaming patches across more than 100 million miles of space or by rebooting the rover's computer. But if the problem lies with the rover's hardware, the situation would be far more grave. NASA Gets Half-Hour of Signals From Rover By ANDREW BRIDGES, AP 17
Other typical characteristics of embedded systems Highly concurrent systems in such systems programming errors are easy to make, hard to debug They often lack virtual memory memory protection hardware supported user-kernel boundary secondary storage why are these features missing? 18
Software architectures Important high-level decision when building an embedded system: What does the main loop look like? How is control flow determined? What computations can preempt others, and when? How is data flow determined? Options: Cyclic executive Event-driven Threaded Dataflow Client-server 19
Cyclic executive Historically this has been the most common approach What are the advantages? What are the disadvantages? 20
Cyclic executive variations 21
Interrupt driven 22
Event driven 23
Threaded Threads usually sleep waiting for IO events to occur Highest priority runs except when it is blocked an interrupt is running it wakes up and another thread is executing in the kernel Advantages? Disadvantages? 24
Dataflow driven 25
Some of the slides were adapted from the following researchers Chenyang Lu John Regehr 26