Presentation is loading. Please wait.

Presentation is loading. Please wait.

Retargetable Model-Based Code Generation in Ptolemy II

Similar presentations


Presentation on theme: "Retargetable Model-Based Code Generation in Ptolemy II"— Presentation transcript:

1 Retargetable Model-Based Code Generation in Ptolemy II
Man-Kit Leung, Tony Huang, Christopher Brooks, Prof. Edward A. Lee Retargetable Model-Based Code Generation in Ptolemy II Eighth Biennial Ptolemy Miniconference 2009 Starmac Quadrotor Continuous-time system model of the Starmac dynamics and control, built using Ptolemy II. Mission This research investigates the infrastructure of a retargetable and domain-general C code generator for actor models and use the code generator to program different platforms. The main mission is to carefully transform and compile models specified in formal models of computation (MoCs). Retargetability One very desireable property of the code generator is its ability to generate code for multiple targets. C code generation differs from traditional compiler backend in that software libraries and API’s are also considered targetable. Domain Generality The code generator provides an interface for various models of specification. These specification languages are often tailored for the application domains which relies on properties and analyzability of the language. In Ptolemy II, we called these MoCs. The code generator is designed to interface with different MoCs and nicely reuse the software components for handling heterogeneous models. The Generation Process Front-end - interface with Ptolemy model components (directors, actors, and etc.). Middle-end - analyses or partial evaluations that can be performed to optimize the generated code. Back-end - interface with different targets (HW platforms + SW API's). Various techniques are employed, including composition of partial-evaluated results. We use an adaptor pattern that associates meta code and a target code template with model component. We use type polymorphism to specialize the generated function code while retaining software resue. CT + SR Software synthesis is the key component in the correct-by-construction theory. It bridges the gap between the simulation environment and implementation code. It allows rapid experimentation and shortens the development cycle. PN + SDF + FSM This is an example heterogeneous model. The top-level is modeled as a Kahn Process Network (PN) that contains two hierarchical components (Actor1 and Actor2) which in turn contain refinement models. Since actors directed by PN are executed in separate threads of execution, we can gain speedup from executing them on parallel architectures. MPI (Nersc Supercomputer) MoCs Process Networks (PN) Synchronous/Reactive (SR) Time-Triggered (TT, Giotto) Discrete Events (DE) Synchronous Dataflow (SDF) Continuous Time (CT) Finite State Machine (FSM) Rendezvous … and more Acknowledgements This work was supported in part by the Center for Hybrid and Embedded Software Systems (CHESS) at UC Berkeley, which receives support from the National Science Foundation (NSF awards # (CSR-EHS: PRET) and # (CSR-CPS)), the U. S. Army Research Office (ARO #W911NF ), the U. S. Air Force Office of Scientific Research (MURI #FA ), the Air Force Research Lab (AFRL), the State of California Micro Program, and the following companies: Agilent, Bosch, Lockheed-Martin, National Instruments, and Toyota. The heterogeneity of MoCs is accomplished through hierarchical composition. Luminary i-Robot Create Composing PN with other MoCs give us good tools in managing and reasoning concurrency. For example, By composing PN, SDF and FSM, we effectively control concurrency while retaining determinacy and understandability in the subcomponents.. Current Work Target code generation for the Synchronous/Reactive (SR) domain for general platforms. Target code generation for Giotto, a time triggered MoC, with the OpenRTOS and PRET platforms. Research into generalizing the relationship and descriptions of different targets. The model specifies the control logic for the iRobot Roomba. The controller combines together the SDF and FSM domains. November 18, 2018 Center for Hybrid and Embedded Software Systems


Download ppt "Retargetable Model-Based Code Generation in Ptolemy II"

Similar presentations


Ads by Google