System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level...

27
Petru Eles, IDA, LiTH Hardware/Software Codesign Low Power/Energy - 1 System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption 3. System Level Power Optimization 4. Dynamic Power Management 5. Mapping and Scheduling for Low Energy 6. Real-Time Scheduling with Dynamic Voltage Scaling Hardware/Software Codesign Low Power/Energy - 2 Petru Eles, IDA, LiTH Remember the Design Flow System model Prototype Fabrication Informal Specification, Constraints Functional Simulation Modeling Testing Arch. Selection System architecture Mapping Estimation Mapped and scheduled model Scheduling OK not OK not OK OK not OK Formal Verification Softw. model Hardw. model Simulation Formal Verification Softw. Generation Hardw. Synthesis Softw. blocks Hardw. blocks Simulation Simulation

Transcript of System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level...

Page 1: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 1

System-Level Power/Energy Optimization

1. Sources of Power Dissipation

2. Reducing Power Consumption

3. System Level Power Optimization

4. Dynamic Power Management

5. Mapping and Scheduling for Low Energy

6. Real-Time Scheduling with Dynamic Voltage Scaling

Hardware/Software Codesign Low Power/Energy - 2

Petru Eles, IDA, LiTH

Remember the Design Flow

System model

Prototype

Fabrication

Informal Specification,Constraints

FunctionalSimulation

Modeling

Testing

Arch. Selection

Systemarchitecture Mapping

Estimation

Mapped andscheduled model

Scheduling

OK

not OK not OK

OK

not OK

FormalVerification

Softw. model Hardw. model

SimulationFormal

Verification

Softw. Generation Hardw. Synthesis

Softw. blocks Hardw. blocksSimulation

Simulation

Page 2: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 3

Why is Power Consumption an Issue?

• Portable systems - battery life time!

• Systems with a very limited power budget: Mars Pathfinder,autonomous helicopter, ...

• Desktops and servers: high power consumption

- raises temperature and deteriorates performance & reliability

- increases the need for expensive cooling mechanisms

• One of the main difficulties with developing high performancechips is heat extraction.

• High power consumption has economical and ecologicalconsequences.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 4

Sources of Power Dissipation in CMOS Devices

P12--- C V DD

2 f N SW⋅ ⋅ ⋅ ⋅ QSC V DD f N SW⋅ ⋅ ⋅ I leak V DD⋅+ +=

dynamic static

Switching powerPower required tocharge/dischargecircuit nodes

Short-circ. powerDissipation dueto short-circuitcurrent

Leakage powerDissipationdue to leakagecurrent

C = node capacitancesNSW = switching activities

(number of gate transitionsper clock cycle)

f = frequency of operation

VDD = supply voltageQSC = charge carried by

short circuit currentper transition

Ileak = leakage current

Page 3: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 5

Sources of Power Dissipation in CMOS Devices (cont’d)

sourc

e

draingat

e

body

gate

drain

source

Vbs

CMOS transistor (N-type)

Vbs = body bias voltageVth = threshold voltage

Threshold voltage:

- The minimal voltagerequired at the gate toturn on the transistor

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 6

Sources of Power Dissipation in CMOS Devices (cont’d)

Vdd

CL

gate

drain

source

CMOS transistor (N-type)

Vbs = body bias voltageVth = threshold voltageVdd = supply voltageCL = output load capacitance

CMOS inverter

Dynamic power

- Charging and discharging theoutput load capacitance

- Momentary short circuits at agate’s output

sourc

e

draingat

e

bodyVbs

Page 4: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 7

Sources of Power Dissipation in CMOS Devices (cont’d)

Vdd

CL

gate

drain

source

CMOS transistor (N-type)

Vbs = body bias voltageVth = threshold voltageVdd = supply voltageCL = output load capacitance

CMOS inverter

Static power

- Subthreshold leakageconduction

- Junction leakage (drainand source to body)

It flows even whenthe voltage at thegate is below Vth

sourc

e

draingat

e

bodyVbs

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 8

Sources of Power Dissipation in CMOS Devices (cont’d)

☞ For long:• Leakage power has been considered negligible compared to

dynamic.

☞ Today:• Total dissipation from leakage is approaching the total from

dynamic.

