Minimizing CPU Shortage Risks in Integrated Embedded Software
1. Minimizing CPU Time Shortage Risks
in Integrated Embedded Software!
Shiva Nejati, Morayo Adedjouma, Lionel C. Briand!
SnT Centre, University of Luxembourg!
!
Jonathan Hellebaut, Julien Begey, and Yves Clement!
Delphi Automotive, Luxembourg!
!
November 14, 2013!
4. Software integration involves multiple stakeholders
4
• Develop software optimized
for their specific hardware
• Provide part suppliers with
runnables (exe)
• Integrate car makers
software with their own
platform
• Deploy final software on
ECUs and send them to car
makers
Car Makers Part Suppliers
5. Stakeholders have different objectives
5
• Objective: Effective execution
and synchronization of
runnables
• Some runnables should
execute simultaneously or in
a certain order
• Objective: Effective usage
of CPU time
• The CPU time used by all
the runnables should
remain as low as possible
over time
Car Makers Part Suppliers
6. 0ms 5ms 10ms 15ms 20ms 25ms 30ms
0ms 5ms 10ms 15ms 20ms 25ms 30ms
0ms 5ms 10ms 15ms 20ms 25ms 30ms
It is challenging to satisfy all objectives
6
4ms
3ms
2ms
✔
✗
Car Makers Part Suppliersr0 r1 r2 r3
Execute r0 to r2 together Minimize CPU time usage
7. 7
Our approach to minimization of CPU time usage
Optimization
while satisfying synchronization/
temporal constraints
Explicit Time
Model
for real-time embedded systems
Search
meta-heuristic single objective
search algorithms
10^27
an industrial case study with a
large search space
9. 0ms 5ms 10ms 15ms 20ms 25ms 30ms
9
Scheduling mechanism in automotive systems
AUTOSAR scheduling also known as static cyclic scheduling
period = 5ms period = 10ms
10. 10
How to minimize CPU time usage?
4ms
3ms
By setting offsets (i.e., initial delays) for runnables
0ms 5ms 10ms 15ms 20ms 25ms 30ms
0ms 5ms 10ms 15ms 20ms 25ms 30ms
o0=0, o1=0, o2=0, o3=0
o0=0, o1=5, o2=5, o3=0
r0 r1 r2 r3
11. 0ms 5ms 10ms 15ms 20ms 25ms 30ms
11
How to satisfy synchronization constraints?
Runnables r0, r1, and r2 should run in the same time slot
infinitely often
r0 r1 r2 r3
o0=0, o1=5, o2=5, o3=0
oi ⌘ oj mod(gcd(periodi, periodj))
for ri, rj 2 {r0, r1, r2}
0ms 5ms 10ms 15ms 20ms 25ms 30ms
o0=0, o1=5, o2=10, o3=0
✗
Classical number theory (Chinese remainder theorem)
Runnables r0, r1, and r2 run in the same time slot
infinitely often iff
13. 13
Single-objective Search algorithms
hill Climbing and tabu Search and their variations
Solution Representation
a vector of offset values: o0=0, o1=5, o2=5, o3=0
Tweak operator
o0=0, o1=5, o2=5, o3=0 à o0=0, o1=5, o2=10, o3=0
Synchronization Constraints
offset values are modified to satisfy constraints
Fitness Function
max CPU time usage per time slot
14. 14
Case Study and Experiments
An automotive software project with 430
runnables
16. 16
CPU time usage always remains less than 2.13ms, so
more than half of each slot is guaranteed to be free
2.13ms
5 ms
Time
CPUtimeusage(ms)
After applying our work
17. (ms)(s)
Best CPU usage
Time to find
Best CPU usage
17
Experiment Results (Sanity Check)
Our algorithms were better than random search
Tabu
CPUtimeusage(ms)
Only Tabu search was not better than random search
Random
Hill Climbing
18. 18
Experiment Results (Effectiveness)
Hill Climbing performed best compared to other algorithms
Running Hill Climbing for three times, it hits the best result
with a probability of 87.5%
Our results were better than some existing (deterministic)
algorithms based on real-time scheduling theory
19. • Feasibility analysis
– Schedulable or not?
v We perform optimization by finding the best solutions among all
the feasible ones
• Logical models
– Correct/incorrect?
v We provide an explicit time model enabling us to perform a
quantitative analysis
• Symbolically represent the model and rely on model-checkers or
constraint solvers
– State explosion problem
v We scale to very large search spaces: 10^27
Related Work
19