You are on page 1of 64

Module 1:

Embedded Systems
MEL1123 Advanced Microprocessor Systems
Dr. Usman Ullah Sheikh
Universiti Teknologi Malaysia
Email: usman@fke.utm.my

2013-2014-1

1
Objectives
Define embedded system
Introduce the design process
Define an embedded systems architecture
Describe the embedded design metrics

2
Computing Systems
Most of us think of general purpose computers
PC
Laptop
Mainframe
Server
In this course, we will look at another type of computing
system which is far more common.

3
Embedded Systems
A single-purpose computer
built into a larger system
for the purposes of
controlling and monitoring
the system
Nearly any computing
system other than a
desktop computer

4
What Makes Embedded Systems Different
Billions of units produced yearly, versus millions of general
purpose computers
Dedicated to a specific task or tasks.
Rich variety of microprocessors ( over 300 types ).
Designs are cost-sensitive.
May have constraints in real-time performance, power
consumption & size
Fewer system resources then a general purpose system.
Software failure can be life-threatening.

5
What Makes Embedded Systems Different
(cont)
Operate over a wide-range of environmental conditions.
All code might be stored in ROM.
If an operating system is used at all, it may be using an
embedded OS or a a Real-Time Operating System (RTOS).
Require specialized design tools.

6
Not so Easy to Define
iPhone has embedded system
traits:
Size & power consumption
constraints
Limited systems resources
Code is stored in ROM (flash)
But it also has PC traits:
Apps may be chosen by user
Software failure is not life-
threatening
Non-real time OS

7
Embedded Systems Architecture
Every embedded system has an architecture. An architecture
by definition is a set of representations of those elements
and their relationships.
The architecture of an embedded system is an abstraction of
the embedded device.
Embedded architecture is a useful tool in understanding all of
the major elements, why each component is there, and why
the elements behave the way they do.

8
Computer Systems as Layers

9
Embedded System Hardware
Processor
The main player
Memory
Program memory contains
applications, firmware & OS
Data memory contains transient
data
Interface circuits, I/O Ports
Windows to the outside world
Interrupt controller
Manages processor-I/O dialogs

10
Embedded System Software
Firmware
Any software that is permanently programmed.
In simple systems, may be all that is required for operation
Application(s)
Performs the main function of the system
Simple systems may have only one app running
Operating system
Supervises and supports execution of multiple applications
May be the real-time variety, for system requiring deterministic
response times

11
Simple Embedded Systems
Single 4-, 8- or 16-bit
Microcontroller.
Simple hardware and
software.
May even be battery
operated.
Assembly language or C is
used for developing these
system.
The need to limit power
dissipation when system is
running continuously.

12
Complex Embedded Systems
32-bit processor cores.
Large memory, enough to
accommodate an OS
May contain multiple
processors.
Battery/AC operated.
Multiple languages may be
used to program: C, C++,
Java, Forth, Python etc
Requires complex
development tools.

13
Current State-of-the-Art
Multiple computational and data-
processing engines, memory, and
peripherals, all constructed on a single
silicon chip called a System-on-Chip
(SoC).
Multiple general-purpose central
processing unit (CPU) cores as well as
special-purpose digital signal
processor (DSP) cores
The processor is just a component in a
complex system.

14
Embedded System Design

15
Design Metrics
Design metric
A measurable feature of a systems implementation
Common metrics
NRE cost (Non-Recurring Engineering cost):
The one-time monetary cost of designing the system
Unit cost:
The monetary cost of manufacturing each copy of the system, excluding
NRE cost
Size:
The physical space required by the system
Performance:
The execution time or throughput of the system

16
Design Metrics
Common metrics (continued)
Power:
The amount of power consumed by 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

17
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

18
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 $200
A A
B B
$160,000 $160
C C
tota l c ost (x1000)

p er p rod uc t c ost
$120,000 $120

$80,000 $80

$40,000 $40

$0 $0
0 800 1600 2400 0 800 1600 2400
Numb er of units (volume) Numb er of units (volume)

But, must also consider time-to-market


19
Time-to-Market

20
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., Cameras 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).

21
Most Embedded Systems are SoC
SoC Definition:
Complex IC that integrates the major functional elements of a
complete end-product into a single chip or chipset
The SoC design typically incorporates
Programmable processor
On-chip memory
HW accelerating function units (DSP)
Peripheral interfaces (GPIO and AMS blocks)
Embedded software

Source: Surviving the SoC revolution A Guide to Platform-based Design, Henry Chang
et al, Kluwer Academic Publishers, 1999

22
SoB vs SoC
Conceptually System on Chip refers to integrating the
components of a board onto a single chip.
Looks straightforward but productivity levels are too low to
make it a reality

23
Three Key Technologies
Technology
A manner of accomplishing a task, especially using technical
processes, methods, or knowledge
Three key technologies for embedded systems
Processor technology
IC/Implementation technology
Design methodology

24
Processor Technology
Processors vary in their customization for the problem at
hand
total = 0
for i = 1 to N
loop
total += M[i]
Desired functionality end loop

