Presentation is loading. Please wait.

Presentation is loading. Please wait.

Giotto and TMO Yerang Hur System Design Research Lab. Dept. of Computer and Information Science.

Similar presentations


Presentation on theme: "Giotto and TMO Yerang Hur System Design Research Lab. Dept. of Computer and Information Science."— Presentation transcript:

1 Giotto and TMO Yerang Hur System Design Research Lab. Dept. of Computer and Information Science

2 Outline §Giotto l overview l programming language l code generation §TMO l overview l programming scheme l TMOSM (TMO Support Middleware)

3 Overview: Embedded Control System Development Control Engineer Control Design Application decomposes designs simulates Software Engineer Distributed Platform Giotto Program decomposes implements tests Functionality & Timing Matlab! Giotto! Henzinger, Horowitz, and Kirsch, 2001

4 Automatic Compilation Giotto-PSC Program Giotto Program Giotto-P Program Giotto-PS Program Giotto Executable Platform Annotation Schedule Annotation Communication Annotation Giotto Compiler Software Engineer

5 Language Primitives §Port l a physical location connected to a sensor, an actuator, an input of a control law §Task l a periodic task which consists of ports and a sequential piece of code with WCET (Worst- Case Execution Time) §Connection l association an input port with an output port §Mode l a set of tasks and mode switches

6 Giotto Tasks 0510152025 P Q t A Giotto task reads the values in its input port in invocation and writes its results to its output ports at the end of its period

7 Giotto Tasks 0510152025 P Q t A Giotto task must finish within the task’s period. The compiler uses a suitable scheduling mechanism which guarantees the deadlines. Even if P finishes its computation before the time 15 its results are buffered in P.

8 Giotto Mode §A set of concurrent Giotto tasks and mode switch predicate §Mode switch l gets evaluated periodically. l may occur in a middle of a round. Example: exitfreq 2 if (sensor1 && not(sensor2)) then Stop1(); switch predicate is evaluated every (LCM of periods of tasks/exitfreq).

9 Example: robot system Lead Follow Evade My sensor pushed Someone else’s sensor pushed My evasion finished Stop My sensor pushed Someone else’s evasion finished Someone else’s sensor pushed

10 Port Declaration const int STOP = 0; //command int com = STOP; //mode finished bool fin = TRUE; //TRUE means pushed bool sensor1; // robot 1 touch sensor bool sensor2; // robot 2 touch sensor int motorL1 = STOP; // robot 1 left motor int motorR1 = STOP; // robot 1 right motor int motorL2 = STOP; // robot 2 left motor int motorR2 = STOP; // robot 2 right motor

11 Giotto Program : mode Lead1Follow mode Lead1Follow() period 400ms entryfreq 1{ taskfreq 1 do int com = command1(); taskfreq 4 do (int motorL1, int motorR1) = motorCtr1(com); taskfreq 4 do (int motorL2, int motorR2) = motorCtr2(com); exitfreq 2 if (sensor1 && not(sensor2)) then Stop1(); exitfreq 2 if (sensor2 && not(sensor1)) then Stop2(); } 0100200300400500 command1 motorCtr1 t (ms) motorCtr2

12 Giotto Program: mode Stop1 mode Stop1() period 400ms entryfreq 2 { taskfreq 1 do int com = command1(); taskfreq 2 do (int motorL1, int motorR1) = motorCtr1(STOP); taskfreq 2 do (int motorL2, int motorR2) = motorCtr2(STOP); exitfreq 1 if (TRUE) then Evade1Stop(); } 0100200300400500 command1 motorCtr1 t (ms) motorCtr2

13 Giotto Program: mode Evade1Stop mode Evade1Stop() period 400ms entryfreq 1{ taskfreq 1 do (int com, bool fin) = evade1(); taskfreq 4 do (int motorL1, motorR1) = motorCr1(com); exitfreq 1 if (fin) then Lead1Follow(); } 0100200300400500 evade1 motorCtr1 t (ms)

14 Period and Unit 0510152025 Task P Task Q t Unit of mode : period of mode/ mode switch frequency Period of mode: period of the least frequent task in a mode Example: mode S with task P, task Q, and mode switch frequency 4 period of S: 20, unit of S:5

15 Mode Switch Example 0100200300400500 command1 motorCtr1 t (ms) motorCtr2 Mode switch 600 from Lead1Follow to Stop1from Stop1 to Evade1Stop evade1

16 Code Generation §Users provide platform-related description called annotation. §Annotation l P annotation (Platform): specifies names, IP addresses, and priorities for each host. l S annotation (Schedule): specifies task-to-host mappings and the priorities of the tasks. l C annotation (Communication): specifies port- to-network mappings and the time slots of the ports.

17 Example: P annotation (Platform) Two hosts bot1 and bot2 are connected by a network net12. [ host bot1 address 192.168.0.1 priorities p0 > p1; host bot2 address 192.168.0.2 priorities q0 > q1; net n12 address 192.168.0.0 connects bot1, bot2; ]

