Presentation is loading. Please wait.

Presentation is loading. Please wait.

Shanna-Shaye Forbes Ben Lickly Man-Kit Leung

Similar presentations


Presentation on theme: "Shanna-Shaye Forbes Ben Lickly Man-Kit Leung"— Presentation transcript:

1 C Code Generation from the Giotto Model of Computation to the PRET Architecture
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung EE290N Course Project, Spring 2009 May 15, 2009

2 Overview Why is real-time important? PRET/Giotto Overview
Code Generation Infrastructure Approach Limitations/Future Work Elevator Controller Example

3 Motivation Timing as important as functionality
Traditional languages and architectures do not support timing on the same level as functionality. PRET and Giotto together support timing specifications and guarantees. *In real-time embedded systems it is important to guarantee correct functionality as well as timing constraints *C, the de facto programming language lacks constructs to precise timing *Most embedded processors used lack constructs to provide deterministic and precise timing *This project maps the Giotto timing semantics to a processor with direct hardware support instead of best effort attempts at timing.

4 Precision Timed Architecture
Architectural features support timing predictability Instruction set architecture includes instructions to manage timing Exception mechanism for missed deadlines

5 Giotto Giotto is a time-triggered language for embedded programming.
Ideal for hard real-time applications with time- periodic and multimodal behavior. It specifies time-triggered sensor readings, task invocations, actuator updates, and mode switches independent of any implementation platform. Unit delay in task communication Tasks communicate through ports Drivers move input values from ports to inputs at the beginning of a task’s execution Drivers move input values from outputs to ports at the end of a task’s execution

6 Giotto in Ptolemy II Each actor is a separate task.
Period/frequency specified with attributes. Models can be composed hierarchically, with modes represented through modal models. - Each actor is a separate task. This means unit delays between all actors - Period/frequency is the logical execution time of a task -Models can be composed hierarchically, with modal models. Both Giotto and heterogeneous models Actors at the same level of hierarchy are executing concurrently. The modal model contains the tasks that are to be swapped out in a given mode switch.

7 Extending the Ptolemy II CodeGenration Framework
Continued extension

8 Ptolemy II Code Generation
Ptolemy II has an adapter based extensible code generation framework. We have continued this extension to support Giotto and PRET. * Adapters are component code generators so that we can easily custimize our own.

9 Mapping from Giotto to PRET
Each Giotto task is mapped to a separate hardware thread. Threads communicate through shared memory. Input and output drivers are responsible for moving data. PRET’s timing instructions detect errors when deadlines are missed. - Each actor governed by a Giotto director is mapped to it’s own hardware thread on PRET. - We use shared memory as port locations to communicate between hardware threads - Drivers read a value from a port at the beginning of a period and write output values to ports at the end of the period. - Period/frequency is the logical execution time of a task - We use PRET’s Try in instruction to determine when an overrun of the specified deadline occurs - Currently the try In exception mechanism forces all threads to halt their execution and exits with the interpretation that a fatal error has occurred.

10 Limitations/Future Work
Giotto does not specify error behavior. We assume errors are fatal. This approach is tied to a PRET architecture. Fixed number of hardware threads in PRET. ** In pacemaker or other realtime examples, graceful failure behavior is very important. Hierarchy in Ptolemy II enables expressiveness the code generator adapter must also replicate. --- can’t support Giotto inside a modal model right now(move this to the notes slide though… in case someone asks)

11 Elevator Controller Example
Run in the PRET simulator so we provided inputs/elevator requests as sequences to the elevator controller.

12 The composite actor on the left provides a top level shell for the sequence inputs provided to the elevator controller. Elevator Controller is for a simple two story elevator. We will show the refinement on the next slide

13

14 Generated Code Example
Actor -> task

15 Summary Ptolemy II allows simulation of timed models of computation.
Generated code uses timing instructions of the target architecture to preserve these timing semantics. Provided a possible programming model for a new timed architecture. Code Generation support for a model of computation with timing specifications. Ptolemy II allows you to simulate your model, our project allows you to generate C code from the model and run in on a processor with direct support for timing in its ISA. Provided a possible programming model for a new timed architecture.

16 Questions? Comments? Suggestions?


Download ppt "Shanna-Shaye Forbes Ben Lickly Man-Kit Leung"

Similar presentations


Ads by Google