General-purpose Application-specific Single-purpose


processor processor processor

25
General-Purpose Processors
Programmable device used in a variety of
applications
Controller Datapath

Control
Also known as microprocessor
Register
logic and file
Features
State
register
Program memory General
ALU
IR PC
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

Intel x86 architecture the most well- for i =1 to

known, but there are hundreds of others

26
Single-Purpose Processors
Digital circuit designed to execute exactly
one program Controller Datapath
Control index
a.k.a. coprocessor, accelerator or peripheral logic
total
e.g. H.264 decoder State
Features register +

Contains only the components needed to


Data
execute a single program memory
No program memory
Benefits
Fast
Low power
Small size

27
Application-Specific Instruction-Set
Processors (ASIP)
Programmable processor optimized for a Controller Datapath
particular class of applications having Control Registers
common characteristics logic and
State
Compromise between general-purpose and register
Custom
single-purpose processors ALU
IR PC
eg DSP, GPU
Data
Features Program memory
memory
Program memory
Optimized datapath
Assembly code
for:

Special functional units total = 0


for i =1 to
Benefits
Some flexibility, good performance, size and
power

28
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
ICs consist of numerous layers (perhaps 10 or more)
IC technologies differ with respect to who builds each layer and when

gate
IC package IC oxide
source channel drain
Silicon substrate

29
IC/Implementation Technologies
Three types of IC technologies
Full-custom ASIC/VLSI
Semi-custom ASIC (gate array and standard cell)
PLD (Programmable Logic Device)
ASIC (Application Specific Integrated Circuit) is basically an
integrated circuit designed specifically for a special purpose
or application. Strictly speaking, this also implies that an
ASIC is built only for one and only one customer.

30
Full Custom ASIC/VLSI
All layers are optimized for an embedded systems 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

31
Semi-Custom ASIC
Lower layers are fully or partially built
Designers are left with routing of wires and maybe placing some
blocks
Can be partly customized to serve different functions within its general
area of application
May be subdivided into gate-array and standard-cell approaches
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

32
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

33
Processor vs IC Technologies
Basic tradeoff
General vs. custom
The two technologies are independent

General- Single-
General, purpose ASIP purpose Customized,
providing improved: processor processor providing improved:

Flexibility
Maintainability Power efficiency
NRE cost Performance
Time- to-prototype Size
Time-to-market Cost (high volume)
Cost (low volume)

PLD Semi-custom Full-custom

34
Design Methodology
The manner in which we convert our concept of desired
system functionality into an implementation
Compilation/ Libraries/ Test/
Synthesis IP Verification

System System Hw/Sw/ Model simulat./


Compilation/Synthesis: Automates specification synthesis OS checkers
exploration and insertion of implementation
details for lower level.

Behavioral Behavior Cores Hw-Sw


specification synthesis cosimulators
Libraries/IP: Incorporates pre-designed
implementation from lower abstraction level
into higher level.
RT RT RT HDL
specification synthesis components simulators

Test/Verification: Ensures correct


functionality at each level, thus reducing
costly iterations between levels. Logic Logic Gates/ Gate
specification synthesis Cells simulators

To final implementation

35
Moores 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: logarithmic
0.01
scale
0.001

36
Projections of 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

(Moore Law) Gap

International
Technology
Roadmap for
Semiconductors:
2011
http://www.itrs.net/L
inks/2011ITRS/201
1Chapters/2011De
sign.pdf

37
Platform-Based Design
Basic idea: avoid designing a chip from scratch
Definition:
A family of architectures that satisfy a set of architectural constraints
imposed to allow the re-use of hardware and software components.
A platform is a partial design
A platform uses IPs:
Intellectual Property
Advantage of platforms:
Fast time-to-market.
Reuse system design---hardware, software.
Allows chip to be customized to add value.

38
Evolution of Design Methodologies

Source: Henry Chang et al Surviving the SoC


Revolution: A Guide to Platform-Based Design

39
IP Blocks in Use today
Processor cores: ARM, MIPS, PowerPC, SPARC
Interfaces: USB, PCI, UART, Rambus
Encryptions: DES, AES
Multimedia: JPEG coder, MPEG decoder, H.264 decoder
Networking: ATM switch, Ethernet
DSP: Oak, TI, SHARC
RTOS: VxWorks, QNX

40
Hardware-Software Codesign
Definition:
Integrated design of electronic systems implemented using hardware
and software components developed concurrently and cooperatively.
Family of products on a common hardware platform
Path of product through updating software.
Chip/circuits high cost reduced by providing functionality in
software.
Range of system costs and performances from (high cost +
high performance) to (low cost + low performance)

41
Embedded Design Life Cycle
Materials from Arnold S. Berger, Embedded Systems
Design: An Introduction to Processes, Tools, and
Techniques, CMP, 2001.

42
Embedded Systems Design
When approaching embedded systems design, several models can be
applied to describe the cycle of embedded system design.
The big-bang model: there is essentially no planning or processes in place
before and during the development of a system.
The code-and-fix model: product requirements are defined but no formal
processes are in place before the start of development.
The waterfall model: there is a process for developing a system in steps,
where results of one step flow into the next step.
The spiral model: there is a process for developing a system in steps, and
throughout the various steps, feedback is obtained and incorporated back into
the process.
The EDLC is a combination of waterfall and spiral.

