01 Big Picture

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

EmbeddedSystems

Sandip Kundu

ECE 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 Picture


Whatareembeddedsystems?
Challengesinembedded
computingsystemdesign.
Designmethodologies.
Design methodologies

ECE 354 Moritz 2011,

Sophisticated functionality.
Real-time operation.
operation
Low manufacturing cost.
Low power.
Designed to tight deadlines by
small teams.

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

Definition
Embeddedsystem:anydevicethatincludesaprogrammable
y
y
p g
computerbutisnotitselfageneralpurposecomputer.
Takeadvantageofapplicationcharacteristicstooptimizethe
design:
dontneedallthegeneralpurposebellsandwhistles.

ECE 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 view


view

CPU

embedded
computer
ECE 354 Moritz 2011,

output

analog

inp t
input

analog

mem

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

Examples

Personaldigitalassistant(PDA).
g
(
)
Printer.
Cell phone.
Cellphone.
Automobile:engine,brakes,dash,etc.
Television.
Householdappliances.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

More examples
Cellphones,IpodandMP3players,Webcams,Navigation
p
, p
p y ,
,
g
Systems
Routers,Bladeservers,WirelessPCcards
Automobiles,CarAlarms,KeylessEntrySystems
BuildingSecurity,cardswipingsystems
g
y
p g y
EmbeddedMedicalDevices Pacemakers

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

Characteristics of embedded systems

Sophisticatedfunctionality.
p
y
Realtimeoperation.
Low manufacturing cost.
Lowmanufacturingcost.
Lowpower.
Reliable and secure
Reliableandsecure
Designedtotightdeadlinesbysmallteams.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

Functional complexity
Oftenhavetorunsophisticatedalgorithmsormultiple
p
g
p
algorithms.
Cellphone,laserprinter.

Oftenprovidesophisticateduserinterfaces.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

Real time operation


Real-time
Mustfinishoperationsbydeadlines.
p
y
Hardrealtime: missingdeadlinecausesfailure.
Softrealtime: missingdeadlineresultsindegradedperformance.

Manysystemsaremultirate:musthandleoperationsat
widelyvaryingrates.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

Non functional requirements


Non-functional
Manyembeddedsystemsaremassmarketitemsthatmust
y
y
havelowmanufacturingcosts.
Limitedmemory,microprocessorpower,etc.

Powerconsumptioniscriticalinbatterypowereddevices.
Excessivepowerconsumptionincreasessystemcosteveninwall
powereddevices.
dd i

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

10

Design teams
Oftendesignedbyasmallteamofdesigners.
g
y
g
Oftenmustmeettightdeadlines.
6monthmarketwindowiscommon.
E.g.,cantmissbacktoschoolwindowforcalculator.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

11

Microprocessorsin
EmbeddedSystems

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

12

Microprocessor alternatives for embedded systems


Ordinarymicroprocessor:CPUplusonchipcacheunits.
y
p
p
p
Microcontroller: includesI/Odevices,onboardmemory.
Digitalsignalprocessor(DSP):
Digital signal processor (DSP): microprocessoroptimizedfor
microprocessor optimized for
digitalsignalprocessing.
Hardcorevs.softcore.
Typicalembeddedwordsizes:8bit,16bit,32bit.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

13

Embedded microprocessors
ARM,MIPS,PowerPC,Freescale,8051,X86
,
,
,
,
,
Variouspurposes

Networks MIPS
Mobilephone ARMdominated
Industrial FreescaleColdfire
Security 8051based,Infineon
Highperformance X86,IntelEpic,otherVLIWandsuperscalars

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

14

Von Neumann CPU Architecture


Memoryholdsdataandinstructions.
y
Centralprocessingunit(CPU)fetchesinstructionsfrom
memory.
SeparationbetweenCPUandmemorydistinguishesprogrammable
computer.

CPUregisters:
CPU
i
programcounter(PC)
generalpurposeregisters
general purpose registers

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

15

CPU + memory

address
memory

data

200
PC
CPU

200

ADD r5,r1,r3

ECE 354 Moritz 2011,

