Embedded - Uppsala University · Information Technology Department of Information Technology |...

Post on 26-Mar-2020

2 views 0 download

Transcript of Embedded - Uppsala University · Information Technology Department of Information Technology |...

EmbeddedSystems

Jakob Engblom, PhDBusiness Development Manager,

Virtutech AB

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Computer Perspective

“A computer that doesn’t look like a computer”Interacts with worldPrimitive or no user interfacePart of other products

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Electronics Perspective

A product that contains a programmable processorSoftware programming is part of the design of the product

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

"Desktop"2%

"Embedded"98%

Dominant Species

Embedded = most processors!300 million PC and server9000 million embedded

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Real-Time Systems

Embedded and Real-TimeSynonymous?

Most embedded systems are real-timeMost real-time systems are embedded

embeddedembedded

realreal--timetime

embedded embedded realreal--timetime

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Embedded Systems

Single purpose productsNot general purpose like desktop PCsDo one thing very efficiently

Computer architectureTailor for a particular application nicheSystem applications known

Can select ”optimal” device

Specialization & workload knowledge!

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Embedded Systems

Software very important:Gives character to productUsed to differentiate inside a “platform”Can be changed lateMany vendors use same HW Processor cheaper than special HW

Replace relays with small processor!

Dominates HW development cost

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Processors

4-bit:Very simple & slow1970s pocket calculators

8-bit:Simple, slow, low-powerImmensely popular (4 G/year)Early 1980s home computers

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Processors

16-bitMore power than 8-bitMid-1980s home computersVery popular: 1.5G/yearThreatened from the 32-bit processors

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Processors

32 & 64-bitOld desktop & server chipsNew desktop & server chipsEmbedded-specific designs30 to 3000 MHzAt least 2G units/year

Many more than PC & server market

ARM will sell 1.5G units in 2005!Best-selling 32-bit family ever

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Processors

DSP: Digital Signal ProcessorSpecialized for signal processing

Poor at general computing/control codePoor interrupt handling

High performance on DSP tasksLow power, Low price

• compared to regular processors of same capability

Up to 1GHz clocks

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Where is the Money?Processors:

50% of all semiconductor revenueExplains why everyonewants to do processors

32-bit dominant30% of total semiconductors

PC processors: 50% of CPU revenue15% of total semiconductorsAMD and Intel share it

32-bit16-bit

8-bit

4-bit

DSP

32-bit

16-bit8-bit4-bitDSP

0%10%20%30%40%50%60%70%80%90%

100%

Units Money

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Integration

A single chip:CPU CoreIntegrated memoryIntegrated peripheralsIntegrated services

Goal:No external HWFit application “perfectly”“System on a chip” (SoC)

CPUCore

RAM(small)

ROM(big)

UA

RT

A/D

Tim

er

LCD

D

Outside World

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Devices: I/O

Interface with the worldDigital inputs & outputs

0/1 signals, like alarms & interruptsDrive high/low outputs

Analog inputs & outputsAnalog/Digital conversionDigital/Analog conversionMake signals digital, process, convert back to analog signals

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Devices: CommunicationCommunications

NetworksHigh-end: Ethernet, ATM, SonetControl: CAN, Profibus, 1553, SpaceWire

• Built for predictability & efficiency & reliability

Radio networksWLAN, Zigbee, Bluetooth, DECT, GSM, ...

Serial portsUSB, FireWireStorage

PCMCIA, IDE, SD-Card, etc.

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Devices: Timers

TimersTrigger interruptsKeep track of real-world

Fuel injection & spark timing

Pulse-Width Modulation

WatchdogsTime out if not tickledWatch that a system is alive

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Devices: OthersGraphics

LCD driversGraphics accelerationCamera driversVideo & image codecs in hardware

BusesOn-chip between devices:

AMBA, OcEAN, CoreConnect

Off-chip: PCI, HyperTransport, RapidIO, i2c, DDR

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Trends

Software dominates developmentHardware used to dominateSoftware is now up to 85% of effortEven when product is “full custom”Especially in telecomm & datacomm

Hardware is “under control”Increasing use of standard componentsFunctionality moves to software

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Trends

Talk by Lars Philipsson, LTH, 2004What is the future of electrical engineering in Sweden?

