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 EngineerControl Design
Applicationdesignsvalidatessimulates
Software EngineerPlatform
Implementationdecomposesimplementstests
First Challenge
Compilation
Platform
Implementation
Second Challenge
Software Engineer
decomposesimplementstests
Abstract Syntax of a Task
f
Abstract Syntax of a Task
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
Read @ time t
Frequency 10ms
Semantics of a Task
fInput ports
State
Output ports
Time
Task
Read @ time t
Frequency 10ms
Write @ time t+10ms
Semantics of a Task
fInput ports
State
Output ports
Time
Task
Read @ time t
Frequency 10ms
Write @ time t+10ms
Don’t care
A Connection
Input ports Output portsf
State
Abstract Syntax of a Connection
f
State
Constant
Abstract Syntax of a Connection
f
State
Input port Output port
Semantics of a Connection
f
State
f
State
Semantics of a Connection
f
State
f
State
Time
Task
Semantics of a Connection
f
State
f
State
Time
Task
Write @ time t
Semantics of a Connection
f
State
f
State
Time
Task
Write @ time t Read @ time t
Semantics of a Connection
f
State
f
State
Time
Task
Write @ time t Read @ time t
0 time
Two Tasks
PInput ports Output ports
Two Tasks
PInput ports Output ports
QInput ports Output ports
Different Periodicity
P
Q
Different Periodicity
Time
Task
P
Q Q
Semantics
Time
Task
P
Q Q
Semantics
Time
Task
P
Q Q
t t+10ms
Semantics
Time
Task
P
Q Q
t t+10mst
Semantics
Time
Task
P
Q Q
t t+10mst t+5ms t+5ms
Semantics
Time
Task
P
Q Q
t t
Semantics
Time
Task
P
Q Q
t t
Semantics
Time
Task
P
Q Q
t t
Semantics
Time
Task
P
Q Q
t+5mst
Don’t care
Semantics
Time
Task
P
Q Q
t+5ms t+5ms
Semantics
Time
Task
P
Q Q
t+5ms t+5ms
Semantics
Time
Task
P
Q Q
t+5ms t+5ms
Semantics
Task
P
Q Q
t+10ms t+10ms
Semantics
Task
P
Q Q
t+10ms t+10ms
Semantics
Task
P
Q Q
t+10ms 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!
Abstract Syntax of a Mode
P
Q
Abstract Syntax of a Mode
P
Q
Abstract Syntax of a Mode
P
Q
Abstract Syntax of a Mode
P
Q
EntryPort
Abstract Syntax of a Mode
P
Q
EntryPort
Period
Semantics of a Mode
P
Q
EntryPort
Period10ms
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
M M’
M M’
Predicate
Abstract Syntax of a Mode Switch
M M’
Predicate
Abstract Syntax of a Mode Switch
Frequency
M M’
Predicate
Abstract Syntax of a Mode Switch
Frequency
Connection
M M’
Predicate
Abstract Syntax of a Mode Switch
Frequency 5ms
Connection
Mode M
P
Q
Period10ms
1
2
Mode M
P
Q
Period10ms
1
2
Connection
Mode M’
Connection
Mode M’
P1
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
Period10ms
Concrete Syntaxstart 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
Q Q
Time
Semantics of a Mode Switch
Task
P
Q Q
Mode Switch @ t+10ms t+10ms
Semantics of a Mode Switch
Task
P
Q Q
Mode Switch @ t+5ms t+5ms Time
Semantics of a Mode Switch
Task
P
Q
TimeMode Switch @ t+5ms
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
R R
t+5ms t+7.5ms
Semantics of a Mode Switch
Task
P
Q
t+5ms
R R
t+5ms t+7.5ms t+10ms
Semantics of a Mode Switch
Task
P
Q
t+5ms
R R
t+5ms Time
Mode M
P
Q
1
2
Connection
Semantics of a Mode Switch
Task
P
Q
t+5ms
R R
t+5ms Time
Semantics of a Mode Switch
Task
P
Q R R
Mode Switch finished @ t+5ms Time
Mode M’
P
R
1
4
Connection
Semantics of a Mode Switch
Task
P
Q
t+5ms
R R
t+5ms Time
Mode M’
P
R
1
4
Connection
Semantics of a Mode Switch
Task
P
Q
t+5ms
R R
t+5ms Time
Mode M’
P
R
1
4
Connection
Semantics of a Mode Switch
Task
P
Q
t+5ms
R R
t+5ms Time
Semantics of a Mode Switch
Task
P
Q R R
Timet+7.5ms
Semantics of a Mode Switch
Task
P
Q R R
Timet+7.5ms
Semantics of a Mode Switch
Task
P
Q R R
Timet+7.5ms
Semantics of a Mode Switch
Task
P
Q R R
Timet+7.5ms
Semantics of a Mode Switch
Task
P
Q R R
t+10ms t+10ms
Semantics of a Mode Switch
Task
P
Q R R
t+10ms t+10ms
Semantics of a Mode Switch
Task
P
Q R R
t+10ms t+10ms
Semantics of a Mode Switch
Task
P
Q R R
t+10ms t+10ms
Functionality & Timing
Control EngineerControl Design
Applicationdesignsvalidatessimulates
Software EngineerPlatform
Implementationdecomposesimplementstests
First Challenge
Compilation
Platform
Implementation
Second Challenge
Software Engineer
decomposesimplementstests
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
Q Q
Time
Platform Dependency
Task
P
Q Q
Time
Computation
Giotto-AS
Task
P
Q Q
Time
Host A
Host A Host A
Giotto-AS
Task
P
Q Q
Time
Host A
Host A Host A
2.
1.1.
Platform Dependency
Task
P
Q R R
Time
Platform Dependency
Task
P
Q R R
Time
Communication
Platform Dependency
Task
P
Q R R
Time
Communication
Giotto-ASC
Task
P
Q R R
Time
Host A
Host B CC
Giotto-ASC
Task
P
Q R R
Time
Host A
Host B CC
Network CNetwork C
Giotto-ASC
Task
P
Q R R
Time
Host A
Host B CC
Network CNetwork C
t+10mst
Giotto-ASC
Task
P
Q R R
Time
Host A
Host B CC
Network CNetwork C
t+10mst
Giotto-ASC
Task
P
Q R R
Time
Host A
Host B CC
Network CNetwork C
t+10mst
Summary
Control Design
Application
Platform
Implementation
Functionality & Timing
Control Engineer
Software Engineer Compilation