Introduction to Embedded System Xiaoming JU 2005.2
Mar 13, 2016
Introduction to Embedded System
Xiaoming JU
2005.2
© 2005 JXM Introduction to Embedded Systems 2
IntroductionWhat are embedded systems?Challenges in embedded system
design.Design methodologies.
© 2005 JXM Introduction to Embedded Systems 3
Definition What is a real-time system?
“A real-time computer system may be defined as one which controls an environment by receiving data, processing them, and returning the results sufficiently quickly to affect the environment at the time”
“Pertaining to processing of data by a computer in connection with another process outside the computer according to time requirements imposed by the outside process”
What is an embedded system? “Anything that uses a computer but does not look like one” “The microprocessor in an embedded system is like an
electric motor in a washing machine” “An Embedded system means the real-time software is a
component of a larger HW/SW system”
© 2005 JXM Introduction to Embedded Systems 4
Embedding a computer
CPU
mem
input
output analog
analog
embeddedcomputer
Embedded Systems are quite diverse, no one statement describes them all
© 2005 JXM Introduction to Embedded Systems 5
Memory
CPU
FPGA/ASIC
Human Interface
A/D Conversion
SENSORS Electromechanical backup & safety Actuators
D/A Conversion
Diagnostic port
Auxililary systems
External Environment
From: Koopman, P., Embedded System Desing Issues - The rest of the Story, Proc of 1996 CCD
© 2005 JXM Introduction to Embedded Systems 6
Products with Embedded Systems ?
Of 4 billions microprocessors/microcontrollers sold per year, 95% are for embedded products: VCRs, DVD players Cell phone Microwave Washer Camera Cars (antilock brake system, air-bag, gas
injection, electricity distribution..) Printers, copiers ………
© 2005 JXM Introduction to Embedded Systems 7
Early history Late 1940’s: MIT Whirlwind
computer was designed for real-time operations. Originally designed to control an
aircraft simulator. 1971: Intel 4004, first
microprocessor (4bits), initially for a calculator.
Microprocessors get so cheap that microprocessor-based control systems become the rule.
Only limit: processing time.c
© 2005 JXM Introduction to Embedded Systems 8
Microprocessor varietiesMicrocontroller: includes I/O devices,
on-board memory.Digital signal processor (DSP):
microprocessor optimized for digital signal processing.
Typical embedded word sizes: 8-bit, 16-bit, 32-bit.
© 2005 JXM Introduction to Embedded Systems 9
Application examplesCanon EOS 3 camera has three
microprocessors. One of 32-bit RISC CPU runs autofocus and eye
control systems.Digital TV: programmable CPUs + hardwired
logic.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.
© 2005 JXM Introduction to Embedded Systems 10
BMW 850i brake and stability control systemAnti-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.
© 2005 JXM Introduction to Embedded Systems 11
BMW 850i, cont’d.
brake
sensor
brake
sensor
brake
sensor
brake
sensor
ABS hydraulicpump
© 2005 JXM Introduction to Embedded Systems 12
Characteristics of embedded systems Single function (dedicated to a specific task). Tightly constrained based on design metrics such
as. Cost Size Power Performance Real time constraints
A wide verity of embedded processors and processor architectures are available.
May not have an operating system if it does it is probably a real time operating system (RTOS).
© 2005 JXM Introduction to Embedded Systems 13
Real-time operationMust 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.
© 2005 JXM Introduction to Embedded Systems 14
Why use microprocessors? Alternatives: field-programmable gate
arrays (FPGAs), custom logic, etc.
Microprocessors are often very efficient: can use same logic to perform many different functions.
Microprocessors simplify the design of families of products.
© 2005 JXM Introduction to Embedded Systems 15
The performance paradoxMicroprocessors use much more
logic to implement a function than does custom logic.
But microprocessors are often at least as fast: heavily pipelined; large design teams; aggressive VLSI technology.
© 2005 JXM Introduction to Embedded Systems 16
PowerCustom logic is a clear winner for low
power devices.
Modern microprocessors offer features to help control power consumption.
Software design techniques can help reduce power consumption.
© 2005 JXM Introduction to Embedded Systems 17
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
© 2005 JXM Introduction to Embedded Systems 18
Challenges, etc.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
© 2005 JXM Introduction to Embedded Systems 19
Challenges, etc. 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
© 2005 JXM Introduction to Embedded Systems 20
The next design challenge: SoC System-on-chip (SoC)
prefabricated components: IP cores
great importance of software
How do you design such systems? Mostly done in an
ad-hoc-fashion
DSP core 1
(ST18950):
Sound codec
DSP core 1
(ST18950):
modem
MCU 1 (ASIP):
Master control
MCU 2 (ASIP):
Mem. Controller
MCU 3 (ASIP):
Bit manip.
VLIW DSP:
Programmable video operations
std. extensions
High-speed H/W:
Video operators for DCT, inv.
DCT, motion estimation
Memory:
Video RAM
Glue logic
I/O: Serial interface
I/O: Host interface
A/D
&
D/A
Hardware
Embedded Real-time Software
SGS-Thomson Videophone
© 2005 JXM Introduction to Embedded Systems 21
How do you design embedded system? Classical water-fall model:
Requirements specification: Determine what the client wants
Analysis: Determine what needs to be done Ideally we would have an executable specification of the
system Design:
Determine how the analysis result should be implemented Come up with an implementation plan
Implementation: Coding
Testing: Determine that the implementation is what needed to be
done
© 2005 JXM Introduction to Embedded Systems 22
Required Features for Embedded System
ThroughputResponseTestabilityLow powerReliabilitySafety
MaintainabilitySecurityAvailabilityCostSize/WeightSurvivability
© 2005 JXM Introduction to Embedded Systems 23
Design methodologiesA procedure for designing a system.Understanding your methodology helps
you ensure you didn’t skip anything.Compilers, software engineering tools,
computer-aided design (CAD) tools, etc., can be used to: help automate methodology steps; keep track of the methodology itself.
© 2005 JXM Introduction to Embedded Systems 24
Levels of abstractionrequirements
specification
architecture
componentdesign
systemintegration
Top-down
Bottom-up
© 2005 JXM Introduction to Embedded Systems 25
Top-down vs. bottom-upTop-down design:
start from most abstract description; work to most detailed.
Bottom-up design: work from small components to big
system.Real design uses both techniques.
© 2005 JXM Introduction to Embedded Systems 26
Stepwise refinementAt each level of abstraction, we
must: analyze the design to determine
characteristics of the current state of the design;
refine the design to add detail; ensure all design objects.
© 2005 JXM Introduction to Embedded Systems 27
RequirementsPlain language description of what
the user wants and expects to get.May be developed in several ways:
talking directly to customers; talking to marketing representatives; providing prototypes to users for
comment.
© 2005 JXM Introduction to Embedded Systems 28
Functional vs. non-functional requirementsFunctional requirements:
output as a function of input.Non-functional requirements:
time required to compute output; size, weight, etc.; power consumption; reliability; etc.
© 2005 JXM Introduction to Embedded Systems 29
Our requirements formnamepurposeinputsoutputsfunctionsperformancemanufacturing costpowerphysical size/weight
© 2005 JXM Introduction to Embedded Systems 30
Example: GPS moving map requirementsMoving map
obtains position from GPS, paints map from local database.
lat: 40°13′ lon: 32°19′
I-78
Scot
ch R
oad
Display position
Current position
© 2005 JXM Introduction to Embedded Systems 31
GPS moving map needs Functionality: For automotive use. Show major
roads and landmarks. User interface: At least 400 x 600 pixel screen.
Three buttons max. Pop-up menu. Performance: Map should scroll smoothly. No more
than 1 sec power-up. Lock onto GPS within 15 seconds.
Cost: $500 street price = approx. $100 cost of goods sold.
Physical size/weight: Should fit in hand. Power consumption: Should run for 8 hours on four
AA batteries.
© 2005 JXM Introduction to Embedded Systems 32
GPS moving map requirements form
name GPS moving mappurpose consumer-grade
moving map for drivinginputs power button, two
control buttonsoutputs back-lit LCD 400 X 600functions 5-receiver GPS; three
resolutions; displayscurrent lat/lon
performance updates screen within0.25 sec of movement
manufacturing cost $100 cost-of-goods-sold
power 100 mWphysical size/weight no more than 2: X 6:,
12 oz.
© 2005 JXM Introduction to Embedded Systems 33
SpecificationA more precise description of the system:
should not imply a particular architecture; provides input to the architecture design
process.May include functional and non-
functional elements.May be executable or may be in
mathematical form for proofs.
© 2005 JXM Introduction to Embedded Systems 34
GPS specificationShould include:
What is received from GPS; map data; user interface; operations required to satisfy user
requests; background operations needed to keep
the system running.
© 2005 JXM Introduction to Embedded Systems 35
Architecture designWhat major components go satisfying
the specification?Hardware components:
CPUs, peripherals, etc.Software components:
major programs and their operations.Must take into account functional and
non-functional specifications.
© 2005 JXM Introduction to Embedded Systems 36
GPS moving map block diagram
GPSreceiver
searchengine renderer
userinterfacedatabase
display
© 2005 JXM Introduction to Embedded Systems 37
GPS moving map hardware architecture
GPSreceiver
CPU
panel I/O
display framebuffer
memory
© 2005 JXM Introduction to Embedded Systems 38
GPS moving map software architecture
position databasesearch renderer
timeruserinterface
pixels
© 2005 JXM Introduction to Embedded Systems 39
GPS
© 2005 JXM Introduction to Embedded Systems 40
Designing hardware and software componentsMust spend time architecting the
system before you start coding.Some components are
ready-made, some can be modified from existing
designs, others must be designed from scratch.
© 2005 JXM Introduction to Embedded Systems 41
System integrationPut together the components.
Many bugs appear only at this stage.Have a plan for integrating
components to uncover bugs quickly, test as much functionality as early as possible.
© 2005 JXM Introduction to Embedded Systems 42
Thank you