Answer:Software work

Software replacing logic design

Some analog design workCircuit-board design, high-speed circuits

Measuring technology

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Trends

Non-stop miniaturization and integration of computers

From one processor in a fridgeTo thousands of processors on a chipSteady trend over time

One chip = one systemProcessors, memories, electronics

Can be 100s of processors

“SoC”: System-on-a-Chip

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Trends

32-bit processors squeezing 16-bitARM Cortex-M3, TriCoreCost more competitive over timeEasier to program, faster execution, larger programs & data sets

Multicore & multithreadingIncreased performance, lower powerHigh-end firstHuge software problem!

Examples

Some embedded systems from

real life

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Smart Beer Glass

8-bit, 8-pin PIC processor

8-bit, 8-pin PIC processor

Capacitive sensor for fluid level

Capacitive sensor for fluid level

Inductive coil for RF ID activation & powerInductive coil for RF

ID activation & power

CPU and reading coil in the table. Reports the level of fluid in the glass, alerts servers whenclose to empty

Contactlesstransmission of

power and readings

Contactlesstransmission of

power and readings

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Smart Beer Glass

Typical embedded solutionIntegrates several technologies:

Radio transmissionsSensor technologyMagnetic inductance for powerComputer used for calibration

Impossible without the computerMeaningless without the electronics

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

PedometerObvious computer work:

Count stepsKeep timeAveragesetc.

Real computer task:Sensor feels motion of device, not of user feetIdentify when a step is actually taken

8-bit processor, runs forever on a single battery

8-bit processor, runs forever on a single battery

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Smart Welding MachineElectronics control voltage & speed of wire feedAdjusts to operator

kHz sample rate1000s of decisions/second

Perfect weld even for quite clumsy operatorsEasier-to-use product, but no obvious computer

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Sewing MachineUser interface

Embroidery patternsTouch-screen control

”Smart”Sets pressure of footdepending on taskRaise foot when stopped

New functions added by upgrading the software

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Mobile PhonesMultiprocessor

8/16/32-bit for UIDSP for radio32-bit ARM in IR port32-bit ARM in Bluetooth10-200 MHz main CPULocal memories

8-100 MB of memory+100s MB for media

Custom chipsPower consumption & battery life dependson software

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Phones: TI OMAP 5910Texas InstrumentsIntegrated solution for mobile phones Used by Nokia, Sony-Ericsson, etc.Dual-core chip

ARM925T 150 MhzTI C55 DSP 150 Mhz

Power 230 mWCompetition:

MotorolaInfineon

ARM shared devices

ARM private devices

System devices

DSP shared devices

DSP private devices

C55xDSP Core

24k I$

64k data SRAM

96k instrSRAM

ARM925CPU Core

16k I$

8k D$

MMU

192k Shared SRAM

MemCtrl

75 Mhz

LCD Ctrl

USB 1.1LCD controllerMMC/SDcard intfCamera interface Keyboard interfaceClockI2C8 Serial ports14 GPIO pinsExternal memory

USB 1.1USB 1.1LCD controllerLCD controllerMMC/MMC/SDcardSDcard intfintfCamera interface Camera interface Keyboard interfaceKeyboard interfaceClockClockI2CI2C8 Serial ports8 Serial ports14 GPIO pins14 GPIO pinsExternal memoryExternal memory

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Clock Speeds and Power

Clock and voltage relatedHigher operating frequency requires higher voltage

Use lower clock speedsReduce speed until app just worksDesign CPU-efficient software

Rule of thumb:1/2 speed = 1/4 power

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Low Clock = Low Power

0

200

400

600

800

1000

1200

1400

1600

180040

0

600

800

1000

1200

Voltage (mV)Power (mW)

Samsung HallaARM 1020E core6-stage pipeline0.13 um process Clock: 400 Mhz to 1.2 Ghz

(source: Microprocessor Report, Oct 16, 2002)

3x clock freq, 9x power!

3x clock freq, 9x power!

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Multicore & Power

Multiple cores can save powerStatic design

2 CPUs @ 100 Mhz = 1 CPU @ 200 Mhz, but requires half the power

Dynamic designVarying workload (game vs sleep)Turn on & off coresVary speed of cores

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Dynamic Multicoreen

