Event Driven Real-Time Programming CHESS Review University of California, Berkeley, USA May 10, 2004 Arkadeb Ghosal Joint work with Marco A. Sanvido, Christoph.

Slides:



Advertisements
Similar presentations
Separate Compilation of Hierarchical Real-Time Programs into Linear-Bounded Embedded Machine Code Arkadeb GHOSAL, UC Berkeley Christoph KIRSCH, University.
Advertisements

Flexible Scheduling of Software with Logical Execution Time Constraints* Stefan Resmerita and Patricia Derler University of Salzburg, Austria *UC Berkeley,
Logical Reliability of Interacting Real-Time Tasks Krishnendu Chatterjee, UC Berkeley Arkadeb Ghosal, UC Berkeley Thomas A. Henzinger, EPFL Daniel Iercan,
The cardiac pacemaker – SystemJ versus Safety Critical Java Heejong Park, Avinash Malik, Muhammad Nadeem, and Zoran Salcic. University of Auckland, NZ.
A Hierarchical Co-ordination Language for Interacting Real-time Tasks Arkadeb Ghosal, UC Berkeley Thomas A. Henzinger, EPFL Daniel Iercan, "Politehnica"
Undoing the Task: Moving Timing Analysis back to Functional Models Marco Di Natale, Haibo Zeng Scuola Superiore S. Anna – Pisa, Italy McGill University.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Time Safety Checking for Embedded Programs Thomas A. Henzinger, Christoph M. Kirsch, Rupak Majumdar and Slobodan Matic.
The Fixed Logical Execution Time (FLET) Assumption Tom Henzinger University of California, Berkeley.
Overview of PTIDES Project
Synthesis of Embedded Software Using Free-Choice Petri Nets.
Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems.
Architecture Modeling and Analysis for Embedded Systems Oleg Sokolsky CIS700 Fall 2005.
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
DISTRIBUTED AND HIGH-PERFORMANCE COMPUTING CHAPTER 7: SHARED MEMORY PARALLEL PROGRAMMING.
April 16, 2009 Center for Hybrid and Embedded Software Systems PtidyOS: An Operating System based on the PTIDES Programming.
Esterel Overview Roberto Passerone ee249 discussion section.
Exceptions in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chess Review May 11, 2005 Berkeley, CA Composable Code Generation for Distributed Giotto Tom Henzinger Christoph Kirsch Slobodan Matic.
Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation Concurrent Models of Computation for Embedded Software University.
February 21, 2008 Center for Hybrid and Embedded Software Systems Mapping A Timed Functional Specification to a Precision.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Designing Predictable and Robust Systems Tom Henzinger UC Berkeley and EPFL.
November 18, 2004 Embedded System Design Flow Arkadeb Ghosal Alessandro Pinto Daniele Gasperini Alberto Sangiovanni-Vincentelli
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
EMBEDDED SOFTWARE Team victorious Team Victorious.
Advances in Language Design
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
Real-Time Software Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Flow of Control. 2 Control Structures Control structure: An instruction that determines the order in which other instructions in a program are executed.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Ch. 2. Specification and Modeling 2.1 Requirements Describe requirements and approaches for specifying and modeling embedded systems. Specification for.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Conformance Test Experiments for Distributed Real-Time Systems Rachel Cardell-Oliver Complex Systems Group Department of Computer Science & Software Engineering.
Handling Mixed-Criticality in SoC- based Real-Time Embedded Systems Rodolfo Pellizzoni, Patrick Meredith, Min-Young Nam, Mu Sun, Marco Caccamo, Lui Sha.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
> Power Supervison Desired Output level Source Diesel Valve Sink Diesel Valve > Valve Regulator Sink T = 40 ms Air Valve CBSE Course The SaveComp Component.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
A hierarchical coordination language for reliable real-time tasks Arkadeb Ghosal University of California, Berkeley Dissertation Talk CHESS Seminar 22.
Giotto Embedded Control Systems Development with Thomas A. Henzinger Ben Horowitz Christoph M. Kirsch University of California, Berkeley
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Embedded Control System Development with Giotto Thomas A. Henzinger, Benjamin Horowitz, Christoph Meyer Kirsch UC Berkeley.
Processes and threads.
HDL simulation and Synthesis (Marks16)
PROCESS MANAGEMENT IN MACH
EEE 6494 Embedded Systems Design
Java programming lecture one
Real-time Software Design
PL/SQL Scripting in Oracle:
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Multithreading.
Multithreading.
Programming with Shared Memory Specifying parallelism
Simple Sequencing Part 2
CS561 Computer Architecture Hye Yeon Kim
Chapter 3: Process Management
Presentation transcript:

Event Driven Real-Time Programming CHESS Review University of California, Berkeley, USA May 10, 2004 Arkadeb Ghosal Joint work with Marco A. Sanvido, Christoph M. Kirsch and Thomas A. Henzinger University of California, Berkeley

10 MayCHESS Review Overview  Introduction  Language Features  The LET model  Language Constructs  Event Scoping  Analysis  Implementation  Ongoing Work

10 MayCHESS Review Control System Controller System Actuators Sensors AFR Controller Automotive Engine Fuel Injection Speed Sensor

10 MayCHESS Review Implementation Strategies  Traditional  Uses priorities to specify the relative deadlines of software tasks  Supports efficient code generation based on scheduling theory  Run-time behavior is highly non-deterministic  Synchronous Languages  Esterel, Lustre, Signal  Based on synchrony assumption: task computation takes negligible execution time  Shows deterministic behavior  Timed Languages  Based on Logical Execution Time (LET) for tasks  Giotto  Time Triggered  xGiotto  Event Triggered  Scoping of events