18 Example: S annotation (Schedule) mode Lead1Follow() period 400ms entryfreq 1{ taskfreq 1 do int com = command1(); [host bot1 priority p1] taskfreq 4 do (int motorL1, int motorR1) = motorCtr1(com); [host bot1 priority p0] taskfreq 4 do (int motorL2, int motorR2) = motorCtr2(com); [host bot2 prioty q0]... } Task command1 is mapped to host bot1 with priority p1. Task motorCtr1 is mapped to host bot1 with priority p0. Task motorCtr2 is mapped to host bot2 with priority q0.

19 Example: C annotation (Communication) mode Lead1Follow() period 400ms entryfreq 1{... [net n12 slots s0 (0,20), s1 (20,40), s2 (200,220), s3 (220,240), s4 (340, 360); push sensor1 from bot1 to bot2 in net n12 slots s0, s2; push sensor2 from bot2 to bot1 in net n12 slots s1, s3; push com from bot1 to bot2 in net n12 slots s4;] } SensorX ports are exchanged between the robots twice per round, because he mode switch predicate is evaluated every 200ms. Signals from sensor1 is delivered from bot1 to bot2. Signals from sensor2 is delivered from bot2 to bot1.

20 Putting It Together: Lead1Follow Mode with Annotation Details 0100200300400500 command1 motorCtr1 motorCtr2 com sensor2 sensor1

21 Summary: Giotto §Giotto is a design methodology for embedded control systems. §The programmer specifies the platform- independent programmer’s model in the time-triggered programming language. §The Giotto compiler produces executables combined with run-time library for a particular platform.

22 TMO (Time-triggered Message- triggered Objects) §Overview §Programming Scheme §TMOSM (TMO Support Middleware)

23 Overview: Real-Time Extension of Conventional Objects §Spontaneous Method (SpM): SpM executions are triggered when the clock reaches specific values determined at design time. §Service Method (SvM): SvM executions are triggered by service request messages. §Basic Concurrency Constraint (BCC): SpM executions have the higher priority over SvM executions. §Deadline: A deadline is associated with an output action and completion of a method.

24 Time-triggered Spontaneous Methods (SpM’s) SpM 1 SpM 2 AAC Reservation Q for t = from 10am to 10:50 am every 30 min start-during (t, t+5 min) finish-by t+10 min Example of AAC (Autonomous Activation Control) {start-during (10am, 10:05am) finish-by 10:10 am, start-during (10:30am, 10:35am) finish-by 10:40 am}

25 Programming Schme SvM 1 SvM 2 SpM 1 SpM 2 AAC Reservation Q Service request Q Object Data Store (ODS) Capabilities for accessing other TMOs, channels, and I/O devices Time-triggered spontaneous messages Message-triggered service methods

26 Example: CAMIN (Coordinated Anti-Missile Interceptor Network) Theater TMOAlien TMO

27 Example: CAMIN Theater Step 0: high-level specification of the initial application environment Step 1: high-level design of application environment such as incorporation of sensors, actuators, and control strategy ODS Theater Space = sky + land + sea Defense target in land = command post Defense target in sea = command ship (0-n) v’s Radar in land Interceptor launcher in land Fighter airplanes

28 Example (continued) SpM Update the state of the defense target in land Update the state of defense target in sea Update the state of the radar in land Update the state of the interceptor launcher in land Update the state of the fighter airplanes Accept v’s (invoked by Alien TMO) SvM

29 TMOSM (TMO Support Middleware) §A middleware architecture for TMO execution §Windows NT implementation §User-friendly C++ API called TMOSL §UDP-based communication §CORBA is also supported

30 TMOSM §Timer interrupts activate middleware thread WTST (Watchdog Timer and Scheduler Thread). §WTST: manages and scheduling and activation all other threads in TMOSM. l Allocates a time slice for every thread. l Checks for deadline violation of threads associated with each TMO’s methods. §LIIT (Local I/O Interface Thread): a periodic middleware thread processing I/O functions. §ICT (Incoming Communication Thread): a periodic middleware thread managing the distribution of messages coming through the communication network.

31 TMOSM Windows NT WTST ICT LIIT SvM thread SpM thread TMOSM TMO timer interrupt Communication Networks

32 TMOSM Scheduling Cycle LIITICTLIITICTVMST - VMST (Virtual Machine System Thread): time-slices not allocated to middleware threads are called a VMST time-slice. - A VMST time-slice is distributed to application threads associated with TMOs

33 SpM Activation §WTST periodically examines the registered SpM’s and put it to SpM reservationQ. §WTST moves a SpM to readyQ when the time for its execution arrives. §The application scheduler selects a thread from readyQ according to the scheduling policy during a time-slice for VMST.

34 SvM Execution §When receiving a service request message, ICT places an identified SvM thread to SvM waitingQ. §WTST checks for a possible conflict with SpM execution and moves it to readyQ. §The application scheduler selects a thread from readyQ according to the scheduling policy during a time-slice for VMST.

35 Other Works Related TMO §DREAM (Distributed Real-time Ever Available Microcomputing) kernel: l operating system kernel supporting real-time processes §TMOSL (TMO Support Library) l Collection of C++ classes l Interface between TMOSM and applications §CORBA-compliant TMO

36 Summary: TMO §TMO is a programming scheme based on both time-triggered and message-triggered executions. §TMO applications are distributed real-time systems.


Download ppt "Giotto and TMO Yerang Hur System Design Research Lab. Dept. of Computer and Information Science."

Similar presentations


Ads by Google