Giotto A Time-Triggered Language for Embedded Programming Thomas A. Henzinger, Benjamin Horowitz Christoph M. Kirsch, Rupak Majumdar UC Berkeley
Embedded Programming Giotto aims at hard real-time applications Giotto is time-triggered Giotto is platform independent Giotto consists of ports, tasks, modes Giotto works, with VxWorks, Ptolemy
Functionality & Timing Control Engineer Control Design Application designs validates simulates Software Engineer Platform Implementation decomposes implements tests First Challenge
Compilation Platform Implementation Second Challenge Software Engineer decomposes implements tests
A Task
Abstract Syntax of a Task f
f State
Abstract Syntax of a Task fInput ports State
Abstract Syntax of a Task fInput ports State Output ports
Abstract Syntax of a Task fInput ports State Output ports Frequency
Semantics of a Task fInput ports State Output ports Frequency 10ms
Semantics of a Task fInput ports State Output ports Time Task Frequency 10ms
Semantics of a Task fInput ports State Output ports Time Task Frequency 10ms
Semantics of a Task fInput ports State Output ports Time Task time t Frequency 10ms
Semantics of a Task fInput ports State Output ports Time Task time t Frequency 10ms time t+10ms
Semantics of a Task fInput ports State Output ports Time Task time t Frequency 10ms time t+10ms Don’t care
A Connection Input portsOutput portsf State
Abstract Syntax of a Connection f State Constant
Abstract Syntax of a Connection f State Input portOutput port
Semantics of a Connection f State f
Semantics of a Connection f State f Time Task
Semantics of a Connection f State f Time Task time t
Semantics of a Connection f State f Time Task time time t
Semantics of a Connection f State f Time Task time time t 0 time
Two Tasks PInput portsOutput ports
Two Tasks PInput portsOutput ports QInput portsOutput ports
Connections P Q
P Q
P Q
Different Periodicity P Q
Time Task P QQ
Semantics Time Task P QQ
Semantics Time Task P QQ tt+10ms
Semantics Time Task P QQ tt+10mst
Semantics Time Task P QQ tt+10mstt+5ms
Semantics Time Task P QQ tt
Connections P Q
Semantics Time Task P QQ tt
Connections P Q
Semantics Time Task P QQ tt
Semantics Time Task P QQ t+5mst Don’t care
Semantics Time Task P QQ t+5ms
Semantics Time Task P QQ t+5ms
Semantics Time Task P QQ t+5ms
Semantics Task P QQ t+10ms
Semantics Task P QQ t+10ms
Semantics Task P QQ t+10ms
Theory ! A Giotto program is a single set of tasks, so far Is this enough?
Theory = Practice ? Yes, we have sufficient computation and communication resources! => A single set of tasks is enough
Theory = Practice ? Yes, we have sufficient computation and communication resources! => A single set of tasks is enough Fin
Theory = Practice ? Yes, we have sufficient computation and communication resources! => A single set of tasks is enough Fin No, we have to share resources! => with modes
Practice ! A mode is a set of tasks. A Giotto program is a set of modes. A Giotto program is a partitioning of the set of all required tasks.
FAQ: Time vs. Events Q: How about events? A: Use modes!
A Mode
Abstract Syntax of a Mode P Q
P Q
P Q
P Q Entry Port
Abstract Syntax of a Mode P Q Entry Port Period
Semantics of a Mode P Q Entry Port Period 10ms 1 2
Concrete Syntax mode m ( ) period 10 ms { taskfreq 1 do int x = P ( ) ; taskfreq 2 do int y = Q ( x, y ) ; }
A Mode Switch MM’
M Predicate Abstract Syntax of a Mode Switch
MM’ Predicate Abstract Syntax of a Mode Switch Frequency
MM’ Predicate Abstract Syntax of a Mode Switch Frequency Connection
MM’ Predicate Abstract Syntax of a Mode Switch Frequency 5ms Connection
Mode M P Q Period 10ms 1 2
Mode M P Q Period 10ms 1 2 Connection
Mode M’ Connection
Mode M’ P 1 Connection
Mode M’ P R 1 4 Connection
Mode M’ P R 1 4 Connection
Mode M’ P R 1 4 Connection
Mode M’ P R 1 4 Connection
Mode M’ P R 1 4 Connection Period 10ms
Concrete Syntax start m ( ) { mode m ( ) period 10 ms entryfreq 1 { taskfreq 1 do int x = P ( ) ; taskfreq 2 do int y = Q ( x, y ) ; exitfreq 2 if y = 5 then m’ ( y ) ; } mode m’ ( int z ) period 10 ms entryfreq 2 { taskfreq 1 do int x = P ( ) ; taskfreq 4 do int u = R ( x, z ) ; }
Semantics of a Mode Switch Task P QQ Time
Semantics of a Mode Switch Task P QQ Mode t+10mst+10ms
Semantics of a Mode Switch Task P QQ Mode t+5mst+5ms Time
Semantics of a Mode Switch Task P Q Time Mode t+5ms
Mode M’ P R 1 4
Semantics of a Mode Switch Task P Q t+5ms Time R t+5ms
Semantics of a Mode Switch Task P Q t+5ms Time RR t+5mst+7.5ms
Semantics of a Mode Switch Task P Q t+5ms RR t+7.5mst+10ms
Semantics of a Mode Switch Task P Q t+5ms RR Time
Mode M P Q 1 2 Connection
Semantics of a Mode Switch Task P Q t+5ms RR Time
Semantics of a Mode Switch Task P QRR Mode Switch t+5ms Time
Mode M’ P R 1 4 Connection
Semantics of a Mode Switch Task P Q t+5ms RR Time
Mode M’ P R 1 4 Connection
Semantics of a Mode Switch Task P Q t+5ms RR Time
Mode M’ P R 1 4 Connection
Semantics of a Mode Switch Task P Q t+5ms RR Time
Semantics of a Mode Switch Task P QRR Time t+7.5ms
Semantics of a Mode Switch Task P QRR Time t+7.5ms
Semantics of a Mode Switch Task P QRR Time t+7.5ms
Semantics of a Mode Switch Task P QRR Time t+7.5ms
Semantics of a Mode Switch Task P QRR t+10ms
Semantics of a Mode Switch Task P QRR t+10ms
Semantics of a Mode Switch Task P QRR t+10ms
Semantics of a Mode Switch Task P QRR t+10ms
Functionality & Timing Control Engineer Control Design Application designs validates simulates Software Engineer Platform Implementation decomposes implements tests First Challenge
Compilation Platform Implementation Second Challenge Software Engineer decomposes implements tests
Annotated Giotto Giotto Compiler Giotto Program Platform
Giotto-Architecture Giotto Compiler Hosts, Nets, Performance Giotto Program Giotto-A Program Platform
Giotto-Scheduler Giotto Compiler Task to Host, Priority Hosts, Nets, Performance Giotto Program Giotto-A Program Giotto-AS Program Platform
Giotto-Communication Giotto Program Giotto Compiler Giotto-A Program Platform Giotto-AS Program Giotto-ASC Program Task to Host, Priority Hosts, Nets, Performance Connection to Net, TDMA
Platform Dependency Task P QQ Time
Platform Dependency Task P QQ Time Computation
Giotto-AS Task P QQ Time Host A
Giotto-AS Task P QQ Time Host A 2. 1.
Platform Dependency Task P QRR Time
Platform Dependency Task P QRR Time Communication
Platform Dependency Task P QRR Time Communication
Giotto-ASC Task P QRR Time Host A Host BCC
Giotto-ASC Task P QRR Time Host A Host BCC Network C
Giotto-ASC Task P QRR Time Host A Host BCC Network C t+10mst
Giotto-ASC Task P QRR Time Host A Host BCC Network C t+10mst
Giotto-ASC Task P QRR Time Host A Host BCC Network C t+10mst
Summary Control Design Application Platform Implementation Functionality & Timing Control Engineer Software Engineer Compilation
Demo