Networking for Embedded Systems

Download Report

Transcript Networking for Embedded Systems

SEP561
Embedded Computing
KAIST 전산학과
맹 승 렬
[email protected]
Syllabus
 Instructors:
•
•
•
•
Seungryoul Maeng
Office : Room 4403
E-mail :[email protected]
Office Hours: M/W 15:00-16:00 or by appointment
 Class: (2, 3, 3)
• M/W 13:00 – 14:00 -> ??
 Class Website:
• http://camars.kaist.ac.kr/~maeng/sep561/ec06.htm
 TAs:
• 최민, 김재극
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
2
Syllabus (cont’d)

Related course

Course Outline

Lab Outline
• 하드웨어 직접제어를 통한 주변장치 제어
• TBD

Course Requirements
•
•
•
•
•
•
•
•
•
•
SEP562 내장형 시스템을 위한 시스템 소프트웨어
SEP564 내장형 운영체제 (fall 2006)
Introduction to Embedded Computing
Embedded Processor Architecture
Peripheral Interfacing
Performance and Power consumption
Specification and Modeling
Design Technologies
Knowledge
– Digital systems, computer architecture (organization), C programming and
Operating systems
Interest
– Strong interest in this fields
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
3
Syllabus (cont’d)
 Course Grading:
• 강의 : 60 %
– 시험 : 40%
– 기타(숙제, 퀴즈, 강의 출석, 참여도 등) : 20%
• 실험: 40%
* 모든 부분에서 copy를 할 경우 학점을 "F"로 줄 것임
 No textbook
 Reference Books:
• Embedded Systems Design : A Unified Hardware/Software
Introduction, Vahid, Wiley.
• Computers as Components: Principles of Embedded Computing
System Design, Wayne Wolf, Morgan Kaufmann.
• Embedded System Design, Peter Marwedel, Kluwer Academic
Publisher.
• 실험노트
• Selected Papers
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
4
Introduction
What are embedded systems?
Why do we care?
Trends
KAIST 전산학과
맹 승 렬
[email protected]
Definition
 Embedded system:
• any device that includes a programmable computer
• not itself a general-purpose computer
• perform specific function(s)
 Take advantage of application characteristics to
optimize the design:
• don’t need all the general-purpose bells and whistles.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
6
Embedding a computer
 Embedded within a larger system
CPU
embedded
computer
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
output
analog
input
analog
mem
7
Examples
 Simple control:
•
•
•
•
Front panel of microwave oven, etc.
Household appliances-Home network
PC keyboard (scans keys)
Analog TV: channel selection, etc.
 Complex
•
•
•
•
•
Personal digital assistant (PDA)
Printer
Cell phone
Automobile: engine, brakes, dash, etc.
Canon EOS 3 has three microprocessors.
– 32-bit RISC CPU runs auto-focus and eye control
systems.
• Digital TV
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
8
Automotive embedded systems
 Today’s high-end automobile may have 100
microprocessors:
• 4-bit microcontroller checks seat belt;
• microcontrollers run dashboard devices;
• 16/32-bit microprocessor controls engine.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
9
BMW 850i brake and stability control
system
 Anti-lock brake system (ABS): pumps brakes to
reduce skidding.
 Automatic stability control (ASC+T): controls
engine to improve stability.
 ABS and ASC+T communicate.
• ABS was introduced first---needed to interface to existing
ABS module.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
10
BMW 850i, cont’d.
sensor
sensor
brake
brake
ABS
hydraulic
pump
brake
brake
sensor
sensor
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
11
Early history
 Late 1940’s: MIT Whirlwind computer was
designed for real-time operations.
• Originally designed to control an aircraft simulator.
 First microprocessor was Intel 4004 in Feb. 1971 –
4 bit controller: Busicom
 Intel 8008, April 1972, Datapoint.
 HP-35 calculator used several chips to implement a
microprocessor in 1972.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
12
Early history, cont’d.
 Automobiles used microprocessor-based engine
controllers starting in 1970’s.
• Control fuel/air mixture, engine timing, etc.
• Multiple modes of operation: warm-up, cruise, hill
climbing, etc.
• Provides lower emissions, better fuel efficiency.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
13
Why do we care?
 Embedded computing a field or just a fad?
– Building embedded systems for decades
• Increase in complexity
• Market growth
 Increasing complexity
• Early microprocessors
– Limited performance -> manage I/O devices
– Assembly languages
• By the early 1980s, 16-bit microprocessors
– Automobile engine controls that relied on sophisticated
algorithms (Motorola 68000)
– Numerical method like Kalman filters
– Laser and inkjet printers
• By the early 1990s, cell phones contains five or six DSPs and
CPUs
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
14
Why do we care? Cont’d.
 Embedded computer HW/SW are on the critical design path
