Unit-I Es
Unit-I Es
Unit-I Es
Course Objectives:
1.Explain embedded systems overview and their design
challenges.
2.Describe the Design & features of different types of
processors.
3.Explain Types and composition of memory & Cache
Architecture.
4.Understand Concepts of MPU & MMU.
5.Explain the Concepts of Interrupts, Survey of Software
Architectures.
1
UNIT 1
Introduction: Embedded systems overview, Design
challenge – Optimizing design metrics: Common design
metrics, Time to market design metric, NRE &UNIT cost
design metrics & Performance design metric. IC Technology
& Design Technology.
UNIT 2
Custom Single Purpose Processors: Introduction, RT level
combinational & sequential components, Custom Single
Purpose Processor design, optimizing Custom Single
Purpose Processors.
General purpose processors: Introduction, Basic
Architecture, Operation, Programmer’s View &
Development Environment.
Application Specific Instruction Set Processors (ASIPs):
Microcontrollers & Digital Signal Processors. Selecting a
microprocessor. 2
UNIT 3
Memory: Introduction, Memory write ability & storage permanence,
Common memory types, composing memory.
Cache: Introduction, Memory Hierarchy and Cache, Cache Mapping
Techniques, Cache Replacement Policy, Cache write techniques.
UNIT 4
Memory Protection Unit: Protected Regions, Concepts of initializing
the MPU, Caches & Write buffer.
Memory Management Unit: Virtual Memory, Details of the ARM
MMU: Page Tables & Translation Look aside Buffer, Domains and
memory Access permission, Caches and write buffer.
UNIT 5
Interrupts: Interrupt basics, Shared data problem & Interrupt latency.
Survey of Software Architectures: Round Robin, Round Robin with
Interrupts, Function Queue- scheduling & RTOS architectures.
Introduction to RTOS: Tasks and states, scheduler, tasks and data,
shared data problem, reentrancy, Semaphores and shared data, semaphore
problems & semaphore variants.
3
TEXT BOOKS:
1. Frank Vahid and Embedded system Design,John Wiley,2002
Tony Givargis
2. Andrew N. Sloss, ARM System Developer’s Guide – Designing
Dominic Symes and Optimizing System Software, Elsevier,
and 2004.
Chris Wright
3. David E Simon An Embedded Software Primer, Pearson
Education, 1999
REFERENCE LINKS:
1. David Black-Schaffer https://www.youtube.com/watch?
v=qcBIvnQt0Bw&list=PLiwt1iVUib9s2Uo5BeYm
wkDFUh70fJPxX
2. S.Chandramouleeswa https://www.youtube.com/watch?v=-
ran, NPTEL wClEbZpJxk&list=PLbMVogVj5nJRDS4w20GO7l4
SepLhuAj9X 4
Outline
Embedded systems overview
◦ What are they?
Design challenge – optimizing design metrics
Technologies
◦ Processor technologies
◦ IC technologies
◦ Design technologies
5
Embedded systems overview
6
Embedded Systems Vs General Computing Systems:
General Purpose Computing System Embedded System
A system which is a combination of A system which is a combination of
generic hardware and General Purpose special purpose hardware and embedded
Operating System for executing a OS for executing a specific set of
variety of applications applications
Contain a General Purpose Operating May or may not contain an operating
System (GPOS) system for functioning
Applications are alterable The firmware of the embedded system is
(programmable) by user (It is possible pre-programmed and it is non-alterable
for the end user to re-install the by end-user
Operating System, and add or remove
user applications)
Performance is the key deciding factor Application specific requirements (like
on the selection of the system. performance, power requirements,
Always Faster is Better‟ memory usage etc) are the key deciding
factors
7
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
10
Classification based on Complexity & Performance
Small Scale: The embedded systems built around low
performance and low cost 8 or 16 bit microprocessors/
microcontrollers. It is suitable for simple applications and
where performance is not time critical. It may or may not
contain OS.
Medium Scale: Embedded Systems built around medium
performance, low cost 16 or 32 bit microprocessors /
microcontrollers or DSPs. These are slightly complex in
hardware and firmware.
Large Scale/Complex: Embedded Systems built around high
performance 32 or 64 bit RISC processors/controllers. It
requires complex hardware and software. These system may
contain multiple processors/controllers and co-units/hardware
accelerators for offloading the processing requirements from
the main processor. It contains RTOS for scheduling,
prioritization and management.
11
Classification Based on deterministic behavior
It is applicable for Real Time systems. The application/task
execution behavior for an embedded system can be either
deterministic or non-deterministic.
Soft Real time Systems: Missing a deadline may not be
critical and can be tolerated to a certain degree.
Hard Real time systems: Missing a program/task execution
time deadline can have catastrophic consequences (financial,
human loss of life, etc.)
12
Classification Based on Triggering:
Event Triggered : Activities within the system
(e.g., task run-times) are dynamic and depend upon
occurrence of different events.
Time Triggered: Activities within the system
follow a statically computed schedule (i.e., they are
allocated time slots during which they can take
place) and thus by nature are predictable.
13
Major Application Areas of Embedded Systems:
Consumer Electronics: Camcorders, Cameras etc.
Household Appliances: Television, DVD players, washing
machine, Fridge, Microwave Oven etc.
Home Automation and Security Systems: Air conditioners,
sprinklers, Intruder detection alarms, Closed Circuit Television
Cameras, Fire alarms etc..
Automotive Industry: Anti-lock breaking systems (ABS),
Engine Control, Ignition Systems, Automatic Navigation
Systems etc.
Telecom: Cellular Telephones, Telephone switches, Handset
Multimedia Applications etc.
Computer Peripherals: Printers, Scanners, Fax machines etc.
14
Computer Networking Systems: Network Routers,
Switches, Hubs, Firewalls etc.
Health Care: Different Kinds of Scanners, EEG, ECG
Machines etc.
Measurement & Instrumentation: Digital multi meters,
Digital CROs, Logic Analyzers PLC systems etc.
Banking & Retail: Automatic Teller Machines (ATM)
and Currency counters, Point of Sales (POS)
Card Readers: Barcode, Smart Card Readers, Hand
held Devices etc. 15
Purpose of Embedded Systems:
Each Embedded Systems is designed to serve the purpose
of any one or a combination of the following tasks.
Data Collection/Storage/Representation
Data Communication
Data (Signal) Processing
Monitoring
Control
16
Data Collection/Storage/Representation:
Performs acquisition of data from the external world.
The collected data can be either analog or digital.
Data collection is usually done for storage, analysis,
manipulation and transmission.
Data Communication:
Embedded Data communication systems are deployed
in applications ranging from complex satellite
communication systems to simple home networking
systems.
Embedded Data communication systems are dedicated
for data communication.
Network hubs, Routers, switches, Modems etc are
typical examples for dedicated data transmission
embedded systems. 17
Data (Signal) Processing:
Embedded systems with Signal processing
functionalities are employed in applications demanding
signal processing like Speech coding, synthesis, audio
video codec, transmission applications etc.,
Monitoring:
Embedded systems coming under this category are
specifically designed for monitoring purpose.
Measuring instruments like Digital CRO, Digital Multi-
meter, Logic Analyzer etc used in Control &
Instrumentation applications are also examples of
embedded systems for monitoring purpose.
18
Control:
Embedded systems with control functionalities are used
for imposing control over some variables according to the
changes in input variables.
Embedded system with control functionality contains
both sensors and actuators.
Application Specific User Interface:
Embedded systems which are designed for a specific
application.
Contains Application Specific User interface (rather
than general standard UI ) like key board, Display units
etc
19
Some common characteristics of embedded
systems
Single-functioned
lens
21
Design Challenge – optimizing design metrics
The embedded-system designer must of course construct
an implementation that fulfills desired functionality, but a
difficult challenge is to construct an implementation that
simultaneously optimizes numerous design metrics.
Common Design 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. Often
measured in bytes for software, and gates/transistors for
hardware.
22
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
23
Design metric competition
Power
Performance Size
NRE cost
24
The Time-to-Market Design Metric
Revenues ($)
Time (months)
Revenues ($)
Peak revenue from
delayed entry
On-time
Delayed
D W 2W
On-time Delayed Time
entry entry
Figure: Simplified revenue model for computing loss from delayed entry.
Simplified revenue model
◦ Product life = 2W, peak at W
◦ Time of market entry defines a triangle, representing market
penetration
◦ Triangle area equals revenue
Loss
Revenues ($)
On-time
Delayed
D W 2W
On-time Delayed Time
entry entry
Area = 1/2 * base * height
◦ On-time = 1/2 * 2W * W
◦ Delayed = 1/2 * (W-D+W)*(W-D)
Percentage revenue loss = (D(3W-D)/2W2)*100%
Try some examples
◦ Lifetime 2W=52 wks, delay D=4 wks
(4*(3*26 –4)/2*26^2) = 22%
◦ Lifetime 2W=52 wks, delay D=10 wks
(10*(3*26 –10)/2*26^2) = 50%
– Delays are costly! 27
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
28
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
to ta l c o st (x1000)
p e r p ro d uc t c o st
$120,000 $120
$80,000 $80
$40,000 $40
$0 $0
0 800 1600 2400 0 800 1600 2400
Num b e r o f units (vo lu m e ) Num b e r o f units (vo lu m e )
29
The Performance Design Metric
The performance of a system is a measure of how long the
system takes to execute our desired tasks.
It is the most widely used design metric in marketing an
embedded system.
Main measurs of performance are
total = 0
for i = 1 to N loop
total += M[i]
end loop
Desired functionality
total = 0 total = 0
for i =1 t …N for i =1 t …N
Loop Loop
Total + = M[i] Total + = M[i]
34
Single-Purpose Processors
Digitalcircuit designed to execute exactly
one program
Features Controller Datapath
◦ Fast Data
memory
◦ Low power
◦ Small size
◦ Unit cost is low for large quantities while
design time and NRE costs may be high.
35
Application-Specific Processors
Programmable processor optimized for a
particular class of applications having common
characteristics, such as embedded control, Controller Datapath
digital signal processing or telecommunications.
Control Registers
◦ Compromise between general-purpose and logic and
single-purpose processors State
register
Features Custom
ALU
◦ Program memory IR PC
power total = 0
for i =1 to …
36
IC Technology
The manner in which a digital (gate-level) implementation is mapped onto an
IC
◦ IC: Integrated circuit, or “chip”, is a semiconductor device consisting of a
set of connected transistors and other devices.
◦ IC technologies differ in their customization for a particular design
◦ IC’s consist of numerous layers (perhaps 10 or more)
Bottom layers form the transistors, middle layers form logic
components and top layers connect these components with wires.
IC technologies differ with respect to who builds each layer and when
gate
IC package IC oxide
source channel drain
Silicon
substrate
37
Three types of IC technologies
◦ Full-custom/VLSI
◦ Semi-custom ASIC (gate array and standard cell)
◦ PLD (Programmable Logic Device)
Full-custom/VLSI
Optimize all layers for an Particular embedded system’s
digital implementation
◦ Placing transistors (to minimize interconnection lengths)
◦ Sizing transistors (signal transmissions).
◦ Routing wires
Benefits
38
Semi-custom ASIC
Lower layers are fully or partially built
39
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
PLDs can be divided in to two types
1983
1985
1987
1989
1991
1993
1995
1997
1999
2001
2003
2005
2007
2009
41
Graphical illustration of Moore’s law
10,000 150,000,000
transistors transistors
42
Design Technology
◦Design Technology involves the manner in which we
convert our concept of desired system functionality into an
implementation.
◦The designer must be able to produce larger number of
transistors every year to keep pace with IC technology.
Compilation/ Libraries/ Test/
Synthesis IP Verification
To final implementation
◦ Compilation/synthesis
◦ Libraries/IP
◦ Test/verification
44
Compilation/Synthesis
The designer specify desired functionality in an abstract
manner and automatically generates lower-level
implementation details.
A logical synthesis tool converts Boolean expressions into a
connection of logic gates, called a netlist.
A register-transfer synthesis tool converts finite-state
machines and register transfers into a datapath of RT
components and a controller of Boolean Equations.
A behavioral synthesis tool converts a sequential program
into finite-state machines and register transfers.
A software compiler converts a sequential program to
assembly code, which is essentially register-transfer code.
Finally, a system synthesis tool converts an abstract system
specification into a set of sequential programs on general- and
single-purpose processors. 45
Libraries/IP
Libraries involve reuse of preexisting implementations.
A logic-level library may consist of layouts for gates and
cells.
An RT-level library may consist of layouts for RT
components like resistors, multiplexors , decoders and
functional units.
A behavioral-level library may consist of commonly used
components such as compression components, bus interfaces,
display controllers, and even general-purpose processors.
A system-level library might consist of complete systems
solving particular problems, such as an interconnection of
processors with accompanying operating systems and
programs to implement an interface to the Internet over an
Ethernet network.
46
Test/verification
Test/verification involves ensuring that functionality is
correct.
Simulation is the most common method of testing for
correct functionality.
At the RT-level, HDL simulators execute RT-level
descriptions and provide output waveforms given input
waveforms.
At the system level, a model simulator simulates the initial
system specifications using an abstract computation model,
independent of any processor technology.
47
More Productivity Improves
Standard focus on developing well-defined methods for
specifications, synthesis and libraries.
Common standards include language standards, synthesis
standards, and library standards.
EX: state-machine languages permit direct capture of
functionality as a set of states and transistors, which can then
be translated to other languages like C.
48
End of UNIT-1
49
Exercise Problem.
1.Using the revenue model of Figure, derive the percentage revenue
loss equation for any rise angle, rather than just for 45 degrees
(Hint: you should get the same equation).
2.Compute the percentage revenue loss if D = 5 and W = 10. If the
company whose product entered the market on time earned a total
revenue of $25 million, how much revenue did the company that
entered the market 5 months late loss?
3.The design of a particular disk drive has an NRE cost of $100,000
and a unit cost of $20. How much will we have to add to the cost of
each product to cover our NRE cost, assuming we sell: (a) 100
units, and (b) 10,000 units?
4.For a particular product, you determine the NRE cost and unit cost
to be the following for the three listed IC technologies: FPGA:
($10,000, $50); ASIC: ($50,000, $10); VLSI: ($200,000, $5).
Determine precise volumes for which each technology yields the
lowest total cost.
50
1. tan A = opposite / adjacent
opposite = tan A * adjacent
Revenue loss = ( (on time - delayed) / on time ) * 100%
Area of on time = 1/2 * base * height
= 1/2 * 2W * tan A * W
= tan A * W^2
Area of delay = 1/2 * base * height
= 1/2 * ( W-D+W ) * ( tan A * ( W-D ) )
= 1/2 * ( 2W-D ) * ( tan A * ( W-D ) )
Revenue
Loss = [ ( (tan A * W^2 ) - (1/2 * (2W-D) * tan A * (W-D)) ) / (tan A * W^2 )] * 100%
=[(W^2 - (1/2 * (2W-D) * (W-D)) ) / W^2 ] * 100%
=[(W^2 - 1/2*(2W^2 - 2WD - WD + D^2 ))/W^2 ] * 100%
= [ (W^2 - 1/2*(2W^2 - 3WD +D^2 ))/W^2 ] * 100%
= [ (2W^2 - 2W^2 + 3WD - D^2 ) / 2W^2 ] * 100%
= [ (3WD - D^2 ) / 2W^2 ] * 100%
51
2. percentage revenue loss = ( D * ( 3W - D ) / 2W^2 ) * 100%
= ( 5 * ( 3 * 10 - 5 ) / 2 * 10^2 ) *
100%
= ( 5 * 25 / 200 ) * 100%
= 62.5%