LECTURE 4: INTRODUCTION
TO EMBEDDED SYSTEMS
Dr. ASSAF M. H.
EE326 - EMBEDDED SYSTEMS
USP AUGUST 2018
TOPICS
• Overview
• Characteristics of Embedded Systems
• Soft-core Processors
• Challenges in Embedded Systems Design
• Design Level of Abstraction
• Typical CAD Design Flow
• Design Metrics
2
OVERVIEW
What is an embedded system?
Any computing system (device) other than a
general-purpose computer
Sophisticated functionality
Real-time operation
Low manufacturing cost
Low power
Reliable and secure
Designed to tight deadlines by small teams
http://www.digilentinc.com/
3
A SIMPLIFIED VIEW
4
EMBEDDED SYSTEMS OVERVIEW
Computing systems are everywhere
Most of us think of “desktop” computers
PCs
Laptops
Mainframes
Servers
But there’s another type of computing system
Far more common...
Embedded Systems Design: A Unified 5
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
EMBEDDED SYSTEMS OVERVIEW
• Embedded computing systems Computers are in here...
and here...
• Computing systems embedded within and even here...
electronic devices
• Hard to define. Nearly any computing system
other than a desktop computer
• Billions of units produced yearly, versus
millions of desktop units
• Perhaps 50 per household and per Lots more of these,
automobile
though they cost a lot
less each.
Embedded Systems Design: A Unified 6
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
A “SHORT LIST” OF EMBEDDED
SYSTEMS
Anti-lock brakes Modems
Auto-focus cameras MPEG decoders
Automatic teller machines Network cards
Automatic toll systems Network switches/routers
Automatic transmission On-board navigation
Avionic systems Pagers
Battery chargers Photocopiers
Camcorders Point-of-sale systems
Cell phones Portable video games
Cell-phone base stations Printers
Cordless phones Satellite phones
Cruise control Scanners
Curbside check-in systems Smart ovens/dishwashers
Digital cameras Speech recognizers
Disk drives Stereo systems
Electronic card readers Teleconferencing systems
Electronic instruments Televisions
Electronic toys/games Temperature controllers
Factory control Theft tracking systems
Fax machines TV set-top boxes
Fingerprint identifiers VCR’s, DVD players
Home security systems Video game consoles
Life-support systems Video phones
Medical testing systems Washers and dryers
And the list goes on and on
Embedded Systems Design: A Unified 7
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
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
Embedded Systems Design: A Unified 8
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
AN EMBEDDED SYSTEM EXAMPLE --
A DIGITAL CAMERA
Digital camera chip
CCD
CCD preprocessor Pixel coprocessor D2A
A2D
lens
JPEG codec Microcontroller Multiplier/Accum
DMA controller Display ctrl
Memory controller ISA bus interface UART LCD ctrl
Single-functioned -- always a digital camera
Tightly-constrained -- Low cost, low power, small, fast
Reactive and real-time -- only to a small extent
Embedded Systems Design: A Unified 9
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
FUNCTIONAL COMPLEXITY
• Often have to run sophisticated algorithms
- Cell phone, laser printer
• Often provide sophisticated user interfaces
10
W. Wolf, Computers as Components, Morgan Kaufman, 2005
REAL-TIME OPERATION
• Must finish operations by deadlines
- Hard real time: missing deadline causes failure
- Soft real time: missing deadline results in degraded
performance
• Many systems must handle operations at
widely varying rates (multi-rate systems)
11
W. Wolf, Computers as Components, Morgan Kaufman, 2005
NON-FUNCTIONAL
REQUIREMENTS
• Many embedded systems are mass-market
items that must have low manufacturing costs
- Limited memory
- microprocessor power
- etc.
• Power consumption is critical in battery-
powered devices
12
W. Wolf, Computers as Components, Morgan Kaufman, 2005
DESIGN TEAMS
• Designed by a small team of designers
• Must meet tight deadlines
- 6 month market window is common
13
W. Wolf, Computers as Components, Morgan Kaufman, 2005
PROCESSOR VARIETIES
• Microcontroller 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.
14
W. Wolf, Computers as Components, Morgan Kaufman, 2005
SOFT-CORE PROCESSORS
• Specified through FPGA programming just like
programmable logic
- Shipped as hardware description files (VHDL, VERILOG,
JHDL) which can be mapped on to FPGA board (NIOS II,
MICROBLAZE)
- Are bundled with software development tools (compiler,
simulator, etc.)
• Offer flexibility as microprocessor parameters can be
tuned to the application with tight on-chip
interconnection with additional circuitry
• Designs can be marketed quickly
- You can test and validate many designs quickly without
making any specific board
. no soldering/wiring 15
CHALLENGES IN EMBEDDED
SYSTEM DESIGN
• How much hardware do we need?
- How fast is the CPU?
- How big is the Memory?
• How do we meet our deadlines?
- Do we use faster hardware?
- Do we use cleverer software?
• How do we minimize power?
- Do we turn off unnecessary logic?
- Do we reduce memory accesses?
16
W. Wolf, Computers as Components, Morgan Kaufman, 2005
Design methodologies
A 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 the design methodology
steps
keep track of the design methodology itself
Xilinx Design tools: ISE Design Suite, …
17
W. Wolf, Computers as Components, Morgan Kaufman, 2005
Design goals
Performance
Overall speed
Deadlines
Functionality and user interface
Manufacturing cost
Power consumption
Other requirements (physical size, etc.)
18
W. Wolf, Computers as Components, Morgan Kaufman, 2005
Levels of abstraction
requirements
specification
architecture
component
design
system
integration
testing
19
W. Wolf, Computers as Components, Morgan Kaufman, 2005
Top-down vs. bottom-up
Top-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
20
W. Wolf, Computers as Components, Morgan Kaufman, 2005
Typical CAD design flow:
21
W. Wolf, Computers as Components, Morgan Kaufman, 2005
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
Embedded Systems Design: A Unified 22
Hardware/Software Introduction, (c) 2002 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
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
Embedded Systems Design: A Unified 23
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Design metric competition --
improving one may worsen others
Power Expertise with both
software and hardware
Performance Size
is needed to optimize
design metrics
Not just a hardware or
NRE cost software expert, as is common
A designer must be
comfortable with various
technologies in order to choose
Digital camera chip
CCD
the best for a given application
CCD preprocessor Pixel coprocessor D2A
A2D
lens
JPEG codec Microcontroller Multiplier/Accum
and constraints
DMA controller Display ctrl
Hardware
Software
Memory controller ISA bus interface UART LCD ctrl
Embedded Systems Design: A Unified 24
Hardware/Software Introduction, (c) 2002 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).
Speedup of B over S = B’s / A’s performance
Throughput speedup = 8/4 = 2
Embedded Systems Design: A Unified 25
Hardware/Software Introduction, (c) 2002 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
Embedded Systems Design: A Unified 26
Hardware/Software Introduction, (c) 2002 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
Controller Datapath Controller Datapath Controller Datapath
Control index
Control Register Control logic Registers
logic
logic and file and State total
State register register
Custom State
+
ALU register
General
IR PC ALU IR PC
Data Data
memory memory
Program Data Program memory
memory memory
Assembly code Assembly code
for: for:
total = 0 total = 0
for i =1 to … for i =1 to …
General-purpose (“software”) Application-specific Single-purpose (“hardware”)
Embedded Systems Design: A Unified 27
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Processor technology
Processors vary in their customization for the problem at
hand total = 0
for i = 1 to N loop
total += M[i]
end loop
Desired
functionality
General-purpose Application-specific Single-purpose
processor processor processor
Embedded Systems Design: A Unified 28
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
General-purpose processors
Programmable device used in a Controller Datapath
variety of applications Control Register
Also known as “microprocessor” logic and file
State register
Features
General
Program memory IR PC ALU
General datapath with large register file and
general ALU Program Data
User benefits memory memory
Low time-to-market and NRE costs Assembly code
for:
High flexibility
total = 0
“Pentium” the most well-known, for i =1 to …
but there are hundreds of others
Embedded Systems Design: A Unified 29
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Single-purpose processors
Digital circuit designed to execute Controller Datapath
exactly one program Control index
logic
coprocessor, accelerator or peripheral total
Features State
register +
Contains only the components needed to
execute a single program Data
No program memory memory
Benefits
Fast
Low power
Small size
Embedded Systems Design: A Unified 30
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Application-specific processors
Programmable processor Controller Datapath
optimized for a particular class of Control
logic and
Registers
applications having common State register
characteristics Custom
ALU
IR PC
Compromise between general-purpose and
single-purpose processors Data
memory
Features
Program
memory
Program memory Assembly code
Optimized datapath for:
Special functional units total = 0
for i =1 to …
Benefits
Some flexibility, good performance, size and
power
Embedded Systems Design: A Unified 31
Hardware/Software Introduction, (c) 2002 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
Three types of IC technologies
Full-custom/VLSI
Semi-custom ASIC (gate array and standard cell)
PLD (Programmable Logic Device)
gate
IC package IC oxide
source channel drain
Silicon substrate
Embedded Systems Design: A Unified 32
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Full-custom/VLSI
All layers are optimized for an embedded
system’s particular digital implementation
Placing transistors
Sizing transistors
Routing wires
Benefits
Excellent performance, small size, low power
Drawbacks
High NRE cost (e.g., $300k), long time-to-market
Embedded Systems Design: A Unified 33
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Semi-custom
Lower layers are fully or partially built
Designers are left with routing of wires and
maybe placing some blocks
Benefits
Good performance, good size, less NRE cost
than a full-custom implementation (perhaps
$10k to $100k)
Drawbacks
Still require weeks to months to develop
Embedded Systems Design: A Unified 34
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
PLD (Programmable Logic
Device)
All layers already exist
Designers can purchase an IC
Connections on the IC are either created or
destroyed to implement desired functionality
Field-Programmable Gate Array (FPGA) very popular
Benefits
Low NRE costs, almost instant IC availability
Drawbacks
Bigger, expensive (perhaps $30 per unit), power
hungry, slower
Embedded Systems Design: A Unified 35
Hardware/Software Introduction, (c) 2002 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
Logic transistors 100
per chip 10
(in millions) 1
0.1
Note:
0.01
logarithmic scale
0.001
Embedded Systems Design: A Unified 36
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Graphical illustration of Moore’s
law
1981 1984 1987 1990 1993 1996 1999 2002
10,000 150,000,000
transistors transistors
Leading edge Leading edge
chip in 1981 chip in 2002
Something that doubles frequently grows more quickly
than most people realize!
A 2002 chip can hold about 15,000 1981 chips inside itself
Embedded Systems Design: A Unified 37
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Design Technology
The manner in which we convert our concept of
desired system functionality into an implementation
Embedded Systems Design: A Unified 38
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
The co-design ladder
In the past: Sequential program code (e.g., C, VHDL)
Hardware and software Compilers
Behavioral synthesis
(1990's)
design technologies were (1960's,1970's)
very different
Register transfers
Assembly instructions RT synthesis
Recent maturation of Assemblers, linkers
(1980's, 1990's)
synthesis enables a unified (1950's, 1960's) Logic equations / FSM's
view of hardware and Logic synthesis
(1970's, 1980's)
Machine instructions
software Logic gates
Hardware/software
“codesign”
Implementation
Microprocessor plus VLSI, ASIC, or PLD
program bits: “software” implementation: “hardware”
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.
Embedded Systems Design: A Unified 39
Hardware/Software Introduction, (c) 2002 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- Single-
purpose ASIP purpose
General, processor processor Customized,
providing improved: providing improved:
Flexibility Power efficiency
Maintainability Performance
NRE cost Size
Time- to-prototype Cost (high volume)
Time-to-market
Cost (low volume)
PLD Semi-custom Full-custom
Embedded Systems Design: A Unified 40
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Designing hardware and software
components
You must 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
Example:
SOPC for Hardware design
Nios 2 IDE for Software Design
41
W. Wolf, Computers as Components, Morgan Kaufman, 2005
Design productivity exponential
increase 100,000
(K)
10,000
1,000
Trans./Staff – Mo.
Productivity
100
10
0.1
0.01
2005
1993
2001
2003
1983
1987
1985
1991
1989
1999
1997
1995
2007
2009
Exponential increase over the past few
decades
Embedded Systems Design: A Unified 42
Hardware/Software Introduction, (c) 2002 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 100,000
1,000 10,000
Logic transistors 100 1000
per chip 10 Gap 100 (K)
IC capacity
(in millions) 1 10
0.1 1
productivity
0.01 0.1 Productivity
0.001 0.01 Trans./Staff-Mo.
Embedded Systems Design: A Unified 43
Hardware/Software Introduction, (c) 2002 Vahid/Givargis