ergy

con

sum

ptio

n

performance required

More cores are started, at minimum

clock frequency

More cores are started, at minimum

clock frequency

All cores active, clock frequency

increases

All cores active, clock frequency

increases

Energy saved by shutting down

cores

Energy saved by shutting down

cores

Energy saved by varying clock frequency &

voltage

Energy saved by varying clock frequency &

voltage

Source: Microprocessor Report, May 2004

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Compact Code

ARM Thumb: fixed 16-bit sizeSaves 28% compared to 32-bit ARMRuns 20% slower than 32-bit ARM

ARM Thumb 2: mixed 16/32Saves 26% compared to 32-bit ARMRuns 2% slower than 32-bit ARM(Note that some new instructions are introduced)

Conclusion: mixed length good!Source: Microprocessor Report, June 2003

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

ARM1026EJ-S Pipeline

Fetch Issue Decode

Shift/ALU Sat

Write

MAC1 MAC2

LS1 LS2 LS write

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Mobile Phone DSPsAssume very regular workloads

Zero-overhead loop instructions

Register setsAccumulators (often 40 bits)Data registers (often 16 bits)Address registers (16 to 32 bits)

Addressing modesIndex registersPost & preincrementBit-reverse addressingGoal: more parallelizable work per instruction

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

DSP Instruction SetsExample instructions from C55:”Finite impulse response filter”

FIRSADD Xmem, Ymem, Cmem, ACx, ACyOperation:

