ACM SIGPLAN 2001 Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES'2001) Jun 22-23, 2001, Snowbird, Utah, USA Embedded Software from.

Slides:



Advertisements
Similar presentations
Rule Based Operational Semantics Specification in Ptolemy Yanwar Asrigo COMP 763B - Modeling and Simulation Based Design 30 th April 2008.
Advertisements

A code generator for the CAL actor language Lars Wernli Supervisor: Joern Janneck, UC Berkeley Professor: Lothar Thiele, ETH Zuerich.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
UC Berkeley Mobies Technology Project PI: Edward Lee CoPI: Tom Henzinger Process-Based Software Components for Networked Embedded Systems.
Mobies Phase 1 UC Berkeley 1 Process-Based Software Components Mobies Phase 1, UC Berkeley Edward A. Lee and Tom Henzinger PI Meeting, New York July 24,
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Process-Based Software Components for Networked Embedded Systems Edward A. Lee, PI UC Berkeley Core Technical Team (Mobies, SEC, and GSRC): Christopher.
Component Technologies for Embedded Systems Johan Eker.
SRC ETAB Summer Study Colorado Springs, June 25-26, 2001 Model-Based Approaches to Embedded Software Design Edward A. Lee UC Berkeley & GSRC.
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 Java Code Generation Steve Neuendorffer UC Berkeley.
Advanced Tool Architectures Supporting Interface-Based Design
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
Mobies Phase 1 UC Berkeley 1 Agenda 8:00-8:30 Continental breakfast 8:30-9:00 Overview of Mobies Phase 1 effort (Edward A. Lee) 9:00-9:40 Introduction.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Leveraging Synchronous Language Principles for Hybrid System Models Haiyang Zheng and.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Behavioral Types for Actor-Oriented Design Edward A. Lee.
Behavioral Types as Interface Definitions for Concurrent Components Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley.
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
Ptolemy II - Heterogeneous Modeling and Design in Java The Ptolemy project studies modeling, simulation, and design of concurrent, real-time, embedded.
Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun.
Chess Review October 4, 2006 Alexandria, VA Edited and presented by Advanced Tool Architectures Edward A. Lee UC Berkeley.
Chess Review November 21, 2005 Berkeley, CA Edited and presented by Advanced Tool Architectures Edward A. Lee UC Berkeley.
Heterogeneous Modeling and Design in Ptolemy II Johan Eker UC Berkeley with material courtesy of Edward Lee and the Ptolemy group ECE Seminar Series, Carnegie.
Modeling Heterogeneous Systems Edward Lee UC Berkeley Design for Safety Workshop NASA Ames Research Center Mountain View, CA 11 October, Design.
Mobies Phase 1 UC Berkeley 1 Process-Based Software Components Mobies Phase 1, UC Berkeley Edward A. Lee and Tom Henzinger PI Meeting, Boca Raton January.
Review of “Embedded Software” by E.A. Lee Katherine Barrow Vladimir Jakobac.
Actor-Oriented Design: A focus on domain-specific languages for embedded systems Edward A. Lee Professor, UC Berkeley Director, Center for Hybrid and Embedded.
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
An Extensible Type System for Component-Based Design
Mixing Models of Computation Jie Liu Palo Alto Research Center (PARC) 3333 Coyote Hill Rd., Palo Alto, CA joint work with Prof. Edward.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
Models of Computation for Embedded System Design Alvise Bonivento.
MoBIES PI-Meeting, July 2001, Jackson Hole Controller Design Using Multiple Models of Computation Edward Lee Johan Eker with thanks to Paul Griffiths,
Hierarchical Reconfiguration of Dataflow Graphs Stephen Neuendorffer UC Berkeley Poster Preview May 10, 2004.
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
Heterochronous Dataflow in Ptolemy II Brian K. Vogel EE249 Project Presentation, Dec. 4, 1999.
SEC PI Meeting Annapolis, May 8-9, 2001 Component-Based Design of Embedded Control Systems Edward A. Lee & Jie Liu UC Berkeley with thanks to the entire.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley System-Level Types for Component-Based Design Edward A.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Concurrent Component Patterns, Models of Computation, and.
February 12, 2009 Center for Hybrid and Embedded Software Systems Model Transformation Using ERG Controller Thomas H. Feng.
MoBIES Working group meeting, September 2001, Dearborn Ptolemy II The automotive challenge problems version 4.1 Johan Eker Edward Lee with thanks.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 PTIDES: A Programming Model for Time- Synchronized Distributed Real-time Systems Yang.
The Caltrop Actor Language Johan Eker UC Berkeley MoBIES group, Carnegie Mellon, November 30, 2001.
Concurrent Models of Computation in System Level Design Edward Lee UC Berkeley Forum on Design Languages Workshop on System Specification & Design Languages.
State of the Art Lecture IEEE Instrumentation and Measurement Technology Conference Budapest, Hungary, May 21-23, 2001 Computing for Embedded Systems Edward.
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 The Component Interaction Domain: Modeling Event-Driven and Demand- Driven Applications.
Embedded Software Challenges for the Next 10 Years Chess: Center for Hybrid and Embedded Software Systems Infineon Embedded Software Days Munich, Sept.
Panel: What Comes After C++ in System-Level Specification Edward Lee UC Berkeley Forum on Design Languages Workshop on System Specification & Design Languages.
Lee & Henzinger ESWG #1 UC Berkeley Mobies Technology Project Process-Based Software Components for Networked Embedded Systems PI: Edward Lee CoPI: Tom.
MOBIES Project Progress Report Engine Throttle Controller Design Using Multiple Models of Computation Edward Lee Haiyang Zheng with thanks to Ptolemy Group.
Model-Driven Development From Object-Oriented Design to Actor-Oriented Design Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor.
System-Level Types for Component-Based Design Paper by: Edward A. Lee and Yuhong Xiong Presentation by: Dan Patterson.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley The Ptolemy II Framework for Visual Languages Xiaojun Liu.
Composing Models of Computation in Kepler/Ptolemy II
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Design Languages in 2010 Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley Panel Position Statement Forum on Design.
Actor Networks Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley Invited Talk Workshop Foundations and Applications of Component-based.
Ptolemy & Models of Computation -by Hao Chen, Zhuang Fan, Jin Xiao School of Computer Science University of Waterloo Claudius Ptolemaeus, the second century.
Actor Oriented Programming with CAL -designing embedded system components Johan Eker Department of Automatic Control, Lund University Chris Chang, Jörn.
What’s Ahead for Embedded Software? (Wed) Gilsoo Kim
CS 5991 Presentation Ptolemy: A Framework For Simulating and Prototyping Heterogeneous Systems.
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Code Generation for Ptolemy II
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Retargetable Model-Based Code Generation in Ptolemy II
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Presentation transcript:

