CH 6
CH 6
1
Introduction
• Energy consumption is an important issue in embedded systems.
– Mobile and portable devices.
– Laptops, PDAs.
– Mobile and Intelligent systems: Digital camcorders, cellular phones, and portable
medical devices.
2
Important Facts (1)
• High performance (SPEED) is needed only for a
small fraction of time, while for the rest of time, a low-
performance, a low-power processor would suffice.
Peak Computing
Work load Rate is needed
Average
rate would
suffice
Time
3
Important Facts (2)
• Processors are based on CMOS technology where
dynamic power is the bottleneck
Dynamic power (due to switching activity)
• E = V2 / R E α V2
• P = E/T P α V2 /T P α V2 . F
• Vα F V: voltage; P: power; E: Energy
• E=P*T T = CC / F
• Ei = K . cci . F2
4
• Static power = V*Ileak
where
• Ileak is the leakage current
• V is the applied voltage
• Total power dissipation =Dynamic power
+ Static power
• The goal is how to reduce the total
power consumption
5
Dynamic Voltage Scaling
• Minimizing Expected Energy
Consumption in Real-Time Systems
through Dynamic Voltage Scaling
6
Problems Theme
• Context: Frame-based hard real time
systems
• Given one or more tasks with
– Same period
– deadline = period
– Order of execution of tasks
8
Dynamic Voltage Scaling (DVS) processors
9
Example
Some microprocessors today are designed
to have adjustable voltage, so, a 15%
reduction in voltage may result in a 15%
reduction in frequency. What would be the
impact on dynamic energy and on dynamic
power?
10
Solution
11
Simple DVS-Scheme
DVS
f=F
system
Under loaded
Use less speed
f = F/2
12
DVS-example
• Consider a task with a computation time 20 units.
Time taken =
t1 (say)
• Energy of task Ti without DVS:
– E1 = K * 20 * F2.
– E2 = K * 20 * (F/2)2.
Therefore, if we reduce the frequency we save energy but, we spend more time
in performing the same computation
13
Energy-Time Tradeoffs
60
40
Energy 20
Savings
10
Time
Simple DVS scheme handling RT-task
• Consider a real-time task T1 = (20, 30)
• Applying the simple DVS scheme
– T1 runs at maximum frequency (F) and
meets the deadline with no energy savings
15
Simple DVS scheme handling RT-task
No DVS
Frequency
F
20@F
20 30
time
Inference:
DVS cannot be
blindly applied to
DVS: Low workload real-time
embedded
Frequency
systems
F
F/2
20@(F/2)
20 40 time
16
Energy aware scheduling in RT Systems
Objectives
Minimizing energy consumption
Meeting the deadlines
17
Problems & System Models
Problems
System Model
Ideal Realistic
Problems
• Intra-Task DVS
– Only one task
– Compute speed of each cycle or group of
consecutive cycles.
• Inter-Task DVS
– Multiple Tasks and their order of execution
– Compute fraction of remaining time to allocate
for each task
– At run time, speed changes only at the
boundary of a task
• Hybrid
– Combine Intra and Inter-task DVS
System Models
• Ideal Model
– Unrestricted continuous speed
– No time or energy overhead for changing
speed
– Well defined power-frequency relation.
p(f) = c0+c1f α
• Realistic Model
– Predefined set of discrete speeds
– Changing speed costs time and energy
overhead
– No assumption on power-frequency relation
Inter-task EDF
21
Static Voltage Scaling EDF: Motivation
Pre-run schedule with holes
WCi = worst case computation time @ Fmax Next arrival
of T1
22
Static Voltage Scaling EDF: exploiting holes
Pre-run schedule with holes
WCi = worst case computation time @ Fmax Next arrival
of T1
23
Static Voltage Scaling EDF
Next arrival
of T1
EDF Test:
25
Static voltage scaling: Example
Task set: T1 = (1, 4) and T2 = (2, 8)
U = 1/4 + 2/8 = 0.5 (< 1) @ Fmax
Fm
Frequency
0 1 3 4 5 8 Time
26
Static voltage scaling: Example
The previous task is modified Task set @ (Fmax/2):
T1 = (2, 4) and T2 = (4, 8)
U = 2/4 + 4/8 = 1 @ (Fmax/2)
Energy consumption:
Fm 1*F^2 + 2*F^2 = 3F^2
Frequency
0 1 3 4 5 8 Time
Energy consumption:
Fm 1*(F/2)^2 + 2*(F/2)^2 = (¾)F^2
Frequency
Fm / 2
0 2 6 8 Time
27
What if Ci < WCi ?
Actual
computation
time Next arrival
of T1
K*c1 K *c2 K * c3 K * c4
28
What if Ci < WCi ?
Actual
computation
time Next arrival
Task T1 completes before of T1
its WCET
29
What if Ci < WCi ? (contd..)
Next arrival
of T1
30
Cycle Conserving EDF
31
Cycle Conserving EDF Example
• Task set: T1 = (3, 6) and T2 = (6, 12)
• U = 3/6 + 6/12 = 1 @ Fmax
32
Cycle Conserving EDF Example
If task T1 just
completes in • T1 = (3, 6) and T2 = (6, 12)
one unit
creating holes
Fm
Frequency
T1 T2 T1
33
Cycle conserving EDF: Example
T1
T2
0 1 3 6 9 12 Time
34
Intra Task Energy Management
• Intra-task DVS: adjusts the voltage and
clock speed within a task.
35
Intra-task DVS Voltage
scheduling
B1 points
Intra-task RT-DVS 20
Intra-task DVS algorithms
typically work with the control
flow graph (CFG) of the real-time
programs.
Each node in the CFG denotes B2 20 10
a basic block of computation.
B3
The edges in the CFG indicate
the control dependency between
the blocks.
B4
Objective is to assign proper Different paths B5
clock frequency to each of the 10 150
P1: B1, B2.
basic blocks so as to minimize
the total energy consumption P2: B1, B3, B4.
Deadline = 200
while meeting the task deadline. P3: B1, B3, B5.
36
Simple Intra-task DVS: example
B1
Fmax 20
40@Fmax
40
B2 20 B3 10
Fmax
Deadline = 40
30@Fmax
At time = 20,
20 30 40 We know the exact
branch
37
Simple Intra-task DVS: example
B1
Fmax 20
40@Fmax
40
B2 20 B3 10
Fmax
Deadline = 40
20
10@(Fmax/2)
At time = 20,
20 40 We know the exact
branch
38