ACy = ACy + (ACx * Cmem)ACx = (Xmem << #16) + (Ymem << #16)

”Conditional add or sub”ADDSUBCC Smem, ACx, TCx, ACyOperation:

If TCx = 1, then ACy = ACx + (Smem << #16)If TCx = 0, then ACy = ACx - (Smem << #16)

Cmem, Xmem, Ymem: memory accesses + address

updating

Cmem, Xmem, Ymem: memory accesses + address

updating

C55 DSP has threeindependent data

buses, X, Y, and C

C55 DSP has threeindependent data

buses, X, Y, and C

Special condition register

Special condition register

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Mobile base stationMassive signal processing

Several processing tasks per connected mobile phone1000s of independent parallel tasks = parallelizer’s dream!

Based on DSPsStandard or custom500-1000 MHz VLIW instruction sets

4/8 way wide100s of processors

Serious supercomputer!

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Telecom/DatacommCore NetworkOptical & copper connectionsDigital & analog signals

EthernetATMPacket-over-SonetSS7POTS

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Telecomm/Datacomm

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Telecomm/DatacommRack-based systems

12-20 cards per shelf1-6 shelves per rack100s of CPUs

Compute cards:Run control code32-bit processors

Processing cards:Signal processingDSP or 32-bit CPUs

Line cards:Interface to networkASICs+32-bit CPUs

Backplane: ATM or EthernetRedundant switchedSwitched over cards

Redundant powerRedundant cards

CardCardCardCard

Rack Backplane

Control

PPC

FLASHPQ

Processing

DSP DSP

Line

PPC

atmasic

DSP DSP

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Control vs DataControl plane:

Decision-making“Integer applications”Call setup, servicesGeneral-purpose processors

Data plane:Move or process dataSignal processingMedia coding/decodingFloating/fixed pointDSP & ASIC work

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

MPC8560 “PowerQUICC”One on each card in a telecomm rack

Data planeBackplaneVery commonSold by Freescale

ProcessorPowerPC e500666-1000 Mhz256 kB L2 cache

NetworkingCPM module

9 Ethernet lines!

Features

Capabilities

256Multichannel HDLC (from MCC2)

2Utopia II ATM (from FCC)

2Ethernet 10/100/1000

3Ethernet, 10/100 (from FCC)

4Ethernet, 10 (from SCC)

2Ethernet 10/100/1000 controller

1RapidIO controller

1PCI-X/PCI controller

1DDR Memory controller

1I2C controller

1Serial Peripheral Interface (SPI)

2Serial Management Controller (SMC)

2Multi-Channel Controller (MCC2)

3Fast Communications Controller (FCC)

4Serial Communications Controller (SCC)

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Cisco Toaster38 clusters of 2

processors each8 clusters of 2

processors each

Each TMC is a VLIW machine with 74 bit

instructions, 2k instructions in local

memory

Each TMC is a VLIW machine with 74 bit

instructions, 2k instructions in local

memory

Total capacity: about 5 GOps, at 160 Mhz

Total capacity: about 5 GOps, at 160 Mhz

Two 32-bit ALUs and three control/data

movement units per TMC

Two 32-bit ALUs and three control/data

movement units per TMC

Image from Microprocessor Report, Oct 2002

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Cisco Toaster3

Massive multiprocessing

16 cores on a chip4 chips in serialRouting:

10 Gbps@ 20 Mpackets/s1000 ops per packet passing through

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Problem: Multicore

Telecomm & datacomm tradition: Distributed multiprocessingNo shared memorySoftware assumes single processor

Especially operating systems

Today: end-of-the-roadFuture performance gains: MPEverybody has to use shared memory

They need parallel programmers!

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Future System Template

Multicore node

CPU

L1$

CPU

L1$

CPU

L1$

L2$

RAM

Devices

Networketc.

Timer Serial

One shared memory space

Multicore node

CPU

L1$

CPU

L1$

CPU

L1$

L2$

RAM

Devices

etc.Network

Timer Serial

Network with local memory in each node

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Cars – DistributionMultiple networks

Body, engine, telematics, media, safety

Multiple processorsNetworkedUp to 100

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Cars

Functions by embedded processing:ABS: Anti-lock braking systemsESP: Electronic stability controlAirbagsEfficient automatic gearboxesTheft prevention with smart keysBlind-angle alert systems... etc ...

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Cars

Large diversity in processor types:8-bit – door locks, lights, etc. 16-bit – most functions32-bit – engine control, airbags

Form follows functionProcessing where the action isSensors and actuators distributedMassive distributed system

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Forestry Machines

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Forestry MachinesNetworked computer system

Controlling arms & toolsNavigating the forestRecording the trees harvestedCrucial to efficient work

Computer16-bit C167 processors in a CAN network

Tough environment-40°C at startup, +100°C when runningNetwork cables in bends – wireless useful!

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

C167CSInfineonTarget Market

Automotive control

Processing16-bit C16x core4-stage simple pipeline40 Mhz operation16 MB memory space, including ROM, RAM, devices

144 pin packageTolerates -40 to +125 C

About 25 USD

1Synchronous Serial Comms (SSC)

8 kBExtension Internal RAM (XRAM)

3 kBFast General Internal RAM (IRAM)

Devices

External Ports

32 kBROM

Memory116-bit ports from devices

88-bit ports from devices

2CAN interfaces

2x16Capture/Compare Channels

1USART

24+8Analog-Digital Converter Channels

1Pulse-Width Modulator (PWM)

1Watch-Dog Timer (WDT)

5General-Purpose Timers (GPT)

2CAN 2.0b controllers

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Operator PanelEmbedded PC

Graphical display Touch panelJoystickButtonsKeyboard

Regular PC archBut tough enough to be “out in the woods”

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Extremely LargeFunctions requiringcomputers:

RadarWeaponsDamage controlNavigationbasically everything

Computers:Large servers1000s of processors

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Inside your PCCustom processors

Graphics, sound

32-bit processorsIR, BluetoothNetwork, WLANHarddiskRAID controllers

8-bit processorsUSBKeyboard, mouse

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

If you want to playLego mindstormsrobotics kit

Standard controller8-bit processor64 kB of memory

Electronics to interface to motors and sensors

Good way to learnembeddedsystems

Swedish Business Perspective

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

Very very important

All advanced products containembedded systems todaySoftware is the key driver for new functions & special characteristics

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

End-Product CompaniesCore Swedish industryVery large companiesBuilds end-user products

EricssonABBVolvoVolvo CarsSaabScaniaSonyEricssonSKFSilvaHuskvarna

Info

rmat

ion T

echnolo

gy

Department of Information Technology | www.it.uu.se

SuppliersTool providers

IAR SystemsTelelogicNohauVirtutechVolcanoArcticusEnea

Solution providersCC-SystemsConnectBlue

Component companies

XeleratedSwitchcore

ConsultantsTietoEnatorTelecaÅFSaab Combitech+ many manymore