10 MayCHESS Review Logical Execution Time active releasestartpreemptionresumecompletiontermination running Logical Execution Time (LET) completion event { Physical { Logical release eventtermination event The logical and physical execution times are depicted below. The events controlling a task behavior are: Events generated by the platform: start preempt resume completion Event generated by the environment: release termination

10 MayCHESS Review Logical Execution Time { { Global input ports copied to local ports in logical zero time Local ports copied to global output ports in logical zero time Value of output port remains invariant at any instant independent of execution pattern Time determinism Value determinism P2 P1 LET P2 P1 P2 P1 LET P1

10 MayCHESS Review Reactions and Triggers react R1 { when [e2] react R2; when [e3] react R3; } until [e7];  A trigger maps an event to a reaction  When the event occurs the reaction is invoked  A reaction defines  New triggers  A termination event  Events of a reaction block are the events of its triggers and the termination event  A reaction block defines a scope for its events  When a trigger is invoked  The events of the new reaction block are enabled (active)  The events of the callee reaction block become passive (inactive) Reaction Block Reaction Name Triggers Until Event Events of R1: e2, e3, e7 Scope of e2, e3, e7: R1

10 MayCHESS Review 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

10 MayCHESS Review Tasks react R1 { release t1 (i1) (o1); when [e2] react R2; when [e3] react R3; } until [e7];  Tasks instances are defined by release statements  Tasks instances  released with the invocation of the reaction block  terminated with the termination of the reaction block  LET of the task is given by the life-span of the reaction block Release Statement Task Name Input Port Output Port

10 MayCHESS Review Releasing Tasks port p in ; p out ; stop start Logical Execution Time T reads p in updates p out releasestartpreemptionresume completiontermination p out is updated by the local copy of task T p in is copied to local port of task T event start; stop; task T (i) output (o) {/* compute */} react R { release T(p in )(p out ); } until [stop] { when [start] react R;}

10 MayCHESS Review 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

10 MayCHESS Review 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 MayCHESS Review 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.

10 MayCHESS Review Environment Assumption port p in ; p out ; stop start Logical Execution Time T reads p in updates p out releasestartpreemptionresume completiontermination p out is updated by the local copy of task T p in is copied to local port of task T event start; stop; task T (i) output (o) {/* compute */} react R { release T(p in )(p out ); } until [stop] { when [start] react R; } when [now] react {} until [3ms]; react R { release T(p in )(p out ); } until [3ms; stop]

10 MayCHESS Review 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 Instruction  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);  Trigger Statements  Defines the invoking action associated with an event  when [event] reaction block;  Repetition construct using whenever reaction() { release task1 (i1) (o1); release task2 (i2) (o2); when event1 react block1; whenever event2 react block2; } until event;

10 MayCHESS Review Structuring Events  Scoping of events  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 tree of scopes and the state of program variables denotes the state of the program.  Handling of events (of a passive scope)  It may be ignored (forget)  It may be postponed until its scope becomes active again (remember)  It may disable trigger statements of all descendent blocks and thus speeding up their termination (asap)  Invoking reactions in parallel  Wait-parallelism  Asap-parallelism  Embedding Environment Assumption  Event calculus

10 MayCHESS Review 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 (release). Scheduler: The Scheduler chooses from the active tasks, a task to be executed on the given platform (CPU). The scheduler generates an event at task completion. Event Reaction Reactor (E 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 Scheduler Completion Event Event Filter e1e1 e2e2 e3e3 e5e5 e4e4

10 MayCHESS Review AFR Controller react start { whenever remember [10teeth] react controller; } until [stop]; react channel2 { react { } until [5ms : teeth]; when remember [5ms : teeth] react {release set} until [ms]; react loop react {release reset; dec; } until [ms]; } until asap [50ms : 9teeth] react calcFuel { release CalcFuelInj; } until [10ms : teeth]; react controller { react calcFuel; when remember [teeth] react channel1 || react channel2 || … ; } until remember [10teeth] port /* fuel ports */ /* pulse ports */ event teeth; synch; stop; task set { /* opens the valve */ } task reset { /* closes the valve */ } task dec {/* pulse generation */} task CalcFuelInj {/* fuel parameter computation */}

10 MayCHESS Review 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

10 MayCHESS Review Event Filter Modified Embedded Machine Scheduler Environment SensorsActuators Platform active scope task completion execute E code task release Implementation xGiotto Reactions xGiotto Program Compiler Possible Execution Traces Code Generator Check Time Safety Check Race WCET Safe Scheduling Strategy Not Safe Race Exists No Race xGiotto Tasks

10 MayCHESS Review Implementation Event Filter Modified Embedded Machine Scheduler Environment SensorsActuators Platform active scope task completion execute E code task release xGiotto Reactions xGiotto Program Compiler Possible Execution Traces Code Generator Check Time Safety Check Race WCET Safe Scheduling Strategy Not Safe Race Exists No Race xGiotto Tasks Meta Model Reactions Meta Model Platform Meta Model Exploration Metropolis Platform Exploration

10 MayCHESS Review Ongoing Works  Implementation  Generate code  Embedded Virtual Machine code  Metropolis Meta-model  Porting to RTOS  EVM, JVM, OSEK  Case studies  Porting AFR controller on OSEK  Analysis  Defining the run-time system for xGiotto  Schedulability check in time polynomial to the size of the program  Future Direction  Sub-classes of xGiotto  Definition, inter relation and effectiveness towards event-driven programming  Type Checking

10 MayCHESS Review Thank You !