ADD IR
r5,r1,r3

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

16

Harvard architecture

address
data memory

data
address

program memory

ECE 354 Moritz 2011,

instructions

CPU
PC
IR

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

17

RISC vs.
vs CISC
Complexinstructionsetcomputer(CISC):
manyaddressingmodes
mostoperationscanaccessmemory
variablelengthinstructions
variable length instructions

Reducedinstructionsetcomputer(RISC):
onlyload/storecanaccessmemory
fixedlengthinstructions

Instructionsetarchitectures characteristics:

Fixedvs.variablelength.
Fi
d
i bl l th
Addressingmodes.
Numberofoperands.
Typesofoperands.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

18

Multiple implementations of an ISA


Instructionsetarchitecturesmayhaveseveral
y
implementations:

varyingclockspeeds;
differentbuswidths;
differentcachesizes;
etc
etc.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

19

Pipelining

ECE 354 Moritz 2011,

eexecute

ddecode

fetch

memoryy
m

Executeseveralinstructionssimultaneouslybutatdifferent
y
stages.
Pipelinehazards
Simplethreestagepipe:

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

20

Soft Core Processors


Aresoft,i.e.specifiedthroughfieldprogrammingjustlike
p
g
p g
gj
programmablelogic
Shippedashardwaredescriptionfiles,whichcanbemappedonto
FPGA e g: Nios 2
FPGA.e.g:Nios2.
Arebundledwithsoftwaredevelopmenttools(compiler,simulator,
etc.)

Off
Offerflexibilityasmicroprocessorparameterscanbetuned
fl ibili
i
b
d
totheapplicationwithtightonchipinterconnectionwith
additionalcircuitry.
y
Designscanbemarketedquickly.Youcantestandvalidate
manydesignsquicklywithoutmakinganyspecificboard;no
solderingandnowiring!
ld i
d
ii !

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

21

What is Nios 2?
A32bitsoftcoreprocessorfromAltera
p
Comesinthreeflavors:Fast,Standard,Light
ThethreecorestradeFPGAareaandpowerconsumptionfor
The three cores trade FPGA area and power consumption for
speedofexecution.
IsaRISC,HarvardArchitecture:Simpleinstructions,separate
p
p
dataandinstructionmemories.
Has32levelsofinterrupts.
UsestheAvalonBusinterface
ProgramscompiledusingGNUC/C++toolchain.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

22

Nios 2 Architecture:

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

23

Three forms of Nios 2:


NiosII/fTheNiosII/ffastcoreisdesignedforfastperformance.Asa
result,thiscorepresentsthemostconfigurationoptionsallowingyouto
finetunetheprocessorforperformance.
NiosII/s
Nios II/sThe
TheNiosII/s
Nios II/s standard
standard coreisdesignedforsmallsizewhile
core is designed for small size while
maintainingperformance.
NiosII/eTheNiosII/eeconomycoreisdesignedtoachievethe
smallestpossiblecoresize.Asaresult,thiscorehasalimitedfeatureset,
andmanysettingsarenotavailablewhentheNiosII/ecoreisselected.
Allthreeareavailabletoyou!
y

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

24

Selection in SOPC (System On a Programmable Chip):

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

25

Why use microprocessors?


Alternatives:randomlogiconafieldprogrammablegate
g
p g
g
arrays(FPGAs),customlogic,etc.
Microprocessorsareoftenveryefficient:canusesamelogic
toperformmanydifferentfunctions.
Microprocessorssimplifythedesignoffamiliesofproducts.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

26

The performance paradox


Microprocessorsusemuchmorelogictoimplementa
p
g
p
functionthandoescustomlogic.
Butmicroprocessorsareoftenatleastasfast:
heavilypipelined;
sophisticateddesign largedesignteams;
aggressiveVLSItechnology.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

27

Power
Customlogicisaclearwinnerforlowpowerdevices.
g
p
Modernmicroprocessorsofferfeaturestohelpcontrol
powerconsumption.
Softwaredesigntechniquescanhelpreducepower
consumption.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

28

