Embedded System and its Application

60
1 Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis Embedded System and its Application School of Software Harbin Institute of Technology 2008 Spring

description

Embedded System and its Application. School of Software Harbin Institute of Technology 2008 Spring. Instructor: Wang Ling Email:[email protected] Office: Room 209, Software School Building Tel:86418722. Course Goal. - PowerPoint PPT Presentation

Transcript of Embedded System and its Application

Page 1: Embedded System and its Application

1Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Embedded System and its Application

School of Software

Harbin Institute of Technology

2008 Spring

Page 2: Embedded System and its Application

2Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

• Instructor: Wang Ling • Email:[email protected]• Office: Room 209, Software School Building• Tel:86418722

Page 3: Embedded System and its Application

3Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Course Goal

• Develop an understanding of the design, implementation of embedded systems.

• Intent is to study issues relevant to embedded systems.

Page 4: Embedded System and its Application

4Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Course Content

• 1. Introduction• 2.Custom Single-purpose Processors: Hardware• 3.General-purpose Processors:Software• 4.Standard Single-Purpose Processors:Peripherals• 5.Memory• 6.Interface• 7.Digital Camera Example• 8.IC and Design Technology

Page 5: Embedded System and its Application

5Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

References

• Frank Vahid, Tony Givargis, Embedded system Design : A Unified Hardware/Software Introduction, 2002

• ( 中译本 ): 嵌入式系统设计—统一的硬件 / 软件设计 ,

• 北京航空航天大学出版社 , 2004

Page 6: Embedded System and its Application

6Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Grade:

Homework 20% (5)

Lab 40% (4)

Final Project 40%

Page 7: Embedded System and its Application

7

Embedded Systems Design: A Unified Hardware/Software Introduction

Chapter 1: Introduction

Page 8: Embedded System and its Application

8Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Outline

• Embedded systems overview– What are they?

• Design challenge – optimizing design metrics• Technologies

– Processor technologies

– IC technologies

– Design technologies

Page 9: Embedded System and its Application

9Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Embedded systems overview

• Computing systems are everywhere• Most of us think of “desktop” computers

– PC’s

– Laptops

– Mainframes

– Servers

• But there’s another type of computing system– Far more common...

Page 10: Embedded System and its Application

10Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Page 11: Embedded System and its Application

11Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Page 12: Embedded System and its Application

12Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

无线传感器网络(WSN: Wireless Sensor Network)

Page 13: Embedded System and its Application

13Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

– 感知节点( Sensor Nodes ):感知环境条件的物理与化学变化,采集与分析数据的装置。

– 感知网络( Sensor Nets ) :由大量的、可以相互通信与协调的感知节点组成的局部性分布式网络系统,该网络及感知节点将为完成统一的感知目标而共同工作

Page 14: Embedded System and its Application

14Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 节点: LiveNode

• LiveNode– 微处理器: AT91SAM7S256 ( 48MHz );

– 无线接入装置:• IEEE802.11b (WiFi) 或 IEEE802.15.4 (ZigBee) 通

过 UART1 接入;• GSM 设备通过 UART3 接入;

– 定位设备: GPS 接受器通过 UART0 接入;

– 信号调适器:连接各种不同传感器设备 : 土壤湿度, ECG 信号,温度以及光照强度等。

– 3 个 8 比特的扩展连接器:• 一个用于 SPI 总线 (8 bit) ,允许连接 3

LiveNode 节点从而形成一个容错的无线接入媒体;

• 一个用于 I²C 总线,实现模拟输入;• 一个用于通用目的的 I/O 连接。

Page 15: Embedded System and its Application

15Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 节点( 8 ):节点制造商

• Intel Research– Stargate2, iMote

• Crossbow (www.xbow.com)– Mica2 mote, Micaz, Dot mote and Stargate Platform

• Moteiv (www.moteiv.com)• Ember (www.ember.com)

– Integrated IEEE 802.15.4 stack and radio on a single chip• Millenial Net (www.millenial.com)

– iBean sensor nodes• Dust Inc

– Smart Dust• Cogent Computer (www.cogcomp.com)

– XYZ Node (CSB502) in collaboration with ENALAB@Yale• Sensoria Corporation (www.sensoria.com)

