embedded systems - university of...

26
Embedded Systems Octav Chipara Thursday, September 13, 12

Upload: vonhi

Post on 15-May-2018

217 views

Category:

Documents


1 download

TRANSCRIPT

Embedded Systems

Octav Chipara

Thursday, September 13, 12

Caught between two worlds

2

Embedded systems

PC world

Thursday, September 13, 12

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

Thursday, September 13, 12

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

Thursday, September 13, 12

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

Thursday, September 13, 12

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

Thursday, September 13, 12

Driving down the cost• Constrained memory, processor speeds, I/O• Example: Intel iMote 2

7

Thursday, September 13, 12

Pricing options

8

Thursday, September 13, 12

Sensor network hardware

9

Thursday, September 13, 12

Energy consumption

• Average full operation ~ 15 ma • AA batteries provide 1800ma => 5 days of continuous operation

• Significant energy consumed for:• radio• flash

10

Thursday, September 13, 12

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

Thursday, September 13, 12

Great Duck Island - 9 month battery life

12

Thursday, September 13, 12

Hardware options for embedded systems

13

ASIC FPGA Microprocessors

Thursday, September 13, 12

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

Thursday, September 13, 12

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

Thursday, September 13, 12

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

Thursday, September 13, 12

17

Since Wednesday, its 19th day on Mars, the Spirit had sentback 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

Thursday, September 13, 12

18

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?

Thursday, September 13, 12

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

Thursday, September 13, 12

Cyclic executive• Historically this has been the most common

approach

• What are the advantages?• What are the disadvantages?

20

Thursday, September 13, 12

Cyclic executive variations

21

Thursday, September 13, 12

Interrupt driven

22

Thursday, September 13, 12

Event driven

23

Thursday, September 13, 12

Threaded

24

• 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?

Thursday, September 13, 12

Dataflow driven

25

Thursday, September 13, 12

• Some of the slides were adapted from the following researchers• Chenyang Lu• John Regehr

26

Thursday, September 13, 12