DesignAspects
InEmbeddedSystems

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

29

Challenges in embedded system design


Howmuchhardwaredoweneed?
HowbigistheCPU?Memory?

Howdowemeetourdeadlines?
Fasterhardwareorcleverersoftware?

Howdoweminimizepower?
Turnoffunnecessarylogic?Reducememoryaccesses?

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

30

Design methodologies
Aprocedurefordesigningasystem.
p
g g y
Understandingyourmethodologyhelpsyouensureyou
didntskipanything.
Compilers,softwareengineeringtools,computeraided
design(CAD)tools,etc.,canbeusedto:
helpautomatemethodologysteps;
keeptrackofthemethodologyitself.

AlteraCADtools:Quartus2,SOPC,Nios2IDE(Integrated
l
l
i
(
d
DevelopmentEnvironment).

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

31

Design goals
Performance.
Overallspeed,deadlines.

Functionalityanduserinterface.
Manufacturingcost.
Powerconsumption.
p
Otherrequirements(physicalsize,etc.)

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

32

Levels of abstraction
requirements
i
specification
architecture
componentt
design
system
integration
ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

33

Top down vs.


Top-down
vs bottom
bottom-up
up
Topdowndesign:
p
g
startfrommostabstractdescription;
worktomostdetailed.

Bottomupdesign:
workfromsmallcomponentstobigsystem.

Realdesignusesbothtechniques.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

34

Typical CAD design flow:

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

35

Designing hardware and software components


Mustspendtimearchitectingthesystembeforeyoustart
p
g
y
y
coding.
Somecomponentsarereadymade,somecanbemodified
fromexistingdesigns,othersmustbedesignedfromscratch.
Example:SOPCforHardwaredesignandNios2IDEfor
SoftwareDesign.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

36

JTAG - TESTING
JTAG JointTestActionGroup:IEEE1149.1standard
p
entitled:StandardTestAccessPortandBoundaryScan
Architecture fortestaccessportsusedfortestingprinted
circuitboards(andchips)usingboundaryscan.
Currentlyusedalsoforprogrammingembeddeddevices.
MostFPGAsandPLDsareprogrammedviaaJTAGport.

JTAGportscommonlyavailableinICs
B
Boundaryscan,scanchains,mbist,logicbistconnected
d
h i
bi t l i bi t
t d
ChipschainedtogetherwithJtagsignalsandconnectedtomainJTAG
interfaceonPCB

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

37

SOPC
SystemOnaProgrammableChip ahardwaredevelopmenttool.

Usedforintegratingvarioushardwarecomponentstogetherlike:

Microprocessors,suchastheNiosIIprocessor
Timers
Serialcommunicationinterfaces:UART,SPI
GeneralpurposeI/O
Digitalsignalprocessing(DSP)functions
C
Communicationsperipherals
i i
i h l
Interfacestooffchipdevices
Memorycontrollers
Busesandbridges
Buses and bridges
Applicationspecificstandardproducts(ASSP)
Applicationspecificintegratedcircuits(ASIC)
Processors

GeneratesfilesinVerilogorVHDLwhichcanbeaddedtotheQuartus2project.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

38

Example SOPC system:

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

39

SOPC system having NIOS:

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

40

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

41

Summary
Embeddedcomputersareallaroundus.
p
Manysystemshavecomplexembeddedhardwareandsoftware.

Embeddedsystemsposemanydesignchallenges:design
time,deadlines,power,etc.
Designmethodologieshelpusmanagethedesignprocess.
CADtoolslikeSOPCcanreducedesigntime.

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

42

Whatss Next in Lecture 2?


What
WewillpeekinsideCPU,addressing,assemblylanguagesetc.
p
,
g,
y g g
YouwilllearnaboutI/OsandCaches.
YouwilllearnaboutsomecoolfeaturesofSOPCandNios2
You will learn about some cool features of SOPC and Nios 2
IDE!

ECE 354 Moritz 2011,

some slides modified from Moritz/Koren/Burleson/Kundu, UMass ; Wolf, Computers as Components, Morgan Kaufman, 2005

43

You might also like