ACM SIGPLAN 2001 Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES'2001) Jun 22-23, 2001, Snowbird, Utah, USA Embedded Software from Concurrent Component Models Edward A. Lee UC Berkeley with Shuvra Bhattacharyya, Johan Eker, Christopher Hylands, Jie Liu, Xiaojun Liu, Steve Neuendorffer, Jeff Tsay, and Yuhong Xiong

E. A. Lee, Berkeley, 2 View of SW Architecture: Actors with Ports and Attributes Model of Computation: Messaging schema Flow of control Concurrency Examples: Time triggered Process networks Discrete-event systems Dataflow systems Publish & subscribe Key idea: The model of computation is part of the framework within which components are embedded not part of the components themselves.

E. A. Lee, Berkeley, 3 Actor View of Producer/Consumer Components Models of Computation: continuous-time dataflow rendezvous discrete events synchronous time-driven publish/subscribe …

E. A. Lee, Berkeley, 4 Examples of Actors+Ports Software Architectures Simulink (The MathWorks) Labview (National Instruments) OCP, open control platform (Boeing) SPW, signal processing worksystem (Cadence) System studio (Synopsys) ROOM, real-time object-oriented modeling (Rational) Port-based objects (U of Maryland) I/O automata (MIT) VHDL, Verilog, SystemC (Various) Polis & Metropolis (UC Berkeley) Ptolemy & Ptolemy II (UC Berkeley) …

E. A. Lee, Berkeley, 5 What a Program Looks Like Ptolemy II model of an embedded control system and the system being controlled. This is a hierarchical, heterogeneous model that combines four models of computation. Model by Johan Eker