43
Embedded Design Life Cycle

44
Embedded Design Life Cycle
Time flows from the left and proceeds through 7 phases
Product specification
Partitioning of the design into its software and hardware components
Iteration and refinement of the partitioning
Independent hardware and software design tasks
Integration of the hardware and software components
Product testing and release
On-going maintenance and upgrading

45
EDLC: Phase 1
Activity: Product specification
Designing the right embedded system
For many R&D engineers, designing the right product means
cramming everything possible into the product to make sure they dont
miss anything
But Apple has shown us Albert Einstein was right, Make things
as simple as possible, but not simpler.
Specifying which features to include or to remove is probably the most
important decision determining the success of the product

46
Specifications
A more precise description of the system:
should not imply a particular architecture;
provides input to the architecture design process.
May be executable or may be in mathematical form for
proofs.
May include functional and non-functional elements.
Functional requirements:
output as a function of input.
Non-functional requirements:
time required to compute output;
size, weight, etc.;
power consumption;
reliability, etc.

47
Documenting the Specifications
A precise description of the requirements
Unambiguous and understandable
Unified Modeling Language (UML) is a visual language that
nicely captures the specification
Blurs the distinction between h/w and s/w
UML models the behavior of embedded system
Automatic code generator could generate HDL or C++ code for the
actual design implementation

48
EDLC: Phase 2
Activity: Partitioning of the design into its software and
hardware components
Since an embedded design will involve both hardware and software
components, someone must decide which portion of the problem will
be solved in hardware and which in software.
This choice is called the "partitioning decision.
For example, a digital camera may have its JPEG compression
function implemented in hardware or software, either of which has
power, cost and performance implications

49
Architecture Design
What major components go satisfying the specification?
Hardware components:
CPUs, peripherals, etc.
Processor selection
Software components:
Major programs and their operations.
Must take into account functional and non-functional
specifications.

50
EDLC: Phase 3
Activity: Iteration and refinement of the partitioning
This phase represents the early design work before the hardware and
software teams build the wall between them.
This is a selection process phase.
The hardware designers might be using simulation tools, such as
architectural simulators, to model the performance of the processor
and memory systems.
The software designers are probably running code benchmarks on
self-contained, single-board computers that use the target micro
processor.

51
EDLC: Phase 4
Activity: Independent (detailed) hardware and software
design tasks
The hardware and software engineers work independently in this
phase
Remember that the final hardware is not ready, yet the software must
be still be developed, tested and debugged.

52
EDLC: Phase 5
Activity: Integration of the hardware and software
components
The process of integrating embedded software and hardware is an
exercise in debugging and discovery.
Put 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

53
EDLC: Phase 6
Activity: Product testing and release
Product testing takes on special significance when the performance of
the embedded system has life or death consequences attached.
Therefore, the testing and reliability requirements for an embedded
system are much more stringent than the vast majority of desktop
applications.

54
EDLC: Phase 7
Activity: On-going maintenance and upgrading
The majority of embedded system designers (around 60 percent)
maintains and upgrades existing products, rather than design new
products
Embedded projects are usually optimization exercises that strive to
create both hardware and software that complement each other.
Three characteristic elements of the embedded design cycle:
selection, partitioning, and system integration.

55
Summary
Embedded systems are everywhere
Key challenge: optimization of design metrics
Design metrics compete with one another
Three key technologies
Processor: general-purpose, application-specific, single-purpose
IC: Full-custom, semi-custom, PLD
Design methodology: Compilation/synthesis, libraries/IP,
test/verification, platform-based design
Embedded Design Life Cycle has 7 major phases

56
Case Study: GPS
Slides from Wolf, Computers as Components, Morgan
Kaufman, 2000.

57
GPS moving map requirements
Moving map obtains
position from GPS, paints
map from local database.
I-78

Scotch Road
lat: 40 13 lon: 32 19

58
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 dashboard.
Power consumption: Current draw comparable to CD player.

59
GPS moving map requirements form

nam e G PS m ov ing m ap
purpose consum e r-gra de
m ov ing m ap for
driv ing
inputs power button, two
control buttons
outputs back-lit LCD 400
600
functions 5-receiver G PS;
three resolutions;
displays curre nt
lat/lon
perform ance updates screen
within 0.25 sec of
m ovem ent
m anufacturing cost $100 cost-of-goods-
sold

2000 Morgan Kaufman


60
GPS specification
Should include:
What is received from GPS;
map data;
user interface;
operations required to satisfy user requests;
background operations needed to keep the system running.

61
GPS moving map block diagram

GPS search display


renderer
receiver engine

user
database interface

62
GPS moving map hardware
architecture

display frame CPU


buffer

GPS
receiver

memory
panel I/O

63
GPS moving map software architecture

position pixels
database
renderer
search

user
timer
interface

64

You might also like