☞ As technology drops below 65nm:• Leakage power is exceeding dynamic.

Page 5: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 9

Sources of Power Dissipation in CMOS Devices (cont’d)

☞ Leakage power is consumed even if the circuit is idle (standby). Theonly way to avoid is decoupling from power.

☞ Short circuit power can be around 10% of total.

☞ Switching power is still the main source of power consumption.

For the rest of the discussion, we consider mainly switchingpower.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 10

Power and Energy Consumption

NCY = number of cycles needed for the particular task.

• In certain situations we are concerned about power consumption:- heath dissipation, cooling:- physical deterioration due to temperature.

• Sometimes we want to reduce total energy consumed:- battery life.

P12--- C V DD

2 f N SW⋅ ⋅ ⋅ ⋅=

E P t⋅ 12--- C V DD

2 N CY N SW⋅ ⋅ ⋅ ⋅= =

Page 6: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 11

Reducing Power/Energy Consumption

☞ The main sources:

• Reduce supply voltage

• Reduce switching activity

• Reduce capacitance

• Reduce number of cycles

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 12

Reducing Power/Energy Consumption (cont’d)

☞ Circuit level• Ordering of transistors in gate (influences capacitance).• Transistor sizing.

☞ Logic level• Don’t-care optimization to reduce switching activity.• Reduce spurious switching activity by balancing the delays of

paths that converge at each gate.• Technology mapping.• State encoding such that switching activity is minimised: if

state s has a large number of transitions to state q, theyshould be given uni-distant codes.

• Encoding to minimise switching activity in arithmetic units oron the bus.

