Download presentation
Presentation is loading. Please wait.
1
Embedded System Design Framework for Minimizing Code Size and Guaranteeing Real-Time Requirements Insik Shin, Insup Lee, & Sang Lyul Min CIS, Penn, USACSE, SNU, KOREA
2
2 Agenda Background Period Calibration Method (PCM) Code size reduction technique Design framework overview Optimization problem formulation Heuristic solutions and evaluations Conclusion
3
3 Period Calibration Method (PCM) Design methodology that transforms real- time system requirements into real-time task scheduling parametersreal- time system requirements real-time task scheduling parameters Example Example Drawback : it may not generate schedulable solutions R. Gerber et al. “Guaranteeing End-to-End Timing Constraints by Calibrating Intermediate Processes”, RTSS ’94.
4
4 Code Size Reduction Technique Code size is a critical design factor for many embedded systems. Reduced bit-width instructions ARM microprocessor normal mode : 32-bit instruction set Thumb mode : 16-bit instruction set code size can be reduced by 30%, while # of instructions can increase by 40%.
5
5 Code Size vs Execution Time Tradeoff A program contains both 16/32 bit instructions in functions or basic blocks. Compile-time tradeoff between code size (s) and execution time (e) of a task s e
6
6 Tradeoff Function Tradeoff function for each task i s = f i (e) (linear or discrete) s e A B
7
7 Embedded Real-Time System Design Problem: design a system satisfying real- time system requirements while minimizing the total code size of the task system Task 1Task 2Task n … X1 X2 Y1 11 22 d1 33 d2 44 F(Y1|X1)=30, F(Y1|X2)=25, C(Y1|X1,X2) = 4, u(Y1)=40, l(Y1)=30 Real-time System Requirements Tradeoff
8
8 Design Framework Goal : deriving task code size and scheduling parameters while minimizing the system code size and guaranteeing real-time requirements X1 X2 Y1 11 22 d1 33 d2 44 F(Y1|X1)=30, F(Y1|X2)=25, C(Y1|X1,X2) = 4, u(Y1)=40, l(Y1)=30 Real-time System Requirements PCM 0510 Task Scheduling Parameters 0510 Task 1Task 2Task n … Tradeoff Design Framework
9
9 Design Framework Overview Real-Time System Requirements Task Code Size Feasibility Constraints Task Exec. Time Min. Task Exec. Time PCM Task Scheduling Parameters Task Tradeoff Feasibility Analysis Optimization Framework Design Framework Task Code Size & Scheduling Parameters
10
10 Design Framework Overview Real-Time System Requirements Task Code Size Feasibility Constraints Task Exec. Time Min. Task Exec. Time PCM Task Scheduling Parameters Task Tradeoff Feasibility Analysis Optimization Framework Design Framework Task Code Size & Scheduling Parameters
11
11 Optimization Problem Formulation Given linear or discrete tradeoff functions and task scheduling parameters, determine task execution time solving the following optimization problem: Optimization problem: objective: minimizing constraint: feasibility
12
12 Feasibility Analysis Task model : asynchronous periodic tasks with pre-period deadlines under EDF scheduling For the task model, an exact feasibility condition is for all, where is the number of jobs of task that must be completely scheduled in [t 1, t 2 ). Feasibility Analysis is NP-hard [Baruah ’90].
13
13 Feasibility Analysis Our contribution: another exact feasibility condition that can be more efficiently evaluated. for all (t 1, t 2 ) OD ALL, where OD ALL is a set of possible pair of (offset, deadline) between 0 and 2T LCM + O max.
14
14 Optimization Framework Optimization Problem Objective : minimizing Constraint : for all (t 1, t 2 ) OD ALL. Complexity of optimization problem Linear tradeoff : the optimization problem can be solved through linear programming. Discrete tradeoff: we prove the problem is NP-hard and present three heuristics.
15
15 Heuristic Algorithms Consider the following three tasks 11 22 33 TiTi 975 eiei 212 11 22 33 05101520
16
16 Heuristic Algorithms Each job can increase its execution time if there is an empty slot in its execution window 11 22 33 05101520 05101520 EDF Schedule
17
17 Heuristic Algorithms Each job can increase its execution time if there is an empty slot in its execution window 11 22 33 05101520 05101520 EDF Schedule
18
18 Heuristic Algorithms Each job can increase its execution time if there is an empty slot in its execution window Cumulative amount of execution time each job can increase 11 22 33 05101520
19
19 Heuristic Algorithms Each job can increase its execution time if there is an empty slot in its execution window The maximum amount of execution time a task can increase is the maximum amount of execution time all of its jobs can increase together. 11 22 33 05101520
20
Heuristic Algorithms Highest Best Reduction-Ratio First (HBRF) reduction ratio choose a task with the highest reduction ratio 11 22 05101520 eiei ii
21
21 Heuristic Algorithms Longest Period First (LPF) choose a task with the longest period. In general, increasing the execution time of this task has the least impact on the schedulability of task set 11 22 05101520 T1T1 T2T2
22
22 Heuristic Algorithms Highest Best Weighted-Reduction-Ratio First (HBWF) Weighted reduction ratio choose a task with the highest weighted reduction ratio 11 22 05101520 eiei ii T1T1 T2T2
23
23 Evaluation of Heuristic Algorithms Closeness to OPT S(init) – initial system code size S(alg) – system code size obtained with an heuristic algorithm S(opt) – optimal system code size Closeness to OPT
24
24 Performance of algorithms with 8 tasks Closeness to OPT (%)
25
25 Performance of BEST with various task numbers Closeness to OPT (%)
26
26 Conclusion Design framework taking advantage of the code size vs. execution time tradeoff Future work Energy consumption is another critical design factor of embedded systems. Extends this framework so as to utilize tradeoffs among code size, execution time, and energy consumption.
27
27 Real-Time System Requirements Task graph Task graph dataflow & task precedence End-to-end timing constraints End-to-end timing constraints freshness from input to output input correlation output separation
28
28 Task Graph Dataflow & task precedence X1 X2 Y1 11 22 d1 d2 44 X3 33 d3 d4 55 Y2 66
29
29 End-to-end timing Constraints Freshness from input to output: F(Y1|X1) Input correlation : C(Y1|X1,X2) Output separation : u(Y1), l(Y1) X1 X2 Y1 11 22 d1 d2 44
30
30 Example – System Requirements X1 X2 Y1 11 22 d1 d2 44 X3 33 d3 d4 55 Y2 66 F(Y1|X1)=30, F(Y1|X2)=30, F(Y2|X2)=20, F(Y2|X3)=15 C(Y1|X1,X2)=3, C(Y2|X2,X3)=4 l(Y1)=21, u(Y1)=32, l(Y2)=29, u(Y2)=41 e1=2, e2=2, e3=1, e4=3, e5=2, e6=3
31
31 Example – Solution Process 1. deriving the period of each task minimizing utilization ( ) 2. deriving the offset and deadline of each task 3. deriving the fixed priority of each task
32
32 Example – Task Scheduling Parameters 11 22 33 44 55 66 period2613392639 offset00021013 deadline211213261315 priority123456
33
33 Real-Time Task Scheduling Parameters Period (T i ) Offset (O i ) Deadline (D i ) Fixed priority Execution time (e i )
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.