620 likes | 936 Views
Giotto. www.eecs.berkeley.edu/~fresco/giotto. Embedded Control Systems Development with. Thomas A. Henzinger Ben Horowitz Christoph M. Kirsch University of California, Berkeley. (presented by Marius Minea). Embedded Systems Development. Application. models derives simulates.
E N D
Giotto www.eecs.berkeley.edu/~fresco/giotto Embedded Control Systems Development with Thomas A. Henzinger Ben Horowitz Christoph M. Kirsch University of California, Berkeley (presented by Marius Minea)
Embedded Systems Development Application models derives simulates Control Engineer Control Design Matlab Functionality & Timing Giotto Program decomposes implements tests Software Engineer Distributed Platform Giotto!
Our Approach The Time-Triggered Paradigm [Kopetz]: -all communication activities triggered by clock -predictability (i.e., verifiability) -safety-critical applications (e.g., automotive) TTA: hardware & protocol realization Giotto: programming language realization
INU task pitch control aileron 1 task GPS task aileron 2 task air data task tailplane task throttle control pilot task rudder task thrust task Periodic Tasks roll control Sensor tasks Control tasks Actuator tasks
200 Hz 1 kHz 200 Hz 1 kHz
Modes • Control system of airplane is designed to operate in different modes. In each mode a particular set of controllers is deployed. There are switches between modes. • For example: • Navigational modes (taxi, takeoff, cruise). • Maneuver modes (dive, roll). • Fault tolerance modes (track which hardware is working).
Giotto • Giotto is a tool-supported methodology for embedded control systems design • Giotto consists of • a time-triggered and platform-independent programming language • a compiler • a runtime library • Giotto provides an abstract programmer’s model
The Giotto Methodology Functionality & Timing Giotto Program Compilation Scheduling & Communication Giotto Executable Giotto Runtime Library RTOS, e.g., VxWorks Distributed Platform
Task Definition: Abstract Syntax State Input ports f Output ports Period
Task Invocation:Time-Deterministic Semantics Task State Input ports f Output ports Period 10ms Time Read @ time t Write @ time t+10ms
Task Invocation:Time-Deterministic Semantics Actual time the task uses the CPU (may be preempted) Task State Input ports f Output ports Period 10ms Don’t care Time Read @ time t Write @ time t+10ms
Input/Output:Sensors-Control Law-Actuators State Sensors f Actuators
Different Periods Task P Q Q Time t t t+5ms t+5ms t+10ms
Zero-Delay Semantics Task P Q Q Time t t
Zero-Delay Semantics Task P Q Q Time t t
Time-Deterministic Semantics Task P Perhaps on same CPU Q Q Don’t care Time t t+5ms t+5ms
Time-Deterministic Semantics Task P Q Q Time t t+5ms t+5ms
Time-Deterministic Semantics Task P Most recent value guaranteed to be available (may have to be buffered) Q Q Time t t+5ms t+5ms
Time-Deterministic Semantics Task P Q Q t t+5ms t+5ms t+10ms t+10ms
An Abstract Programmer’s Model High-Level Programming Giotto Functionality Input/Output Ports Time-Determ. Computation Zero-Delay Communication Timing
Giotto Modes • Multi-modal control • Fault tolerance • Event modeling • Resource sharing • Uncertain environments Some Motivations:
Giotto Modes • A mode is a parameterized set of tasks. • A Giotto program consists of a set of modes and mode switches. • A Giotto system is in a single mode at any given time.
Abstract Syntax of a Mode Entry Port P 1 Q 2 Period 10ms Frequencies
Abstract Syntax of a Mode Switch Connection M M’ Frequency2: evaluation of trigger predicate every 5ms Trigger predicate
Mode M P 1 Connection Q 2 Period 10ms
Mode M’ P 1 R 4 Connection Period 10ms
Concrete Syntax startm ( ) { modem ( )period10 ms{ taskfreq1doP ( ) ; taskfreq2doQ ( x, y ) ; exitfreq2ify = 5thenm’ ( y ) ; } modem’ ( int z )period10 ms{ taskfreq1doP ( ) ; taskfreq4doR ( x, z ) ; } } Tasks are C procedures
Semantics of the Mode Switch Task P P Q Q R Easy Case: Mode Switch @ t+10ms t+10ms
Semantics of the Mode Switch Task P Q Time Interesting Case: Mode Switch @ t+5ms
Semantics of the Mode Switch Task P P Q R R R t+5ms t+5ms t+7.5ms t+10ms
Mode M P 1 Connection Q 2
Semantics of the Mode Switch Task P Mode switch already finished! Q R R Time t+5ms t+5ms
Mode M’ P 1 R 4 Connection
Semantics of the Mode Switch Task P Q R R Time t+5ms t+5ms
Mode M’ P 1 R 4 Connection
Semantics of the Mode Switch Task P Q R R Time t+5ms t+5ms
Mode M’ P 1 R 4 Connection
Semantics of the Mode Switch Task P Initial value Q R R Time t+5ms t+5ms
Semantics of the Mode Switch Task P Q R R Time
The Abstract Programmer’s Model High-Level Programming Giotto Functionality Input/Output Ports Time-Determ. Computation Zero-Delay Communication Timing Decomposition Modes
The Giotto Compiler • Automatic code generation • Compilation directives in the form of Giotto annotations for distributed platforms
The Giotto Compiler Giotto Program • Two possible answers: • Giotto executable • “Not schedulable” Giotto Compiler (either because program overconstrained, or because compiler not smart enough) Giotto Executable
Closing the Gap:Giotto-Architecture Annotations Giotto Program Hosts (CPUs), Nets, Worst-case execution / transmission times Giotto-A Program Giotto Compiler Distributed Platform
Closing the Gap:Giotto-Mapping Annotations Giotto Program Giotto-A Program Hosts, Nets, Performance Tasks to Hosts, Connections to Nets Giotto-AM Program Giotto Compiler Distributed Platform
Closing the Gap:Giotto-Schedule Annotations Giotto Program Giotto-A Program Hosts, Nets, Performance Tasks to Hosts, Connections to Nets Giotto-AM Program Tasks to Priorities (say), Connections to TDMA (say) Giotto-AMS Program Giotto Compiler Distributed Platform
Platform Dependency Computation Task P Q Q Time