– WINS NG Nodes• 宁波中科集成电路设计中心无线传感器网络事业部( http://www.wsn.net.cn/)

– GAINS 系列

Page 16: Embedded System and its Application

16Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-军事

• 监督我方军力、装备和弹药

• 侦察敌方军力和地形• 战场监督• 战斗损伤评估• 智能导弹的制导系统• 原子、生物以及化学等大

杀伤性武器使用的检测和侦察

Page 17: Embedded System and its Application

17Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-军事侦察实例

• DARPA 的 SensIT 计划项目之一:无人机部署传感器网络用于车辆跟踪

Page 18: Embedded System and its Application

18Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-环境

• 森林火险监测• 洪水监测• 精确农耕• 环境的生物复杂性地图

Page 19: Embedded System and its Application

19Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-环境监测实例

• 大鸭岛海鸟栖息地监测www.greatduckisland.net

Page 20: Embedded System and its Application

20Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-居家

• 居家自动化– 微波炉– 冰箱– 吸尘器– 所有家电协同工作并可远程控制

• 智能居住环境(自适应用户个人喜好)– 光线强度– 音乐– 房间氛围

Page 21: Embedded System and its Application

21Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-智能房子实例

• Panasonic Eco & Ud House:

Page 22: Embedded System and its Application

22Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-健康

• 远程监控人体的生理数据(心脏心率、血压)– 采集的数据通过网络送到负责病人的主

管医生– 病人获得极大的行动自由

• 跟踪和监督医院内病人和医生• 医院的药物管理• 正确识别病人的敏感反应避免误诊

Page 23: Embedded System and its Application

23Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

WSN 应用-医疗看护实例

• STAR 项目

节点

Page 24: Embedded System and its Application

24Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

远程心脏实时监护系统

Local Patients

Remote Cardiologist

Page 25: Embedded System and its Application

25Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

农业环境监控

Page 26: Embedded System and its Application

26Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

汽车辅助靠站无线监控系统

Page 27: Embedded System and its Application

27Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

NASA Mars Exploration Rovers

Page 28: Embedded System and its Application

28Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: HunterProgrammable

DigitalThermostat.

Microprocessor: 4-bit

Page 29: Embedded System and its Application

29Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product:Vendo VMAX720 vending

machine.

Microprocessor:8-bit Motorola

68HC11.

Page 30: Embedded System and its Application

30Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: Sonicare Plus toothbrush.Microprocessor: 8-bit Zilog Z8.

Page 31: Embedded System and its Application

31Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: Palm Vxhandheld.

Microprocessor:32-bit MotorolaDragonball EZ.

Page 32: Embedded System and its Application

32Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: Motorola

i1000plus iDEN Multi-Service Digital Phone.

Microprocessor: Motorola32-bit MCORE.

Page 33: Embedded System and its Application

33Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: Sony AiboERS-110 Robotic

Dog.

Microprocessor: 64-

bit MIPS RISC.

Page 34: Embedded System and its Application

34Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: Rio 800MP3 Player.

Microprocessor: 32-bit RISC.

Page 35: Embedded System and its Application

35Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: RCARC5400P DVD

player.

Microprocessor: 32-bit RISC.

Page 36: Embedded System and its Application

36Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Product: IBMResearch’s Linux

wrist watchprototype.

Microprocessor:32-bit ARM RISC.

Page 37: Embedded System and its Application

37Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Some common characteristics of embedded systems

• Single-functioned– Executes a single program, repeatedly

• Tightly-constrained– Low cost, low power, small, fast, etc.

• Reactive and real-time– Continually reacts to changes in the system’s environment

– Must compute certain results in real-time without delay

Page 38: Embedded System and its Application

38Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

An embedded system example -- a digital camera

Microcontroller

CCD preprocessor Pixel coprocessorA2D

D2A

JPEG codec

DMA controller

Memory controller ISA bus interface UART LCD ctrl

Display ctrl

Multiplier/Accum

Digital camera chip

lens

CCD

• Single-functioned -- always a digital camera• Tightly-constrained -- Low cost, low power, small, fast• Reactive and real-time -- only to a small extent

Page 39: Embedded System and its Application

39Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design challenge – optimizing design metrics

• Obvious design goal:– Construct an implementation with desired functionality

• Key design challenge:– Simultaneously optimize numerous design metrics

• Design metric– A measurable feature of a system’s implementation

– Optimizing design metrics is a key challenge

Page 40: Embedded System and its Application

40Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design challenge – optimizing design metrics

• Common metrics– Unit cost: the monetary cost of manufacturing each copy of the system,

excluding NRE cost

– NRE cost (Non-Recurring Engineering cost): The one-time monetary cost of designing the system

– Size: the physical space required by the system

– Performance: the execution time or throughput of the system

– Power: the amount of power consumed by the system

– Flexibility: the ability to change the functionality of the system without incurring heavy NRE cost

Page 41: Embedded System and its Application

41Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design challenge – optimizing design metrics

• Common metrics (continued)– Time-to-prototype: the time needed to build a working version of the

system

– Time-to-market: the time required to develop a system to the point that it can be released and sold to customers

– Maintainability: the ability to modify the system after its initial release

– Correctness, safety, many more

Page 42: Embedded System and its Application

42Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design metric competition -- improving one may worsen others

• Expertise with both software and hardware is needed to optimize design metrics– Not just a hardware or

software expert, as is common

– A designer must be comfortable with various technologies in order to choose the best for a given application and constraints

SizePerformance

Power

NRE cost

Microcontroller

CCD preprocessor Pixel coprocessorA2D

D2A

JPEG codec

DMA controller

Memory controller ISA bus interface UART LCD ctrl

Display ctrl

Multiplier/Accum

Digital camera chip

lens

CCD

Hardware

Software

Page 43: Embedded System and its Application

43Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Time-to-market: a demanding design metric

• Time required to develop a product to the point it can be sold to customers

• Market window– Period during which the

product would have highest sales

• Average time-to-market constraint is about 8 months

• Delays can be costly

Revenues ($)

Time (months)

Page 44: Embedded System and its Application

44Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

NRE and unit cost metrics

• Costs:– Unit cost: the monetary cost of manufacturing each copy of the system,

excluding NRE cost– NRE cost (Non-Recurring Engineering cost): The one-time monetary cost of

designing the system– total cost = NRE cost + unit cost * # of units– per-product cost = total cost / # of units

= (NRE cost / # of units) + unit cost

• Example– NRE=$2000, unit=$100– For 10 units

– total cost = $2000 + 10*$100 = $3000– per-product cost = $2000/10 + $100 = $300

Amortizing NRE cost over the units results in an additional $200 per unit

Page 45: Embedded System and its Application

45Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

NRE and unit cost metrics

• Compare technologies by costs -- best depends on quantity– Technology A: NRE=$2,000, unit=$100

– Technology B: NRE=$30,000, unit=$30

– Technology C: NRE=$100,000, unit=$2

• But, must also consider time-to-market

Page 46: Embedded System and its Application

46Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

The performance design metric

• Widely-used measure of system, widely-abused– Clock frequency, instructions per second – not good measures– Digital camera example – a user cares about how fast it processes

images, not clock speed or instructions per second

• Latency (response time)– Time between task start and end– e.g., Camera’s A and B process images in 0.25 seconds

• Throughput– Tasks per second, e.g. Camera A processes 4 images per second– Throughput can be more than latency seems to imply due to

concurrency, e.g. Camera B may process 8 images per second (by capturing a new image while previous image is being stored).

Page 47: Embedded System and its Application

47Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Three key embedded system technologies

• Technology– A manner of accomplishing a task, especially using

technical processes, methods, or knowledge

• Three key technologies for embedded systems– Processor technology

– IC technology

– Design technology

Page 48: Embedded System and its Application

48Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Processor technology

• The architecture of the computation engine used to implement a system’s desired functionality

• Processor does not have to be programmable– “Processor” not equal to general-purpose processor

Application-specific

Registers

CustomALU

DatapathController

Program memory

Assembly code for:

total = 0 for i =1 to …

Control logic and State register

Datamemory

IR PC

Single-purpose (“hardware”)

DatapathController

Control logic

State register

Datamemory

index

total

+

IR PC

Registerfile

GeneralALU

DatapathController

Program memory

Assembly code for:

total = 0 for i =1 to …

Control logic and

State register

Datamemory

General-purpose (“software”)

Page 49: Embedded System and its Application

49Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

IC technology

• The manner in which a digital (gate-level) implementation is mapped onto an IC– IC: Integrated circuit, or “chip”

– IC technologies differ in their customization to a design

– IC’s consist of numerous layers (perhaps 10 or more)• IC technologies differ with respect to who builds each layer and

when

source drainchanneloxidegate

Silicon substrate

IC package IC

Page 50: Embedded System and its Application

50Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

IC Technology

• VLSI (Very-large Scale Integration)

--Full Custom• ASIC (Application-specfic IC Technology)

--Semi-Custom• PLD (Pogrammable Logic Device)

--PLA (Programmable Logic Array)

--PAL(Programmable Array Logic)

--FPGA (Field Programmable Gate Array)

Page 51: Embedded System and its Application

51Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Moore’s law

• The most important trend in embedded systems – Predicted in 1965 by Intel co-founder Gordon Moore

IC transistor capacity has doubled roughly every 18 months for the past several decades

10,000

1,000

100

10

1

0.1

0.01

0.001

Log

ic tr

ansi

stor

s pe

r ch

ip(i

n m

illi

ons)

1981 1983 1985 1987 1989 1991 1993 1995 1997 1999 2001 2003 2005 2007 2009

Note: logarithmic scale

Page 52: Embedded System and its Application

52Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Graphical illustration of Moore’s law

1981 1984 1987 1990 1993 1996 1999 2002

Leading edgechip in 1981

10,000transistors

Leading edgechip in 2002

150,000,000transistors

• Something that doubles frequently grows more quickly than most people realize!– A 2002 chip can hold about 15,000 1981 chips inside itself

Page 53: Embedded System and its Application

53Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design Technology

• The manner in which we convert our concept of desired system functionality into an implementation

Libraries/IP: Incorporates pre-designed implementation from lower abstraction level into higher level.

Systemspecification

Behavioralspecification

RTspecification

Logicspecification

To final implementation

Compilation/Synthesis: Automates exploration and insertion of implementation details for lower level.

Test/Verification: Ensures correct functionality at each level, thus reducing costly iterations between levels.

Compilation/Synthesis

Libraries/IP

Test/Verification

Systemsynthesis

Behaviorsynthesis

RTsynthesis

Logicsynthesis

Hw/Sw/OS

Cores

RTcomponents

Gates/Cells

Model simulat./checkers

Hw-Swcosimulators

HDL simulators

Gate simulators

Page 54: Embedded System and its Application

54Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design productivity exponential increase

• Exponential increase over the past few decades

100,000

10,000

1,000

100

10

1

0.1

0.01

19831981 1987 1989 1991 19931985 1995 1997 1999 2001 2003 2005 2007 2009

Productivity(K) Trans./Staff – Mo.

Page 55: Embedded System and its Application

55Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

The co-design ladder

• In the past:– Hardware and software

design technologies were very different

– Recent maturation of synthesis enables a unified view of hardware and software

• Hardware/software “codesign”

Implementation

Assembly instructions

Machine instructions

Register transfers

Compilers(1960's,1970's)

Assemblers, linkers(1950's, 1960's)

Behavioral synthesis(1990's)

RT synthesis(1980's, 1990's)

Logic synthesis(1970's, 1980's)

Microprocessor plus program bits: “software”

VLSI, ASIC, or PLD implementation: “hardware”

Logic gates

Logic equations / FSM's

Sequential program code (e.g., C, VHDL)

The choice of hardware versus software for a particular function is simply a tradeoff among various design metrics, like performance, power, size, NRE cost, and especially flexibility; there is no

fundamental difference between what hardware or software can implement.

Page 56: Embedded System and its Application

56Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Independence of processor and IC technologies

• Basic tradeoff– General vs. custom

– With respect to processor technology or IC technology

– The two technologies are independent

General-purpose

processor

ASIPSingle-purpose

processor

Semi-customPLD Full-custom

General,providing improved:

Customized, providing improved:

Power efficiencyPerformance

SizeCost (high volume)

FlexibilityMaintainability

NRE costTime- to-prototype

Time-to-marketCost (low volume)

Page 57: Embedded System and its Application

57Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design productivity gap

• While designer productivity has grown at an impressive rate over the past decades, the rate of improvement has not kept pace with chip capacity

10,000

1,000

100

10

1

0.1

0.01

0.001

Log

ic tr

ansi

stor

s pe

r ch

ip(i

n m

illi

ons)

100,000

10,000

1000

100

10

1

0.1

0.01

Pro

duct

ivit

y(K

) T

rans

./Sta

ff-M

o.

1981 1983 1985 1987 1989 1991 1993 1995 1997 1999 2001 2003 2005 2007 2009

IC capacity

productivity

Gap

Page 58: Embedded System and its Application

58Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Design productivity gap

• 1981 leading edge chip required 100 designer months– 10,000 transistors / 100 transistors/month

• 2002 leading edge chip requires 30,000 designer months– 150,000,000 / 5000 transistors/month

• Designer cost increase from $1M to $300M

10,000

1,000

100

10

1

0.1

0.01

0.001

Log

ic tr

ansi

stor

s pe

r ch

ip(i

n m

illi

ons)

100,000

10,000

1000

100

10

1

0.1

0.01

Pro

duct

ivit

y(K

) T

rans

./Sta

ff-M

o.

1981 1983 1985 1987 1989 1991 1993 1995 1997 1999 2001 2003 2005 2007 2009

IC capacity

productivity

Gap

Page 59: Embedded System and its Application

59Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

The mythical man-month

• The situation is even worse than the productivity gap indicates• In theory, adding designers to team reduces project completion time

• In reality, productivity per designer decreases due to complexities of team management and communication

• In the software community, known as “the mythical man-month” (Brooks 1975)

• At some point, can actually lengthen project completion time! (“Too many cooks”)

10 20 30 400

10000

20000

30000

40000

50000

60000

43

24

1916 15 16

18

23

Team

Individual

Months until completion

Number of designers

• 1M transistors, 1 designer=5000 trans/month

• Each additional designer reduces for 100 trans/month

• So 2 designers produce 4900 trans/month each

Page 60: Embedded System and its Application

60Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis

Summary

• Embedded systems are everywhere

• Key challenge: optimization of design metrics– Design metrics compete with one another

• A unified view of hardware and software is necessary to improve productivity

• Three key technologies– Processor: general-purpose, application-specific, single-purpose

– IC: Full-custom, semi-custom, PLD

– Design: Compilation/synthesis, libraries/IP, test/verification