Presentation is loading. Please wait.

Presentation is loading. Please wait.

From HRT-HOOD to ADA95 Real-Time Systems Lecture 5 Copyright, 2001 © Adam Czajka.

Similar presentations


Presentation on theme: "From HRT-HOOD to ADA95 Real-Time Systems Lecture 5 Copyright, 2001 © Adam Czajka."— Presentation transcript:

1 From HRT-HOOD to ADA95 Adam.Czajka@cs.put.poznan.pl Real-Time Systems Lecture 5 Copyright, 2001 © Adam Czajka

2 Contents Introduction HRT-HOOD objects ADA95 mapping Dynamic scheduling Summary

3 Copyright, 2001 © Adam Czajka Introduction HRT-HOOD object types : Cyclic Cyclic Sporadic Sporadic Protected Protected Passive Passive

4 Copyright, 2001 © Adam Czajka Introduction Basic definitions: T ij – j th instance of task T i  i – execution time of task T i  i – period of the task T i  ij – start time of the instance T ij  ij – finish time of the instance T ij

5 Copyright, 2001 © Adam Czajka Introduction Reference points for timing constraints  s =  1,2 -  1,1   e =  1,2 -  1,1 ss ee

6 Copyright, 2001 © Adam Czajka HRT-HOOD objects Cyclic objects - attributes Period Period Deadline Deadline Execution time Execution time Priority Priority

7 Copyright, 2001 © Adam Czajka HRT-HOOD objects  Cyclic objects – strong periodicity  i,j+1 -  i,j =  i gdzie: i, j = 1, 2, 3,... gdzie: i, j = 1, 2, 3,...  i,1  i,j  i,1  i,j

8 Copyright, 2001 © Adam Czajka HRT-HOOD objects  Cyclic objects – weak periodicity j*  i   i,k <  i,k < (j+1)*  i j*  i   i,k <  i,k < (j+1)*  i gdzie: i, k = 1, 2, 3,... gdzie: i, k = 1, 2, 3,... j = 0, 1, 2, 3,... j = 0, 1, 2, 3,...

9 Copyright, 2001 © Adam Czajka HRT-HOOD objects == << == Cyclic objects – relative periodicity  i,j+1 -  i,j   i gdzie: i, j = 1, 2, 3,... gdzie: i, j = 1, 2, 3,...  i,1  i,j  i,1  i,j

10 Copyright, 2001 © Adam Czajka HRT-HOOD objects Sporadic objects - attributes Minimum arrival time Minimum arrival time Deadline Deadline Execution time Execution time Priority Priority

11 Copyright, 2001 © Adam Czajka HRT-HOOD objects Sporadic objects Min. Arrival time   Min. Arrival time    Cyclic object with period  

12 Copyright, 2001 © Adam Czajka HRT-HOOD objects Sporadic objects Sporadic objects are transformed to cyclic ones. Minimum arrival time = period (worst case) Conclusion :

13 Copyright, 2001 © Adam Czajka ADA95 mapping Objects  ADA95 Packages Objects  ADA95 Packages Cyclic objects  Tasks Cyclic objects  Tasks Protected objects  Protected objects Protected objects  Protected objects Passive objects  Simple packages Passive objects  Simple packages Exceptions  ADA95 Exceptions Exceptions  ADA95 Exceptions Rules of the mapping :

14 Copyright, 2001 © Adam Czajka ADA95 mapping Cyclic objects task body T i is begin loop loop next_time := next_time +  i ; next_time := next_time +  i ;................ delay until next_time; delay until next_time; end loop; end loop; end;

15 Copyright, 2001 © Adam Czajka ADA95 mapping Protected objects protected body Pr is entry E 1 when.... entry E 1 when.... begin begin end; end; entry E 2 when.... entry E 2 when.... begin begin end; end; end;

16 Copyright, 2001 © Adam Czajka Dynamic scheduling Liu & Layland approach (1973): Rate Monotonic algorithm (fixed priorities) EDF algorithm (dynamic priorities)

17 Copyright, 2001 © Adam Czajka Dynamic scheduling Rate Monotonic algorithm Set the tasks’ priorities according to the formula: p i = 1 /  i Each time execute the task with the highest priority

18 Copyright, 2001 © Adam Czajka Dynamic scheduling Rate Monotonic algorithm For the N tasks the utilization factor U is equal to:

19 Copyright, 2001 © Adam Czajka Dynamic scheduling Rate Monotonic algorithm For a set of N tasks with fixed priority order, the least upper bound to processor utilization is

20 Copyright, 2001 © Adam Czajka Dynamic scheduling Rate Monotonic algorithm – ADA95 implementation Tasks’ priorities are set by pragma pragma priority(P i ) We have 30 normal priorities and 1 interrupt_priority (the highest one)

21 Copyright, 2001 © Adam Czajka Dynamic scheduling Rate Monotonic algorithm – priority inversion Pr 1 T1T1 T2T2 T3T322 11 3 1 3

22 Copyright, 2001 © Adam Czajka Dynamic scheduling Rate Monotonic algorithm – priority ceiling protocol Pr 1 T1T1 T2T2 T3T31 2 3 13

23 Copyright, 2001 © Adam Czajka Dynamic scheduling Rate Monotonic algorithm – priority inversion in ADA95 We can prevent the priority inversion by using the following pragma: pragma Locking_Policy(Ceiling_Locking)

24 Copyright, 2001 © Adam Czajka Dynamic scheduling EDF algorithm – the deadline driven scheduling approach For the given moment of time, the priorities are assigned to the tasks according to their current deadlines. A task will have the highest priority if its current deadline is the nearest.

25 Copyright, 2001 © Adam Czajka Dynamic scheduling EDF algorithm – the deadline driven scheduling approach For a given set of N tasks, the deadline driven scheduling algorithm is feasible if and only if

26 Copyright, 2001 © Adam Czajka Dynamic scheduling Implementation steps : Write the code Calculate the objects’ attributes Set the tasks’ priorities Calculate the U-factor

27 Copyright, 2001 © Adam Czajka Summary Introduction HRT-HOOD objects ADA95 mapping Dynamic scheduling


Download ppt "From HRT-HOOD to ADA95 Real-Time Systems Lecture 5 Copyright, 2001 © Adam Czajka."

Similar presentations


Ads by Google