Title: Scheduling of Embedded RealTime Systems: CP, SA or B
1Scheduling of Embedded Real-Time Systems CP, SA
or BB?
- presented by Cecilia Ekelin
- Department of Computer Engineering
- Chalmers University of Technology
- http//www.ce.chalmers.se/cekelin
2Embedded System Design
S
A
A
S
T5
T2
T1
P3
P2
Messages
Network bus
P1
T3
T6
Processor node
M6,7
P5
P4
A
A
S
S
T7
T4
Software tasks
Hardware architecture
3Embedded System Characteristics
- Application-specific Interacts with a
well-defined environment. - Safety-critical Timing and execution constraints
must be guaranteed off-line. - Cost-effective The design is subject to
economical optimization.
How should the tasks be allocated and scheduled
onto the nodes?
4Algorithm Design Problem
Specification
- Modeling complex constraints
- Multi-objective contradicting objectives
- Search low average run-time complexity
HW/SW partitioning
Architecture Tasks
Allocation Scheduling
Model
Implementation
Product
5Approaches BB
- Branch-and-Bound
- Generates a search-tree of all possible
schedules. - Uses lower-bound estimates to prune branches.
- Pros and Cons
- Guaranteed to find a feasible/optimal schedule.
- Exponential runtime in the worst-case.
- Lower bounds have to be accurate (complicated).
- Difficult to introduce new constraints.
6Approaches SA
- Simulated annealing
- Makes random changes to an (initial) schedule.
- Uses an energy-function containing objectives and
constraints to measure the solution quality. - Pros and Cons
- Flexible.
- No search heuristics are needed.
- Polynomial worst-case runtime.
- - No solution guarantee.
- - Requires a well-balanced energy-function.
7Approaches CP
- Constraint programming
- - Formulates the problem using variables and
constraints. - - Uses constraint propagation and search to find
a valid variable assignment. - Pros and Cons
- Constraints and objectives are handled
independently. - Constraints are used pro-actively to reduce the
search-space. - General-purpose tools and algorithms exist.
- Solution guarantee.
- - Exponential runtime in the worst-case.
8Real-Time Scheduling
- Basic system model
- A set of processor nodes Pj
- A set of periodic tasks Ti
- Task properties
- Worst-Case Execution Time (WCET)
- Release time (R)
- Deadline (D)
T1
T1
T1
T1
P1
T2
T2
T2
P2
0
lcp
9Constraint Programming (Example)
- Uses library clp(FD) in SICStus Prolog.
- Variables
- The processor Ni 1,2
- The start time Si 0,lcp
- Constraints
- Release times Si gt Ri
- Deadlines Si WCETi lt Di
- Non-preemptive disjoint2(rect(Si, WCETi, Ni,
1))
10Modeling
11Optimization
- Single-objective
- - Feasible solution x, objective function f
- x is optimal if f(x)ltf(x) (for all x)
- Objectives
- Network communication
- Load-balance
- Maximum lateness
- Jitter
- Multi-objective
- Several contradicting objective functions fi(x)
- How should these be combined to define an optimal
solution?
12Multi-Objective Optimization
- Objective based definition SA,BB,CP
- Weighted sum f(x) ci fi(x)
- Constraint based definition CP
- Pareto-optimal fi(x)lt fi(x)
- Combination CP
- gi(x)100 (fimax(x) - fi(x))/(fimax(x) -
fimin(x)) - f(x) gi(x) subject to gi(x)gtmin gi(x)
13Search Performance
- Intelligent heuristics are essential for CP and
BB to experience acceptable runtimes. - Heuristics are used to
- Guide the search towards promising regions in the
search space (i.e. schedule construction). - Avoid and discard bad or inferior regions (e.g.,
lower bounds and symmetry exclusion).
14Search Heuristics (CP)
- Schedule construction
- Assign allocation variables before scheduling
variables. - - Group tasks according to interaction.
- Lower-bounds
- Statically solve a simpler (relaxed) problem.
- E.g., k-cut for communication
- Symmetry exclusion
- Avoid mirrored schedules on identical processors.
- Extends BB result for heterogeneous processors.
15Experimental Results
- CP versus SA (Di Natale Stankovic 1995)
- Setup 86 task sets, 59 tasks/set, 2 nodes,
- fjitter, resource and locality constraints
x-axis runtimes (secs) y-axis solved instances
16Experimental Results
- CP versus BB (Jonsson 1998)
- Setup 100 task sets, 15 tasks/set, 4 nodes,
- flateness, communication constraints
-Example Ex 1 with locality constraints, Ex 2
without
17Conclusions
A constraint programming framework for real-time
systems scheduling provides powerful modeling
capabilities and yet manages to reduce the
average run-time complexity.
18Future Work
- Improving the performance
- - Better (safe) estimations of the optimum for
different objective functions. - Improving the modeling
- Introducing more variability in the parameters.
- Introducing energy-awareness.