E. A. Lee, Berkeley, 6 Contrast with Object Orientation Call/return imperative semantics band-aids: futures, proxies, monitors Poorly models the environment which does not have call/return semantics Concurrency is via ad-hoc calling conventions Nothing at all to say about time Object modeling emphasizes inheritance and procedural interfaces. Actor modeling emphasizes concurrency and communication abstractions.

E. A. Lee, Berkeley, 7 Hierarchy and Heterogeneity 1 Modal Models Model by Johan Eker

E. A. Lee, Berkeley, 8 Domains Each level of the hierarchy may have its own “laws of physics” communication semantics flow of control constraints Domain a region of the universe where a certain set of “laws of physics” applies Realizes a “model of computation”

E. A. Lee, Berkeley, 9 A Problem: Compiling these Models: “Code generation”

E. A. Lee, Berkeley, 10 Outline of our Approach Domain semantics defines communication, flow of control Ptolemy II model scheduler Schedule: - fire Gaussian0 - fire Ramp1 - fire Sine2 - fire AddSubtract5 - fire SequenceScope10 parser method call if block method call block … for (int i = 0; i < plus.getWidth(); i++) { if (plus.hasToken(i)) { if (sum == null) { sum = plus.get(i); } else { sum = sum.add(plus.get(i)); } … All actors are given in Java, then translated to embedded Java, C, VHDL, etc. target code abstract syntax tree Jeff Tsay, Christopher Hylands, Steve Neuendorffer

E. A. Lee, Berkeley, 11 Division of Responsibility Domain semantics defines flow of control across actors communication protocols between actors Actors define: functionality of components Hierarchy: Code generation at a level of the hierarchy produces a new actor definition Multiple domains may be used in the same model

E. A. Lee, Berkeley, 12 Software Basis Build on: First version on Titanium (UC Berkeley) Second version on Soot (McGill) Targeting: Simulation acceleration Embedded software synthesis Configurable hardware synthesis

E. A. Lee, Berkeley, 13 Our Generator Approach Actor libraries are built and maintained in Java more maintainable, easier to write polymorphic libraries are rich and small Java + Domain translates to target language concurrent and imperative semantics Efficiency gotten through code transformations specialization of polymorphic types code substitution using domain semantics removal of unnecessary code

E. A. Lee, Berkeley, 14 Code transformations (data types) // Original actor source Token t1 = in.get(0); Token t2 = in.get(1); out.send(0, t1.multiply(t2)); specialization of Token declarations // With specialized types IntMatrixToken t1 = in.get(0); IntMatrixToken t2 = in.get(1); out.send(0, t1.multiply(t2)); The Ptolemy II type system supports polymorphic actors with propagating type constraints and static type resolution. The resolved types can be used in optimized generated code. See Jeff Tsay, A Code Generation Framework for Ptolemy II

E. A. Lee, Berkeley, 15 Type System Output of type general - pure event with no value Input of general type - anything will do Polymorphic output - type depends on the parameters double general int general double Polymorphic actor uses late binding in Java to determine implementation of addition. Opaque port - types propagated from inside double Lossless runtime type conversion Type system by Yuhong Xiong

E. A. Lee, Berkeley, 16 Type System Extensible type lattice Unification infrastructure Finds a least fixed point Composite types records, arrays, matrices Higher-order types planned Experiments with dependent types encoding domain constraints

E. A. Lee, Berkeley, 17 Code transformations (domains) transformation using domain semantics // With specialized types IntMatrixToken t1 = in.get(0); IntMatrixToken t2 = in.get(1); out.send(0, t1.multiply(t2)); Domain-polymorphic code is replaced with specialized code. // Extended Java with specialized communication int[][] t1 = _inbuf[0][_inOffset = (_inOffset+1)%5]; int[][] t2 = _inbuf[1][_inOffset = (_inOffset+1)%5]; _outbuf[_outOffset = (_outOffset+1)%8] = t1 * t2; See Jeff Tsay, A Code Generation Framework for Ptolemy II

E. A. Lee, Berkeley, 18 Synchronous Dataflow (SDF) Domain Balance equations (one for each channel): F A N = F B M Scheduled statically Decidable resource requirements Available optimizations: eliminate checks for input data statically allocate communication buffers statically sequence actor invocations (and inline?) send(0,t) get(0) token t NM A B

E. A. Lee, Berkeley, 19 Synchronous/Reactive Domain A discrete model of time progresses as a sequence of “ticks.” At a tick, the signals are defined by a fixed point equation: A C B Available optimizations: Statically sequence fixed-point iteration Communication via registers

E. A. Lee, Berkeley, 20 Other Domains with Useful Properties for Code Generation Strong static analyzability Giotto (time triggered) Finite state machines Discrete time Good for hardware descriptions Discrete events Process networks Continuous time (analog hardware)

E. A. Lee, Berkeley, 21 Hierarchical Heterogeneity P6 P3 P2 P5 P1 E1 E2 E4 E0 M: Manager D1: local director D2: local director P4 P7 E3 E5 Opaque Composite Actor Transparent Composite Actor Ptolemy II composes domains hierarchically, where components in a model can be refined into subcomponents where the component interactions follow distinct semantics.

E. A. Lee, Berkeley, 22 Hierarchical Code Generation atomic actor definition

E. A. Lee, Berkeley, 23 Basic Object Model for Executable Components

E. A. Lee, Berkeley, 24 Abstract Semantics – How Components Interact flow of control Initialization Execution Finalization communication Structure of signals Send/receive protocols

E. A. Lee, Berkeley, 25 Abstract Semantics – How Components Interact flow of control Initialization Execution Finalization communication Structure of signals Send/receive protocols preinitialize() declare static information, like type constraints, scheduling properties, temporal properties, structural elaboration initialize() initialize variables

E. A. Lee, Berkeley, 26 Abstract Semantics – How Components Interact flow of control Initialization Execution Finalization communication Structure of signals Send/receive protocols iterate()

E. A. Lee, Berkeley, 27 Abstract Semantics – How Components Interact flow of control Initialization Execution Finalization communication Structure of signals Send/receive protocols iterate() prefire() fire() postfire() stopFire()

E. A. Lee, Berkeley, 28 The Key Action Methods Prefire() obtain required resources may read inputs may start computations returns a boolean indicating readiness Fire() produces results Postfire() commits state updates (transactional) StopFire() request premature termination All of these are atomic (non-preemptible)

E. A. Lee, Berkeley, 29 Benefits Composable semantics arbitrarily deep hierarchies heterogeneous hierarchies controller plant actuator dynamics sensor task1 task2 TTA Hierarchical, heterogeneous, system-level model

E. A. Lee, Berkeley, 30 This Abstract Semantics has Worked For Continuous-time models Finite state machines Dataflow Discrete-event systems Synchronous/reactive systems Time-driven models (Giotto) … We can even make it work for priority-driven multitasking (RTOS style)! Hybrid systems

E. A. Lee, Berkeley, 31 A Twist: Threaded Models The Precise Mode Change Problem How do you get the processes to a quiescent state to take a mode change? thread or process Problem posed by Boeing

E. A. Lee, Berkeley, 32 HPM Domain Hierarchical Preemptive Multitasking Objective: support priority-driven preemptive scheduling use atomic execution, to get composability solve the precise mode change problem make behavior (more) deterministic Solution: Atomic execution when possible Façade to long-running processes when not Split phase execution (read phase, write phase) Domain by Jie Liu

E. A. Lee, Berkeley, 33 Atomic Façade to Long-Running Computations Each component defines the interaction between the atomic façade and the long- running process. There are several useful patterns: allow task to complete enforce declared timing “anytime” computation transactional produce outputs read inputs commit state

E. A. Lee, Berkeley, 34 Inter-domain example: Shared-resource controllers plant1 plant2 computer controller1 controller2 Model by Jie Liu

E. A. Lee, Berkeley, 35 Conclusion Systematic, principled, real-time, heterogeneous, hierarchical composition of: Processes and/or threads Finite automata (mode controllers) Other models of computation Continuous-time models Dataflow models … Code generation The key is the abstract semantics of Ptolemy II, which defines hierarchical heterogeneous composition of models of computation.