01 big picture
DESCRIPTION
embedded systemsTRANSCRIPT
Embedded Systems
Sandip KunduSandip Kundu
1ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
ECE 354 Lecture 1 The Big PictureECE 354 Lecture 1 The Big Picture
What are embedded systems? Challenges in embedded
computing system design. Design methodologies Design methodologies.
Sophisticated functionality. Real-time operation Real-time operation. Low manufacturing cost. Low power. Designed to tight deadlines by Designed to tight deadlines by
small teams.
2ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
DefinitionDefinition
Embedded system: any device that includes a programmable y y p gcomputer but is not itself a general‐purpose computer.
Take advantage of application characteristics to optimize the design:• don’t need all the general‐purpose bells and whistles.
3ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Embedding a computer: a very simplified viewEmbedding a computer: a very simplified view…
output analog
inp t analogCPU input analog
memembeddedembeddedcomputer
4ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
ExamplesExamples
Personal digital assistant (PDA).g ( ) Printer. Cell phone.Cell phone. Automobile: engine, brakes, dash, etc. Television.Television. Household appliances.
5ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
More examplesMore examples
Cell phones, Ipod and MP 3 players, Webcams, Navigation p , p p y , , gSystems
Routers, Blade servers, Wireless PC cards Automobiles, Car Alarms, Keyless Entry Systems Building Security, card swiping systemsg y p g y Embedded Medical Devices ‐ Pacemakers
6ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Characteristics of embedded systemsCharacteristics of embedded systems
Sophisticated functionality.p y Real‐time operation. Low manufacturing cost.Low manufacturing cost. Low power. Reliable and secureReliable and secure Designed to tight deadlines by small teams.
7ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Functional complexityFunctional complexity
Often have to run sophisticated algorithms or multiple p g palgorithms.• Cell phone, laser printer.
Often provide sophisticated user interfaces.
8ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Real time operationReal-time operation
Must finish operations by deadlines.p y• 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.
9ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Non functional requirementsNon-functional requirements
Many embedded systems are mass‐market items that must y yhave low manufacturing costs.• Limited memory, microprocessor power, etc.
Power consumption is critical in battery‐powered devices.• Excessive power consumption increases system cost even in wall‐
d d ipowered devices.
10ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Design teamsDesign teams
Often designed by a small team of designers.g y g Often must meet tight deadlines.
• 6 month market window is common.• E.g., can’t miss back‐to‐school window for calculator.
11ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Microprocessors in Embedded Systems
12ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Microprocessor alternatives for embedded systemsMicroprocessor alternatives for embedded systems
Ordinary microprocessor: CPU plus on‐chip cache units.y p p p Microcontroller: includes I/O devices, on‐board memory. Digital signal processor (DSP): microprocessor optimized forDigital signal processor (DSP): microprocessor optimized for
digital signal processing. Hard core vs. soft core. Typical embedded word sizes: 8‐bit, 16‐bit, 32‐bit.
13ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Embedded microprocessorsEmbedded microprocessors
ARM, MIPS, Power PC, Freescale, 8051, X86, , , , , Various purposes
• Networks – MIPS• Mobile phone – ARM dominated• Industrial – Freescale Coldfire• Security – 8051 based, Infineon• High performance – X86, Intel Epic, other VLIW and superscalars
14ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Von Neumann CPU ArchitectureVon Neumann CPU Architecture
Memory holds data and instructions.y Central processing unit (CPU) fetches instructions from
memory.• Separation between CPU and memory distinguishes programmable
computer.
CPU i CPU registers: • program counter (PC)• general purpose registers• general‐purpose registers
15ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
CPU + memoryCPU + memory
address
200memory
CPU
PCdata 200
IRADD r5,r1,r3200 ADD r5,r1,r3
16ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Harvard architectureHarvard architecture
address
data memory data
CPUPC
addressPC
program memory instructions IR
17ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
RISC vs CISCRISC vs. CISC Complex instruction set computer (CISC):
• many addressing modes• most operations can access memory• variable length instructionsvariable length instructions
Reduced instruction set computer (RISC):• only load/store can access memory• fixed‐length instructions
Instruction set architectures – characteristics:Fi d i bl l th• Fixed vs. variable length.
• Addressing modes.• Number of operands.• Types of operands.
18ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Multiple implementations of an ISAMultiple implementations of an ISA
Instruction set architectures may have several yimplementations:• varying clock speeds;• different bus widths;• different cache sizes;• etc• etc.
19ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
PipeliningPipelining
Execute several instructions simultaneously but at different ystages.
Pipeline hazards Simple three‐stage pipe:
y
fetc
h
deco
de
exec
ute
mem
ory
d em
20ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Soft Core ProcessorsSoft Core Processors
Are soft, i.e. specified through field programming just like p g p g g jprogrammable logic • Shipped as hardware description files, which can be mapped onto
FPGA e g: Nios 2FPGA. e.g: Nios 2.• Are bundled with software development tools (compiler, simulator,
etc.)Off fl ibili i b d Offer flexibility as microprocessor parameters can be tuned to the application with tight on‐chip interconnection with additional circuitry.y
Designs can be marketed quickly. You can test and validate many designs quickly without making any specific board; no ld i d i i !soldering and no wiring!
21ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
What is Nios 2?What is Nios 2?
A 32‐bit soft core processor from Alterap Comes in three flavors: Fast, Standard, Light The three cores trade FPGA area and power consumption forThe three cores trade FPGA area and power consumption for
speed of execution. Is a RISC, Harvard Architecture: Simple instructions, separate p p
data and instruction memories. Has 32 levels of interrupts. Uses the Avalon Bus interface Programs compiled using GNU C/C++ toolchain.
22ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Nios 2 Architecture:Nios 2 Architecture:
23ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Three forms of Nios 2:Three forms of Nios 2:
Nios II/f—The Nios II/f “fast” core is designed for fast performance. As a result, this core presents the most configuration options allowing you to fine‐tune the processor for performance.
Nios II/s—The Nios II/s “standard” core is designed for small size while Nios II/s The Nios II/s standard core is designed for small size while maintaining performance.
Nios II/e—The Nios II/e “economy” core is designed to achieve the smallest possible core size. As a result, this core has a limited feature set, and many settings are not available when the Nios II/e core is selected.
All three are available to you !y
24ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Selection in SOPC (System On a Programmable Chip):Selection in SOPC (System On a Programmable Chip):
25ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Why use microprocessors?Why use microprocessors?
Alternatives: random logic on a field‐programmable gate g p g garrays (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.
26ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
The performance paradoxThe performance paradox
Microprocessors use much more logic to implement a p g pfunction than does custom logic.
But microprocessors are often at least as fast:• heavily pipelined;• sophisticated design ‐ large design teams;• aggressive VLSI technology.
27ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
PowerPower
Custom logic is a clear winner for low power devices.g p Modern microprocessors offer features to help control
power consumption. Software design techniques can help reduce power
consumption.
28ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Design Aspects In Embedded Systems
29ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Challenges in embedded system designChallenges 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?
30ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Design methodologiesDesign methodologies
A procedure for designing a system.p g g y 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.
l l i ( d Altera CAD tools: Quartus 2 , SOPC, Nios 2 IDE (Integrated Development Environment).
31ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Design goalsDesign goals
Performance.• Overall speed, deadlines.
Functionality and user interface. Manufacturing cost. Power consumption.p Other requirements (physical size, etc.)
32ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Levels of abstractionLevels of abstraction
irequirements
specification
architecture
tcomponentdesign
systemintegration
33ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Top down vs bottom upTop-down vs. bottom-up
Top‐down design:p g• start from most abstract description;• work to most detailed.
Bottom‐up design:• work from small components to big system.
Real design uses both techniques.
34ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Typical CAD design flow:Typical CAD design flow:
35ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Designing hardware and software componentsDesigning hardware and software components
Must spend time architecting the system before you start p g y ycoding.
Some components are ready‐made, some can be modified from existing designs, others must be designed from scratch.
Example: SOPC for Hardware design and Nios 2 IDE for Software Design.
36ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
JTAG TESTINGJTAG - TESTING
JTAG ‐ Joint Test Action Group: IEEE 1149.1 standard pentitled: Standard Test Access Port and Boundary‐Scan Architecture for test access ports used for testing printed circuit boards (and chips) using boundary scan.
Currently used also for programming embedded devices.• Most FPGAs and PLDs are programmed via a JTAG port.
JTAG ports commonly available in ICsB d h i bi t l i bi t t d• Boundary scan, scan chains, mbist, logic bist connected
• Chips chained together with Jtag signals and connected to main JTAG interface on PCB
37ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
SOPCSOPC
System On a Programmable Chip – a hardware development tool. Used for integrating various hardware components together like:
• Microprocessors, such as the Nios II processor• Timers• Serial communication interfaces: UART, SPI• General purpose I/O• Digital signal processing (DSP) functions
C i i i h l• Communications peripherals• Interfaces to off‐chip devices
• Memory controllers• Buses and bridges• Buses and bridges• Application‐specific standard products (ASSP)• Application‐specific integrated circuits (ASIC)• ProcessorsProcessors
Generates files in Verilog or VHDL which can be added to the Quartus 2 project.
38ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
Example SOPC system:Example SOPC system:
39ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
SOPC system having NIOS:SOPC system having NIOS:
40ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
41ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
SummarySummary
Embedded computers are all around us.p• Many systems have complex embedded hardware and software.
Embedded systems pose many design challenges: design time, deadlines, power, etc.
Design methodologies help us manage the design process. CAD tools like SOPC can reduce design time.
42ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005
What’s Next in Lecture 2?What s Next in Lecture 2?
We will peek inside CPU, addressing, assembly languages etc.p , g, y g g You will learn about I/Os and Caches. You will learn about some cool features of SOPC and Nios 2You will learn about some cool features of SOPC and Nios 2
IDE !
43ECE 354 © Moritz 2011, some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005