• Gated clocks: Gate the clocks of circuits (registers, gates,arithmetic units when they are in idle time periods.

Page 7: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 13

Reducing Power/Energy Consumption (cont’d)

☞ Behavioral level

• Schedule and map operations so that number of cycles isminimised (with increased number of switching per clockcycle) ⇒ you can run at slower clock rate ⇒ you can reducesupply voltage.

• Allocate and share modules so that power consumption isreduced (for example, by reducing switching activity)

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 14

Reducing Power/Energy Consumption (cont’d)

☞ Architecture level

• Specialise instruction set, datapath, register structure to theparticular architecture, with power consumption as an optimizationgoal.

- You have on the chip and you switch only those resources(gates) you really need.

• Reduce power consumption on the bus.- lower switching activity: clever encoding, reduce switching ac-

tivity on the address bus by exploiting correlations;- minimise the bus length (capacitance) by optimal module

placement.- bus segmentation: transform a long heavily loaded global bus

into a partitioned set of local bus segments.

Page 8: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 15

Reducing Power/Energy Consumption (cont’d)

• Optimise the memory structure.

- Memory transfers are extremely power hungry: a memorytransfer takes 33 times more energy than an addition!

Reducing the number of memory accesses is a very efficientway to save power!

- Adapt the number of caches, their size and associativity, andthe length of the cache line to the application ⇒ reducenumber of memory transfers.

- Interesting trade-off: larger caches consume more power butreduce number of memory transfers ⇒ find the right balance!

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 16

Reducing Power/Energy Consumption (cont’d)

• Provide instruction support for Power management:

- Instructions which allow to put in stand-by or shut down certainparts of the system.

- Instructions which allow to dynamically fix the supply voltage(dynamic voltage scaling).

Page 9: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 17

Reducing Power/Energy Consumption (cont’d)

☞ System Level

• Static techniques are applied at design time.- Compilation for low power: instruction selection considering

their power profile, data placement in memory, registerallocation.

- Algorithm design: find the algorithm which is the most power-efficient.

- Task mapping and scheduling.

• Dynamic techniques are applied at run time.- These techniques are applied at run-time in order to reduce

power consumption by exploiting idle or low-workload periods.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 18

System Level Power Optimization

Three techniques will be discussed:

1. Dynamic power management: a dynamic technique.

2. Task mapping: a static technique.

3. Task scheduling with dynamic power scaling: static & dynamic.

Page 10: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 19

Dynamic Power Management (DPM)

application

hardware

power aware OS

Decisions:

• Switching among multiple powerstates:

• idle• sleep• run

• Switching among multiplefrequencies and voltage levels.

Goal:

• Energy optimization• QoS constraints satisfied

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 20

Dynamic Power Management (cont’d)

Hardware Support (e.g. Intel Xscale Processor)

RUNRUN

RUNRUN

IDLE SLEEP

RUN

0.75V, 60mW150MHz

1.3V, 450mW600MHz

1.6V, 900mW800MHz

90µs

40mW 160µW

10µs

10µs 140ms

1.5ms

160µs

• RUN: operational

• IDLE: Clocks to theCPU are disabled;recovery is throughinterrupt.

• SLEEP: Mainlypowered off;recovery throughwake-up event.

• Other intermediatestates: DEEPIDLE, STANDBY,DEEP SLEEP

Page 11: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 21

Dynamic Power Management (cont’d)

☞ DPM techniques are used in laptops, personal digital assistants(PDAs), and other portable appliances in order to shut down orplace in stand-by unused devices.The goal is power saving.

☞ DPM techniques are implemented in the operating system(including Windows 2000 running on laptops).

☞ The power breakdown for a laptop computer:- 36% of total power consumed by the display- 18% by hard-disk- 18% by wireless LAN interface- 7% by keyboard, mouse, etc.- 21% by digital VLSI circuits.

don’t forgetthese!

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 22

The Basic Concept of DPM

• When there are requests for a device ⇒ the device is busy;otherwise it is idle.

• When the device is idle, it can be shut down to enter a low-powersleeping state.

BusyBusy

Working WorkingSleeping

T1 T2 T3 T4

Device state

Power state

Workload

Time

Requests Requests

Idle

Tsd Twu

?

Page 12: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 23

The Basic Concept of DPM (cont’d)

☞ Changing the power state takes time (several seconds) and extra energy.

• Tsd : shutdown delay• Twu : wake-up delay

Send the device to sleep only if the saved energy justifies the overhead!

☞ The main Problems:

• Don’t shut down such that delays occur too frequently.• Don’t shut down such that the savings due to the sleeping are

smaller than the power overhead of the sate changes.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 24

Power Management Policies

• Power management policies are concerned with predictionsrelated to idle periods:

- For shut-down: try to predict how long the idle period will be inorder to decide if a shut-down should be performed.

- For wake-up: try to predict when the idle period ends, in orderto avoid user delays due to Twu.It is quite difficult, and often the wake-up is started simplywhen a request has arrived.

• Typical Policies:1. Time-out2. Predictive3. Stochastic

Page 13: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 25

Time-out Policy

☞ It is assumed that, after a device is idle for a period τ (the interval T1 - T2on slide 22), it will stay idle for at least a period which makes it efficientto shut down.

• Drawback: you waste energy during the period τ (compared toinstantaneous shut-down).

• Policies:- Fixed time-out period: you set the value of τ, which then stays con-

stant.- Adjusted at run-time: increase or decrease τ, depending on the

length of previous idle periods.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 26

Predictive Policy

☞ The length of an idle period is predicted. If the prediction is for an idleperiod long enough, the shut-down is performed immediately (no timeinterval T1 - T2 on slide 22).

• Policy- L-shaped distribution for ;Idle Period

Previous Busy Period----------------------------------------------------

Busy Period

Idle

Per

iod

Short busy periodsare followed bylong idle periods.

Busy periods longerthan a threshold θare followed byshort idle periods.

θ

Shut down aftershort busy period!

Page 14: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 27

Stochastic Policy

☞ Predictions are based on Markov models: requests and power statetransitions of the device are modelled as probabilistic state machines.

• The power manager observes the arriving requests, the requestqueue and the device ⇒ generates shutdown commands.

Environment or user:generates requests

The device:provides service

requestqueue

Power manager

Markov model:device

Markov model:request generator

requests

obs.

obs.

obs.

com

man

ds

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 28

Mapping and Scheduling for Low Energy

☞ For many embedded systems DPM techniques, like presentedbefore, cannot be applied:

• They have no devices like hard-disk, no (or small) display ⇒VLSI is a main source of power dissipation.

• They have time constraints ⇒ we have to keep deadlines(usually we cannot afford shut-down and wake-up times).

• The operating system is small ⇒ no sophisticated techniques atrun-time.

• The application is known at design time ⇒ we know a lot aboutthe application already at design time.

☞ Static techniques can be used (applied at design time).Mapping and scheduling for low energy are important!

Page 15: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 29

Mapping for Low Energyτ1

τ8

τ5

τ7

τ3

τ6

τ4

τ2

µp3 µp4

Bus

TaskWCET Energy

µp3 µp4 µp3 µp4

τ1 5 6 5 3

τ2 7 9 8 4

τ3 5 6 5 3

τ4 8 10 6 4

τ5 10 11 8 6

τ6 17 21 15 10

τ7 10 14 8 7

τ8 15 19 14 9

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 30

Mapping for Low Energy (cont’d)

Consider a mapping: Communication times and energy:µp3: τ1, τ3, τ6, τ7, τ8. C1-2: t = 1; E = 3. C3-5: t = 2; E = 5.µp4: τ2, τ4, τ5. C4-8: t = 1; E = 3. C5-7: t = 1; E = 3.

Execution time: 52; Energy consumed: 75.

τ1

38 40 42 44 46 48 50 52 54 56 58 60 620 2 4 6 8 10 12 14 16 18 20 22 24 26 30 32 3428 36Time 64

τ3

τ4

τ6 τ7 τ8µp3

µp4

bus

τ2 τ5

C1-2 C5-7C3-5 C4-8

Page 16: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 31

Mapping for Low Energy (cont’d)

Consider a mapping: Communication times and energy:µp3: τ1, τ3, τ6, τ7. C1-2: t = 1; E = 3. C3-5: t = 2; E = 5.µp4: τ2, τ4, τ5, τ8. C7-8: t = 1; E = 3. C5-7: t = 1; E = 3.

Execution time: 57; Energy consumed: 70.

τ1

38 40 42 44 46 48 50 52 54 56 58 60 620 2 4 6 8 10 12 14 16 18 20 22 24 26 30 32 3428 36Time 64

τ3

τ4

τ6 τ7

τ8

µp3

µp4

bus

τ2 τ5

C1-2 C5-7C3-5 C7-8

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 32

Mapping for Low Energy (cont’d)

The second mapping with τ8 on µp4 consumes less energy;

Assume that we have a maximum allowed delay = 60.

This second mapping is preferable, even if it is slower!

Page 17: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 33

Real-Time Scheduling with Dynamic Voltage Scaling

☞ The energy consumed by a task, due to switching power (slide 10):

• Reducing supply voltage VDD is the most efficient way to reduceenergy consumption.

☞ The frequency at which the processor can be operated depends on VDD:

, k: circuit dependent constant; Vt: threshold voltage.

The execution time of the task:

E12--- C V DD

2 N CY N SW⋅ ⋅ ⋅ ⋅=

f kV DD V t–( )2

V DD-----------------------------⋅=

texe N CY

V DD

k V DD V t–( )2⋅-------------------------------------⋅=

NSW = number of gate transitionsper clock cycle.

NCY = number of cycles neededfor the task.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 34

Real-Time Scheduling with Dynamic Voltage Scaling (cont’d)

The scheduling problem:Which task to execute at a certain moment on a certain processor sothat time constraints are fulfilled?

The scheduling problem with voltage scaling:Which task to execute at a certain moment on a certain processor, andat which voltage level, so that time constraints are fulfilled and energyconsumption is minimised?

☞ The problem: reducing supply voltage extends execution time!

Page 18: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 35

Variable Voltage Processors

• Several supply voltage levels are available.

• Supply voltage can be fixed by the application (operating system)through execution of particular instructions.

• Frequency is automatically adjusted to the current supply voltage.

• Several processors with variable voltage levels are alreadyavailable. There will be more and more in the near future.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 36

The Basic Principle

We consider a single task τ:

- total computation: 109 execution cycles.- deadline: 25 seconds.- processor nominal (maximum) voltage: 5V.- energy: 40 nJ/cycle at nominal voltage.- processor speed: 50MHz (50×106 cycles/sec) at nominal voltage.

0 5 10 15 20 25 time (sec)

V2

52

slackEtotal = 40 J

texe = 20 sec

109 cycles

Page 19: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 37

The Basic Principle (cont’d)

Let’s make it slower!

• VDD = 2.5V- energy: 40×2.52/52 = 10nJ/cycle.- speed: 50×2.5/5 = 25MHz

0 5 10 15 20 25 time (sec)

V2

52Etotal = 32.5 J

texe = 25 sec

2.52

750×106 cycles 250×106 cycles

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 38

The Basic Principle (cont’d)

• VDD = 4V- energy: 40×42/52 = 25nJ/cycle.- speed: 50×4/5 = 40MHz

0 5 10 15 20 25 time (sec)

V2

52Etotal = 25 J

texe = 25 sec42

109 cycles

Page 20: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 39

The Basic Principle (cont’d)

☞ If a processor uses a single supply voltage and completes aprogram just on deadline, the energy consumption is minimised.

Consider two tasks τ1, τ2:

• Computation- τ1: 250×106 execution cycles; τ2: 750×106 execution cycles;

• Deadline: 25 seconds.• Processor nominal (maximum) voltage: 5V.• Energy:

- 40 nJ/cycle at nominal voltage.- 25 nJ/cycle at VDD = 4V.

• Processor speed:- 50MHz (50×106 cycles/sec) at nominal voltage.- 40MHz at VDD = 4V.

τ1

τ2

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 40

The Basic Principle (cont’d)

• Find the voltage so that the tasks just meet their deadline ⇒ youhave minimised energy consumption!

0 5 10 15 20 25 time (sec)

V2

Etotal = 25 J42

750×106 cycles250×106

cycles

τ1 τ2

Page 21: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 41

Considering Task Particularities

Energy consumed by a task:

Average energy consumed by task per cycle:

☞ Often tasks differ from each other in terms of executed operations⇒ NSW and C differ from one task to the other.

The average energy consumed per cycle differs from task to task.

E12--- C V DD

2 N CY N SW⋅ ⋅ ⋅ ⋅=

ECY12--- C V DD

2 N SW⋅ ⋅ ⋅=

NSW = number of gate transitionsper clock cycle.

C = switched capacitance perclock cycle.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 42

Considering Task Particularities (cont’d)

Consider two tasks τ1, τ2:

• Computation- τ1: 250×106 execution cycles; τ2: 750×106 execution cycles;

• Deadline: 25 seconds.• Processor nominal (maximum) voltage: 5V.• Processor speed:

- 50MHz (50×106 cycles/sec) at nominal voltage.- 40MHz at VDD = 4V.- 25MHz at VDD = 2.5V.

• Energy τ1- 50 nJ/cycle at VDD = 5V.- 32 nJ/cycle at VDD = 4V.- 12.5 nJ/cycle at VDD = 2.5V.

• Energy τ2- 12.5 nJ/cycle at VDD = 5V.- 8 nJ/cycle at VDD = 4V.- 3 nJ/cycle at VDD = 2.5V.

τ1

τ2

Page 22: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 43

Considering Task Particularities (cont’d)

☞ Here we have a solution with VDD = 4V, and deadline just fulfilled:

Etotal = 32nJ/cycle × 250 × 106cycles + 8nJ/cycle × 750 × 106cycles

0 5 10 15 20 25 time (sec)

V2

Etotal = 14 J42

750×106 cycles250×106

cycles

τ1 τ2

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 44

Considering Task Particularities (cont’d)

☞ Here we run τ1 at VDD = 2.5V, and τ2 at VDD = 5V; the tasks finishjust on deadline.

Etotal = 12.5nJ/cycle × 250 × 106cycles + 12.5nJ/cycle × 750 × 106cycles

0 5 10 15 20 25 time (sec)

V2

52Etotal = 12.5 J

2.52

750×106 cycles250×106 cycles

τ1

τ2

Page 23: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 45

Considering Task Particularities (cont’d)

☞ If power consumption per cycle is not constant (but differs from taskto task), the rule on slide 40 is not true any more.

Voltage levels have to be reduced with priority for those tasks whichhave a larger energy consumption per cycle.

☞ One particular voltage level has to be established for each task, sothat deadlines are just satisfied.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 46

Discrete Voltage Levels

☞ Practical microprocessors can work only at a finite number of discretevoltage levels.

The “ideal” voltage Videal, determined for a certain task does not exist.

☞ A task is supposed to run for time texe at the voltage Videal.On the particular processor the two closest available neighbours toVideal are: V1 < Videal < V2.

You have minimised the energy if you run the task for time t1 atvoltage V1 and for t2 at voltage V2, so that t1 + t2 = texe.

Page 24: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 47

Scheduling Policies

☞ The techniques described here, in order to find optimal voltagelevels for real-time tasks, can be applied both with:

• Static cyclic scheduling

• Priority-based scheduling

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 48

The Pitfalls with Ignoring Leakage

E NC C⋅ eff V dd2⋅ Lg V dd K3 e

K4 V dd⋅e

K5 V bs⋅⋅ ⋅ ⋅ V bs I ju⋅+( ) t⋅ ⋅+=

Minimise this andignore the rest!

Page 25: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 49

The Pitfalls with Ignoring Leakage

1. We don’t optimize global energy but only a part of it!

2. We can get it even very wrong and increase energy

consumption!

E NC C⋅ eff V dd2⋅ Lg V dd K3 e

K4 V dd⋅e

K5 V bs⋅⋅ ⋅ ⋅ V bs I ju⋅+( ) t⋅ ⋅+=

Leakage decreaseswith Vdd, but growthwith time!

Dynamic decreaseswith Vdd regardlessof increased time.

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 50

E NC C⋅ eff V dd2⋅ Lg V dd K3 e

K4 V dd⋅e

K5 V bs⋅⋅ ⋅ ⋅ V bs I ju⋅+( ) t⋅ ⋅+=

0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95

1e-10

2e-10

3e-10

4e-10

5e-10

6e-10

7e-10

8e-10

10.50

Dynamic energy

Vdd

En

erg

y p

er C

ycle

Jejurikar et. al., DAC’04

70nm technology, Crusoe processor

Page 26: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 51

E NC C⋅ eff V dd2⋅ Lg V dd K3 e

K4 V dd⋅e

K5 V bs⋅⋅ ⋅ ⋅ V bs I ju⋅+( ) t⋅ ⋅+=

0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95

1e-10

2e-10

3e-10

4e-10

5e-10

6e-10

7e-10

8e-10

10.50

Leakage energy

Dynamic energy

Vdd

En

erg

y p

er C

ycle

Jejurikar et. al., DAC’04

70nm technology, Crusoe processor

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 52

E NC C⋅ eff V dd2⋅ Lg V dd K3 e

K4 V dd⋅e

K5 V bs⋅⋅ ⋅ ⋅ V bs I ju⋅+( ) t⋅ ⋅+=

0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95

1e-10

2e-10

3e-10

4e-10

5e-10

6e-10

7e-10

8e-10

10.50

Leakage energy

Dynamic energy

Dynamic + Leakage

Vdd

En

erg

y p

er C

ycle

Jejurikar et. al., DAC’04

70nm technology

Critical point!If you go beyond thiswith Vdd energy grows

Page 27: System-Level Power/Energy Optimizationzebpe83/teaching/rtes/lectures/power.frm.pdf · System-Level Power/Energy Optimization 1. Sources of Power Dissipation 2. Reducing Power Consumption

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 53

Summary

• Power consumption becomes a central issue for embeddedsystems design.

• Power/energy consumption can be reduced by reducing supplyvoltage, switching activity, switched capacitance, number ofexecuted cycles.

• There are means at all levels of the design to reduce powerconsumption: circuit, logic, behavioral, architecture, system level.

• At system level we distinguish dynamic techniques (applied duringrun-time) and static techniques (applied at design time).

Petru Eles, IDA, LiTH

Hardware/Software Codesign Low Power/Energy - 54

Summary (cont’d)

• Dynamic power management is implemented by the operatingsystem, and is mainly used in portable appliances to shut down orplace in stand-by unused devices.

• Typical policies for power management are: time-out, predictive,and stochastic.

• Both at task mapping and at scheduling, design decisions can bemade with have a huge impact on power/energy consumption.

• Real-time scheduling in the context of processors with voltagescaling is extremely interesting. The main trade-off is voltage levelvs. execution time. One has to find the optimal voltage levels suchthat energy consumption is reduced and deadlines are stillfulfilled.