Presentation is loading. Please wait.

Presentation is loading. Please wait.

Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation Concurrent Models of Computation for Embedded Software University.

Similar presentations


Presentation on theme: "Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation Concurrent Models of Computation for Embedded Software University."— Presentation transcript:

1 Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation Concurrent Models of Computation for Embedded Software University of California, Berkeley, USA Dec 10, 2004 Arkadeb Ghosal Joint work with Christoph M. Kirsch and Thomas A. Henzinger

2 10 DecProject Presentation2 Overview  Introduction  xGiotto Language Features  The LET model  Basic Constructs  Event Scoping  Event Handling  Giotto-to-xGiotto Translation  Observations and Present Status

3 10 DecProject Presentation3 Introduction  Languages based on Logical Execution Time (LET) for tasks  A termination event is specified on release of a task  The evaluation of a task is available only after the termination event  Giotto  Time Triggered  Periodic invocation of tasks  A mode describes a set of periodic tasks  Mode switch defines conditions to jump from one mode to another  Timed Multitasking  Event triggered  Assigns deadline for a task at the time of release  xGiotto  Event Triggered  Scoping of events

4 10 DecProject Presentation4 Logical Execution Time release eventtermination event active Logical Execution Time (LET) { Logical The logical and physical execution times are depicted below. The events controlling a task behavior are: Events from physical side: start preempt resume completion Events from logical side: release termination releasestartpreemptionresumecompletiontermination running { Physical

5 10 DecProject Presentation5 xGiotto: Basic Constructs  Reaction Blocks  Basic programming blocks in xGiotto  Consists of release statements and trigger statements along with an termination information  Releases tasks and invokes triggers  react {reaction block} until [event];  Release Statements  Tasks are released with the invocation of the reaction block  Tasks are terminated with the termination of the reaction block  release task (input ports) (output ports);  LET of the task is given by the life-span of the reaction block  Trigger Statements  Associates an event with a reaction block  The reaction block is invoked when the event occurs  when [event] reaction block;  Repetition construct using whenever  Event Scopes  A reaction block defines a scope for its events  When a reaction block is invoked (a trigger is activated)  The events of the new reaction block are enabled (active)  The events of the callee reaction block become passive (inactive)

6 10 DecProject Presentation6 Basic Features (cont.) react R1 { when [e2] react R2; when [e3] react R3; } until [e7]; Reaction Block Reaction Name Triggers Termination Event Events of R1: e2, e3, e7 Scope of e2, e3, e7: R1 react R1 { release t1 (i1) (o1); when [e2] react R2; when [e3] react R3; } until [e7]; Release Statement Task Name Input Port Output Port

7 10 DecProject Presentation7 Reactions and Triggers e4,e6 e3 e5 react R1 { when [e2] react R2; when [e3] react R3; } until [e7]; react R3 { when [e4] react R4; } until [e6]; react R4 { } until [e5]; e2,e3,e7 e6 e4 e2 e2,e7 e6 e5 e2,e7 react R2 { when [e8] react R5; } until [e9]; e2,e7e7 e8,e9 e6 e2

8 10 DecProject Presentation8 Tasks e4,e6 e3 e5 react R1 { when [e2] react R2; when [e3] react R3; } until [e7]; react R3 { release t1; when [e4] react R4; } until [e6]; react R4 { release t2; } until [e5]; e2,e3,e7 e6 e4 e2 e2,e7 e6 e5 e2,e7 react R2 { release t3; when [e8] react R5; } until [e9]; e2,e7e7 e8,e9 e6 e2 t1t1, t2 t1 t3  Tasks are released with the invocation of the reaction block  Tasks are terminated with the termination of the reaction block

9 10 DecProject Presentation9 Handling Events e4,e6 e3 e5 react R1 { when [e2] react R2; when [e3] react R3; } until [e7]; react R3 { when [e4] react R4; } until remember [e6]; react R4 { } until [e5]; e2,e3,e7 e6 e4 e2 e2,e7 e6 e2,e7 react R2 { when [e8] react R5; } until [e9]; e2,e7e7 e8,e9 e5e2 e5  A reaction block defines a scope: this implicitly denotes the scope of an event  When an active trigger is invoked, the called reaction becomes the active scope and the caller reaction, the passive scope  The event of a passive scope can be  Ignored (forget)  Postponed until its scope becomes active again (remember)

10 10 DecProject Presentation10 Parallelism e2 react R1 { when [e2] react R2 || R3; } until [e7]; react R3 { release t1; when [e5] react R5; } until [e9]; e2,e7 e9 e7 react R2 { release t2; when [e6] react R6; } until [e8]; e8 t1, t2 e6,e8e5,e9 react R6 { } until [e4]; e7 t1, t2 e8e5,e9 e4 e6 e4 e7 t2 e8 e4 t2 e7 e8  A trigger may invoke multiple reaction blocks in parallel.  When the trigger is invoked all the reactions become active simultaneously.  The parent block is active only when all the parallel reaction blocks have terminated.

11 10 DecProject Presentation11 The Program Flow Event Filter: The Event Filter implements the event scoping mechanism and filter the incoming event. It determines which event needs to be reacted upon depending upon the event qualifiers – forget, remember or asap. Reactor: The Reactor executes the specified reaction and activates new events (when/whenever/until) and activates and terminates tasks. Scheduler: The Scheduler chooses from the active tasks, a task to be executed on the given platform (CPU). Event Reaction Reactive Machine R1:call driver schedule task1 when(ever) A exit R2:call driver schedule task1 by X when(ever) Y until A exit Activate Event (when/whenever) (until) Schedule Terminate task1 task2 task3 task4 task n SchedulerEvent Filter e1e1 e2e2 e3e3 e5e5 e4e4

12 10 DecProject Presentation12 Program Analysis  Platform independent  Race Condition Detection  Verifying whether a port may be updated by multiple task invocations and thus leading to non-determinism  Resource Size Analysis  Predicting the run-time memory requirements for executing an xGiotto program: the bound on the size of the event filter and scopes (trigger queue size and active task set size).  Platform dependant  Schedulability Analysis  Ensuring that all the task invocations get access to the executing platform at least equal to their worst-case-execution times before their termination

13 10 DecProject Presentation13 Motivation  Simple Schedulability check for Giotto  If all modes are reachable, check is polynomial and is necessary  If some modes are unreachable the check is sufficient  Reachability of modes is pspace-complete  Type system  Typed E-code has simple schedulability check  Giotto compiler generates typed E-code  Interesting Sub-class of xGiotto  Time-triggered  Expressing Giotto  Syntactic characteristics of such a sub-class  Scheduling the sub-class  Extending to event-triggered systems  Schedulability check is not possible for arbitrary event

14 10 DecProject Presentation14 Giotto-to-xGiotto (mode) mode m period 6 task t1 period 3 task t2 period 2 0123456 m_0 m_1 m_2 m_3 m_4 m_5

15 10 DecProject Presentation15 Giotto-to-xGiotto (mode switch) mode m1 period 6 task t1 period 3 task t2 period 2 switch frequency 3 mode m2 period 6 task t1 period 3 task t3 period 2 switch frequency 3 0123456 m1_0 m1_1 m1_2 m1_3 m1_4 m1_5 m2_4 m2_5

16 10 DecProject Presentation16 Giotto-to-xGiotto (?) All Giotto programs cannot be expressed in xGiotto in its present form mode m1 period 6 task t1 period 6 task t2 period 3 switch frequency 2 mode m2 period 12 task t1 period 6 task t3 period 4 switch frequency 3 Giotto programs with all modes releasing a task of frequency one and/ or releasing a a set of harmonic tasks can be expressed No cyclic calls Termination Events are finite

17 10 DecProject Presentation17 Proposed modifications  No parallel construct  All triggers with same event will be enabled simultaneously  Out-of-scope activation  Trigger events with immediate form  Modification of until event  Extending to termination event and continuation event  Tasks terminate by termination event  Parallel reaction blocks can be released at continuation event  Constraints on parallelism react M12 until 3 continue 2; react M2 until 2 continue 1; react M1 until 3 continue 1; react M2 until 2 continue 2;

18 10 DecProject Presentation18 Proposed Modifications (cont.) react m1_0 until 6 continue 3; if (sw12) { react {} until 1; react m2_5 until 2; } else react m1_1 until 3; react m1_0 until 6 continue 4; if (sw21) { react {} until 2; } else { react m1_2 until 4 continue 2; react m1_3 until 6 continue 2; if (sw21) { react {} until 1; if (sw12) { react {} until 1; react m2_5 until 2; } else react m1_1 until 3; } else { react m1_4 until 4; } /* main */ if (mode = m1) react m1; if (mode = m2) react m2;

19 10 DecProject Presentation19 Schedulability  Sub-class under study  Time triggered, all events remembered, all children terminates before their parent (span of a node is never extended)  Sub-class that can express Giotto  Composability  Two parallel reaction blocks should be schedulable independent of each other  Reaction Dependency Graph  A Graph denoting the calling pattern of the reaction blocks  For time-triggered programs the exact pattern can be derived  An efficient way to describe the size of the program

20 10 DecProject Presentation20 Schedulability (cont.)  Horn’s algorithm  Given a set of aperiodic tasks with their release time, termination time and worst-case-execution-time determines the schedulability  Provides an EDF based scheduling strategy  EDF is optimal for such a task pattern  Efficient pruning of conditional branches  Utilization test  Syntactic constraints t1t2t3t4t5 Release Time 02245 Termination Time 4156710 Worst-case Execution-time 23123

21 10 DecProject Presentation21 Thank You !


Download ppt "Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation Concurrent Models of Computation for Embedded Software University."

Similar presentations


Ads by Google