for many types of electronic systems
• Modern cars: up to ~100 processors running complex software
– engine & emissions control, stability & traction control,
diagnostics, gearless automatic transmission
 Problems
• Undersized HW platform : software design difficulties
• Bad SW architecture : SW, Performance, and Power problems
• Underestimating power consumption: reducing the entire system’s
effective lifetime
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
15
Complexity, Quality, & Time To Market today
Instrument Cluster
Telematic Unit
Memory
184 KB
8MB
Lines of Code
45,000
300,000
Productivity
6 Lines/Day
10 Lines/Day
Change Rate
1 Year
< 1 Year
Dev. Effort
30 Man-yr
200 Man-yr
Validation Time
2 Months
2 Months
Time to Market
12 Months
< 12 Months
*from Sangiovanni-Vincentelli’s lecture notes
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
16
Embedded processor market
 Estimated 98% of 8 Billion CPUs produced in 2000
used for embedded apps
Where Are the Processors?
Direct
2%
Robots Vehicles
6%
12%
8.5B Parts
per Year
Look for the CPUs…the Opportunities Will Follow!
Source: DARPA/Intel (Tennenhouse)
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
17
Embedded Market Growth
 ARM processors : 1.5 billion processors
• 3x more than Intel Pentiums
 Worldwide mobile phone : 35% quarterly increase
 Worldwide portable flash player market : expected
to grow by a factor of 4 between 2003 and 2008
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
18
Strongly tied to advances in
semiconductor
 IC technology
– 50 mm2: intel Pentium D ( 162mm2)
– More than 100 million transistors : intel Pentium D
(376 M)
– Intel Pentium D ( 65 nm)
– 1-10 GHz
 Cost is almost independent of functionality
 So there is a strong incentive to implement an
application and a system to the “chip”
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
19
Typical Characteristics of Embedded
Systems
 Part of a larger system
• not a “computer with keyboard, display, etc.”
 HW & SW do application-specific function – not G.P.
• application is known a priori
• but definition and development concurrent
 Some degree of re-programmability is essential
• flexibility in upgrading, bug fixing, product differentiation,
product customization
 Interact (sense, manipulate, communicate) with
the external world
• Reactive system
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
20
Typical Characteristics of embedded
systems (cont’d)
 Real-time operation
• Operation is time constrained: latency, throughput
• Must finish operations by deadlines.
– Hard real time: missing deadline causes failure.
– Soft real time: missing deadline results in degraded performance.
• Many systems are multi-rate: must handle operations at widely varying
rates.
 Low power
• Power consumption is critical in battery-powered devices.
– Excessive power consumption increases system cost even in wallpowered devices.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
21
Typical Characteristics of embedded
systems (cont’d)
 Distributed systems
• Physically distributed
• Economical
• Multiple processors to handle multiple time-critical tasks
 Low manufacturing cost
• Many embedded systems are mass-market items that
must have low manufacturing costs.
– Limited memory, microprocessor power, etc.
 size, weight, heat, reliability etc.
 Designed to tight deadlines by small teams.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
22
Key Recent Trends
 Sophisticated functionality.
• Often have to run sophisticated algorithms or multiple
algorithms.
– Cell phone, laser printer.
• Often provide sophisticated user interfaces.
 Increasing computation demands
• e.g. multimedia processing in set-top boxes, HDTV
 Increasingly networked
• to eliminate host, and remotely monitor/debug
• embedded Web servers
– e.g. Axis camera http://neteye.nesl.ucla.edu
– e.g. Mercedes car with web server
• embedded Java virtual machines
– e.g. Java ring, smart cards, printers
• cameras, disks etc. that sit directly on networks
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
23
Key Recent Trends
 Often designed by a small team of designers.
– Often must meet tight deadlines.
– 6 month market window is common.
 Increasing need for flexibility
• time-to-market under ever changing standards!
• Reuse of HW and SW components
– Processors
– Software components
 Increasing integration and system complexity
 Need careful co-design of h/w & s/w!
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
24
Challenges in embedded system design
 How much hardware do we need?
• How big is the CPU? Memory?
 How do we meet our deadlines?
• Faster hardware or cleverer software?
 How do we minimize power?
• Turn off unnecessary logic? Reduce memory accesses?
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
25
Challenges in embedded system design
(cont’d)
 Does it really work?
•
•
•
•
Is the specification correct?
Does the implementation meet the spec?
How do we test for real-time characteristics?
How do we test on real data?
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
26
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
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
27
Design challenge – optimizing design
metrics (cont’d)
 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
