Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation...

21
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
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    216
  • download

    0

Transcript of Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation...

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

Expressing Giotto in xGiotto and related schedulability problems

Class Project PresentationConcurrent Models of Computation for Embedded Software University of California, Berkeley, USA

Dec 10, 2004 

Arkadeb GhosalJoint work with Christoph M. Kirsch and Thomas A. Henzinger

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

10 Dec Project Presentation 2

Overview

Introduction xGiotto Language Features

The LET model Basic Constructs Event Scoping Event Handling

Giotto-to-xGiotto Translation Observations and Present Status

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

10 Dec Project Presentation 3

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

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

10 Dec Project Presentation 4

Logical Execution Time

release event termination 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

release start preemption resume completion termination

running running{Physical

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

10 Dec Project Presentation 5

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)

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

10 Dec Project Presentation 6

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

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

10 Dec Project Presentation 7

Reactions and Triggers

e4,e6e3e5

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

e6e4

e2

e2,e7 e2,e7

e6e5

e2,e7

react R2 { when [e8] react R5; } until [e9];

e2,e7 e7

e8,e9

e6

e6 e2

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

10 Dec Project Presentation 8

Tasks

e4,e6e3e5

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

e6e4

e2

e2,e7 e2,e7

e6e5

e2,e7

react R2 { release t3; when [e8] react R5; } until [e9];

e2,e7 e7

e8,e9

e6

e6 e2

t1 t1, t2 t1 t3

Tasks are released with the invocation of the reaction block Tasks are terminated with the termination of the reaction block

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

10 Dec Project Presentation 9

Handling Events

e4,e6e3e5

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

e6e4

e2

e2,e7 e2,e7

e6e6

e2,e7

react R2 { when [e8] react R5; } until [e9];

e2,e7 e7

e8,e9e5 e2

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)

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

10 Dec Project Presentation 10

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

e7

react R2 { release t2; when [e6] react R6; } until [e8];

e8

t1, t2

e6,e8 e5,e9

react R6 { } until [e4];

e7

t1, t2

e8 e5,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.

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

10 Dec Project Presentation 11

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 driverschedule task1when(ever) Aexit

R2: call driverschedule task1 by Xwhen(ever) Yuntil Aexit

Activate Event(when/whenever)

(until)

ScheduleTerminate

task1task2task3task4task n

SchedulerEvent Filter

e1

e2 e3

e5e4

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

10 Dec Project Presentation 12

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

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

10 Dec Project Presentation 13

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

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

10 Dec Project Presentation 14

Giotto-to-xGiotto (mode)

mode m period 6 task t1 period 3 task t2 period 2

0 1 2 3 4 5 6

m_0

m_1

m_2

m_3

m_4

m_5

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

10 Dec Project Presentation 15

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

0 1 2 3 4 5 6

m1_0

m1_1m1_2

m1_3

m1_4

m1_5

m2_4

m2_5

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

10 Dec Project Presentation 16

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

TerminationEvents are

finite

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

10 Dec Project Presentation 17

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;

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

10 Dec Project Presentation 18

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;

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

10 Dec Project Presentation 19

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

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

10 Dec Project Presentation 20

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

t1 t2 t3 t4 t5

Release

Time

0 2 2 4 5

Termination

Time

4 15 6 7 10

Worst-case

Execution-time

2 3 1 2 3

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

10 Dec Project Presentation 21

Thank You !