– MIPS?, operations/sec?
• Power: the amount of power consumed by the system
– Watts
– Energy?
• Flexibility: the ability to change the functionality of the
system without incurring heavy NRE cost
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
28
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
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
29
Design metric competition -- improving
one may worsen others
 Expertise with both software
and hardware is needed to
optimize design metrics
Power
Performance
Size
NRE cost
CCD
Digital camera chip
A2D
CCD preprocessor
Pixel coprocessor
D2A
• 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
lens
JPEG codec
Microcontroller
Multiplier/Accum
DMA controller
Memory controller
Display ctrl
ISA bus interface
UART
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
LCD ctrl
Hardware
Software
30
Time-to-market: a demanding design
metric
 Time required to develop a
product to the point it can
be sold to customers
 Market window
Revenues ($)
• Period during which the
product would have highest
sales
 Average time-to-market
Time (months)
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
constraint is about 8
months
 Delays can be costly
31
Losses due to delayed market entry
 Simplified revenue model
Revenues ($)
Peak revenue
Peak revenue from
delayed entry
On-time
Market fall
Market rise
Delayed
D
On-time
entry
Delayed
entry
W
2W
Time
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
• Product life = 2W, peak at
W
• Time of market entry
defines a triangle,
representing market
penetration
• Triangle area equals
revenue
 Loss
• The difference between the
on-time and delayed
triangle areas
32
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
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
33
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
$200,000
B
C
$120,000
$80,000
$0
$0
1600
2400
C
$80
$40
800
B
$120
$40,000
0
A
$160
p er p rod uc t c ost
$160,000
tota l c ost (x1000)
$200
A
0
Numb er of units (volume)
800
1600
2400
Numb er of units (volume)
• But, must also consider time-to-market
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
34
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).
 Speedup of B over S = B’s performance / A’s performance
• Throughput speedup = 8/4 = 2
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
35
Traditional Embedded Systems and
Design
 What is the difference?
• Functional complexity
• Hardware trends
• Software trends
 Design Methodologies
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
36
“Traditional” Hardware Embedded
Systems = ASIC
ASIC Features
Area: 4.6 mm x 5.1 mm
Speed: 20 MHz @ 10 Mcps
Technology: HP 0.5 mm
Power: 16 mW - 120 mW (mode
dependent) @ 20 MHz, 3.3 V
Avg. Acquisition Time: 10 ms to 300
ms
 A direct sequence spread spectrum (DSSS) receiver ASIC
(UCLA)
[Srivastava]
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
37
“Traditional” Software Embedded
Systems = CPU + RTOS
[Srivastava]
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
38
Modern Embedded Systems?
DSP
Code
Application
Specific Gates
Analog
I/O
Processor
Cores
Memory
 Embedded systems employ a combination of
• application-specific h/w (boards, ASICs, FPGAs etc.)
– performance, low power
• s/w on prog. processors: DSPs, mcontrollers etc.
– flexibility, complexity
• mechanical transducers and actuators
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
39
Increasingly on the Same Chip
System-on-Chip (SoC)
 SC3001 DIRAC chip (Sirius Communications)
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
[Srivastava]
40
Reconfigurable SoC
Other Examples
Atmel’s FPSLIC
(AVR + FPGA)
Altera’s Nios
(configurable
RISC on a PLD)
Triscend’s A7 CSoC
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
[Srivastava]
41
HW and SW Codesign
 Traditional design
• SW and HW partitioning
– By manual, an early stage of a design
– Designs proceed separately from then
 CAD tools
• At a purely hardware level
– Efficient techniques for data-path and control synthesis
down to silicon
 Codesign
• HW/SW designs
– Parallel with feedback and interaction
• Final HW/SW partition/allocation is made after evaluating
trade-offs and performance of options
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
42
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
Sequential program code (e.g., C, VHDL)
Behavioral synthesis
(1990's)
Compilers
(1960's,1970's)
Register transfers
Assembly instructions
RT synthesis
(1980's, 1990's)
Assemblers, linkers
(1950's, 1960's)
Logic equations / FSM's
Machine instructions
Logic synthesis
(1970's, 1980's)
 SW/HW codesign
Logic gates
Microprocessor plus
program bits: “software”
Implementation
VLSI, ASIC, or PLD
implementation: “hardware”
The choice of hardware versus software for a particular function is simply a tradeoff among various
design metrics, like performance, power, size, and especially flexibility; there is no fundamental
difference between what hardware or software can implement.
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
43
The co-design ladder
2004
전문대교수연수
([email protected])
2006년Spring
SEP561 Embedded
Computing
44