Ptolemy Project 1 Streaming Models of Computation in The Ptolemy Project Edward A. Lee Professor UC Berkeley Workshop on Streaming Systems, Endicott House,

Slides:



Advertisements
Similar presentations
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e.
Advertisements

DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Discrete Event Models: Getting the Semantics Right Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley With thanks to Xioajun.
ACM SIGPLAN 2001 Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES'2001) Jun 22-23, 2001, Snowbird, Utah, USA Embedded Software from.
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.
Overview of Ptolemy II Edward A. Lee Professor UC Berkeley October 9, 2003.
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.
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.
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.
Ptolemy Miniconference May 9, 2003 Berkeley, CA Ptolemy Project Status and Overview Edward A. Lee Professor Ptolemy Project Director.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
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.
6th Biennial Ptolemy Miniconference Berkeley, CA May 12, 2005 Ptolemy Project Status and Overview Edward A. Lee Ptolemy Project Director, UC Berkeley.
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.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
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.
Model-Based Design in the Ptolemy Project A Chess Project Center for Hybrid and Embedded Software Systems Edward A. Lee UC Berkeley Presented at Boeing,
Mixing Models of Computation Jie Liu Palo Alto Research Center (PARC) 3333 Coyote Hill Rd., Palo Alto, CA joint work with Prof. Edward.
Dataflow Process Networks Lee & Parks Synchronous Dataflow Lee & Messerschmitt Abhijit Davare Nathan Kitchen.
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.
Discrete Event Models: Getting the Semantics Right Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley With special thanks.
Balancing Expressiveness and Analyzability in Stream Formalisms Edward A. Lee Robert S. Pepper Distinguished Professor EECS Department, UC Berkeley Invited.
MoBIES PI-Meeting, July 2001, Jackson Hole Controller Design Using Multiple Models of Computation Edward Lee Johan Eker with thanks to Paul Griffiths,
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 Concurrent Component Patterns, Models of Computation, and.
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.
Process-Based Software Components Final Mobies Presentation Edward A. Lee Professor UC Berkeley PI Meeting, Savannah, GA January 21-23, 2004 PI: Edward.
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.
Embedded Software: Leveraging Concurrent Models of Computation Edward A. Lee Professor, UC Berkeley Center for Hybrid and Embedded Software Systems (CHESS)
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.
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.
Concurrent Models of Computation Edward A. Lee Professor, UC Berkeley Ptolemy Project CHESS: Center for Hybrid and Embedded Software Systems HP Workshop.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley The Ptolemy II Framework for Visual Languages Xiaojun Liu.
An Overview of the Ptolemy Project and Actor-Oriented Design Edward A. Lee Professor UC Berkeley Center for Hybrid and embedded software systems OMG Technical.
Voicu Groza, 2008 SITE, HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS Hardware/Software Codesign of Embedded Systems Voicu Groza SITE Hall, Room.
Composing Models of Computation in Kepler/Ptolemy II
C. André, J. Boucaron, A. Coadou, J. DeAntoni,
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.
T imed Languages for Embedded Software Ethan Jackson Advisor: Dr. Janos Szitpanovits Institute for Software Integrated Systems Vanderbilt University.
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Concurrent Models of Computation
Code Generation for Ptolemy II
Retargetable Model-Based Code Generation in Ptolemy II
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Concurrent Models of Computation
Embedded Systems: A Focus on Time
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Presentation transcript:

Ptolemy Project 1 Streaming Models of Computation in The Ptolemy Project Edward A. Lee Professor UC Berkeley Workshop on Streaming Systems, Endicott House, Dedham, MA August 22-23, 2003

Ptolemy Project, Lee, Berkeley 2 Ptolemy Project Participants Director: Edward A. LeeEdward A. LeeStaff: Christopher HylandsChristopher Hylands Susan Gardner (Chess)Susan Gardner (Chess) Nuala MansardNuala Mansard Mary P. StewartMary P. Stewart Neil E. Turner (Chess)Neil E. Turner (Chess) Lea Turpin (Chess)Lea Turpin (Chess) Postdocs, Etc.: Joern Janneck, PostdocJoern Janneck, Postdoc Rowland R. Johnson, Visiting ScholarRowland R. Johnson, Visiting Scholar Kees Vissers, Visiting Industrial FellowKees Vissers, Visiting Industrial Fellow Daniel Lázaro Cuadrado, Visiting ScholarDaniel Lázaro Cuadrado, Visiting Scholar Graduate Students: J. Adam CataldoJ. Adam Cataldo Chris ChangChris Chang Elaine CheongElaine Cheong Sanjeev KohliSanjeev Kohli Xiaojun LiuXiaojun Liu Eleftherios D. MatsikoudisEleftherios D. Matsikoudis Stephen NeuendorfferStephen Neuendorffer James YehJames Yeh Yang ZhaoYang Zhao Haiyang ZhengHaiyang Zheng Rachel ZhouRachel Zhou

Ptolemy Project, Lee, Berkeley 3 At Work in the Chess Software Lab Chess = Center for Hybrid and Embedded Software Systems

Ptolemy Project, Lee, Berkeley 4 Software Legacy of the Project Gabriel ( ) –Written in Lisp –Aimed at signal processing –Synchronous dataflow (SDF) block diagrams –Parallel schedulers –Code generators for DSPs –Hardware/software co-simulators Ptolemy Classic ( ) –Written in C++ –Multiple models of computation –Hierarchical heterogeneity –Dataflow variants: BDF, DDF, PN –C/VHDL/DSP code generators –Optimizing SDF schedulers –Higher-order components Ptolemy II ( ) –Written in Java –Domain polymorphism –Multithreaded –Network integrated and distributed –Modal models –Sophisticated type system –CT, HDF, CI, GR, etc. Each of these served us, first-and- foremost, as a laboratory for investigating design. PtPlot (1997-??) –Java plotting package Tycho ( ) –Itcl/Tk GUI framework Diva ( ) –Java GUI framework Focus has always been on embedded software.

Ptolemy Project, Lee, Berkeley 5 Ptolemy Classic Example From 1995 (adaptive nulling in an antenna array) Ptolemy application developed by Uwe Trautwein, Technical University of Ilmenau, Germany streams hierarchical comonents

Ptolemy Project, Lee, Berkeley 6 Ptolemy II Ptolemy II: Our current framework for experimentation with actor- oriented design, concurrent semantics, visual syntaxes, and hierarchical, heterogeneous design. Hierarchical component modal model dataflow controller example Ptolemy II model: hybrid control system

Ptolemy Project, Lee, Berkeley 7 Actor-Oriented Design Actors with Ports and Attributes Model of Computation: Messaging schema Flow of control Concurrency Examples: Dataflow Process networks Synchronous Time triggered Discrete-event systems Publish & subscribe Most Ptolemy II models of computation are “actor oriented.” But the precise semantics depends on the selected “director,” which implements a model of computation. called a “kernel,” “step,” …

Ptolemy Project, Lee, Berkeley 8 Other Examples of Actor-Oriented Component Frameworks Simulink (The MathWorks) Labview (National Instruments) Modelica (Linkoping) OCP, open control platform (Boeing) GME, actor-oriented meta-modeling (Vanderbilt) SPW, signal processing worksystem (Cadence) System studio (Synopsys) ROOM, real-time object-oriented modeling (Rational) Easy5 (Boeing) Port-based objects (U of Maryland) I/O automata (MIT) VHDL, Verilog, SystemC (Various) Polis & Metropolis (UC Berkeley) … Unlike Ptolemy II, all of these define a fixed model of computation.

Ptolemy Project, Lee, Berkeley 9 Ptolemy Project Principle Director from a library defines component interaction semantics Large, domain-polymorphic component library. Example of Ptolemy II model: The model of computation is not built in to the software framework.

Ptolemy Project, Lee, Berkeley 10 Actor View of Producer/Consumer Components Models of Computation are implemented in Ptolemy II by a “director” and a “receiver” (which is supplied by the director). Examples we have built: dataflow (several variants) process networks push/pull continuous-time CSP (rendezvous) discrete events synchronous time-driven publish/subscribe … Ptolemy II uses the object-oriented principle of polymorphism to realize multiple actor-oriented models of computation.

Ptolemy Project, Lee, Berkeley 11 Focus on Dataflow (a few variants) Computation graphs [Karp & Miller ] Process networks [Kahn ] Static dataflow [Dennis ] Dynamic dataflow [Arvind, 1981] K-bounded loops [Culler, 1986] Synchronous dataflow [Lee & Messerschmitt, 1986] Structured dataflow [Kodosky, 1986] PGM: Processing Graph Method [Kaplan, 1987] Synchronous languages [Lustre, Signal, 1980’s] Well-behaved dataflow [Gao, 1992] Boolean dataflow [Buck and Lee, 1993] Multidimensional SDF [Lee, 1993] Cyclo-static dataflow [Lauwereins, 1994] Integer dataflow [Buck, 1994] Bounded dynamic dataflow [Lee and Parks, 1995] Heterochronous dataflow [Girault, Lee, & Lee, 1997] … Many tools, software frameworks, and hardware architectures have been built to support one or more of these.

Ptolemy Project, Lee, Berkeley 12 Synchronous Dataflow (SDF) (Lee and Messerschmitt, 1986) SDF offers feedback, multirate, static scheduling, deadlock analysis, parallel scheduling, static memory allocation. SDF director

Ptolemy Project, Lee, Berkeley 13 Synchronous Dataflow (SDF) Fixed Production/Consumption Rates Balance equations (one for each channel): Schedulable statically Decidable: buffer memory requirements deadlock fire B { … consume M … } fire A { … produce N … } channel NM number of tokens consumed number of firings per “iteration” number of tokens produced

Ptolemy Project, Lee, Berkeley 14 Parallel Scheduling of SDF Models A C D B SequentialParallel SDF is suitable for automated mapping onto parallel processors and synthesis of parallel circuits. Many scheduling optimization problems can be formulated. Some can be solved, too!

Ptolemy Project, Lee, Berkeley 15 Selected Generalizations Multidimensional Synchronous Dataflow (1993) –Arcs carry multidimensional streams –One balance equation per dimension per arc Cyclo-Static Dataflow (Lauwereins, et al., 1994) –Periodically varying production/consumption rates Boolean & Integer Dataflow (1993/4) –Balance equations are solved symbolically –Permits data-dependent routing of tokens –Heuristic-based scheduling (undecidable) Dynamic Dataflow (1981-) –Firings scheduled at run time –Challenge: maintain bounded memory, deadlock freedom, liveness –Demand driven, data driven, and fair policies all fail Kahn Process Networks (1974-) –Replace discrete firings with process suspension –Challenge: maintain bounded memory, deadlock freedom, liveness Heterochronous Dataflow (1997) –Combines state machines with SDF graphs –Very expressive, yet decidable

Ptolemy Project, Lee, Berkeley 16 Multidimensional SDF (Lee, 1993) Production and consumption of N- dimensional arrays of data: Balance equations and scheduling policies generalize. Much more data parallelism is exposed. (40, 48) (8, 8) Similar (but dynamic) multidimensional streams have been implemented in Lucid.

Ptolemy Project, Lee, Berkeley 17 MDSDF Structure Exposes Fine-Grain Data Parallelism However, such programs are extremely hard to write (and to read).

Ptolemy Project, Lee, Berkeley 18 Cyclostatic Dataflow (CSDF) (Lauwereins et al., TU Leuven, 1994) Actors cycle through a regular production/consumption pattern. Balance equations become: fire B { … consume M … } fire A { … produce … } channel cyclic production pattern

Ptolemy Project, Lee, Berkeley 19 Boolean and Integer Dataflow (BDF, IDF) (Lee and Buck, 1993) Balance equations are solved symbolically in terms of unknowns that become known at run time. An annotated schedule is constructed with predicates guarding each action. Existence of such an annotated schedule is undecidable (as is deadlock & bounded memory) Production rate is unknown and is represented symbolically by a variable (b). B select switch b 1 b1 b b 1 b1 b A C D E b

Ptolemy Project, Lee, Berkeley 20 Dynamic Dataflow (DDF) Actors have firing rules –Set of finite prefixes on input sequences –For determinism: No two such prefixes are joinable under a prefix order –Firing function applied to finite prefixes yield finite outputs Scheduling objectives: –Do not stop if there are executable actors –Execute in bounded memory if this is possible –Maintain determinacy if possible Policies that fail: –Data-driven execution –Demand-driven execution –Fair execution –Many balanced data/demand-driven strategies Policy that succeeds (Parks 1995): –Execute with bounded buffers –Increase bounds only when deadlock occurs DDF, like BDF and IDF is undecidable (deadlock, bounded memory, schedule)

Ptolemy Project, Lee, Berkeley 21 Dynamic Dataflow and Process Networks are Formally Similar, Practically Different OEP problem under DARPA MoBIES (Model- based design of embedded software), Example from signal intelligence: Detection of unknown signal (PSK in this case) Output data sequence, at detected baud rate. (not known apriori) First Symbol Expected Symbol Drift caused by error in estimation

Ptolemy Project, Lee, Berkeley 22 Undecidability (Buck ’93) Sufficient set of actors for undecidability: –boolean functions on boolean tokens –switch and select –initial tokens on arcs Undecidable: –deadlock –bounded buffer memory –existence of an annotated schedule boolean function select switch initial token b 1  b b BDF, IDF, DDF, and PN are all undecidable in this sense. Fortunately, we can identify a large decidable subset, which we call heterochronous dataflow (HDF). T F T F

Ptolemy Project, Lee, Berkeley 23 Example of a Heterochronous Dataflow (HDF) Model An actor consists of a state machine and refinements to the states that define behavior.

Ptolemy Project, Lee, Berkeley 24 Heterochronous Dataflow (HDF) (Girault, Lee, and Lee, 1997) An interconnection of actors. An actor is either SDF or HDF. If HDF, then the actor has: –a state machine –a refinement for each state –where the refinement is an SDF or HDF actor Operational semantics: –with the state of each state machine fixed, graph is SDF –in the initial state, execute one complete SDF iteration –evaluate guards and allow state transitions –in the new state, execute one complete SDF iteration HDF is decidable –but complexity can be high

Ptolemy Project, Lee, Berkeley 25 Other Stream-Like Models of Computation (all implemented in Ptolemy II) Push/Pull –dataflow with disciplined nondeterminism –e.g. Click (Kohler, 2001) Discrete events –data tokens have time stamps –e.g. NS Continuous time –streams are a continuum of values –e.g. Simulink Synchronous languages –sequence of values, one per clock tick –fixed-point semantics –e.g. Esterel Time triggered –similar, but no fixed-point semantics –e.g. Giotto Modal models –state machines + stream-like MoCs, hierarchical –e.g. Hybrid systems all of these include a logical notion of time

Ptolemy Project, Lee, Berkeley 26 Discrete-Event Models Example: Sensor Nets Modeling Ptolemy II model of a sensor net using discrete- event communication where connectivity is determined by proximity. This model shows the results of a power optimization where the green node issues a broadcast signal and the red ones retransmit to relay the signal.

Ptolemy Project, Lee, Berkeley 27 Continuous-Time Models Example: Soft Walls Avionics System aircraft model criticality calculation pilot model bias control the wall Analog Computers!

Ptolemy Project, Lee, Berkeley 28 Modal Models Example: Hybrid Systems Hybrid systems are hierarchical combinations of continuous-time models and state machines.

Ptolemy Project, Lee, Berkeley 29 Heterogeneous Models Modal models are one example of a family of hierarchically heterogeneous models, where diverse models of computation are combined in a hierarchy.

Ptolemy Project, Lee, Berkeley 30 Heterogeneous Models: Periodic/Time-Driven Example: Control Inside Continuous Time Giotto director indicates a periodic, time-driven model of computation. Domain-polymorphic component. CT director indicates a continuous time model of computation.

Ptolemy Project, Lee, Berkeley 31 Heterogeneous Modal Models Example: Modal Control System Periodic, time-driven tasks Modes (normal & faulty) Controller task is a dataflow model

Ptolemy Project, Lee, Berkeley 32 Other Topics Not Dealt With Scheduling problems –throughput, latency, jitter, memory, load balancing, … Higher-order components –like higher-order functions, but actor-oriented Distributed models –giving middleware concurrent, actor-oriented semantics Domain polymorphism –designing components to operate with multiple models of computation Behavioral type systems –components declare interfaces that make explicit requirements of the MoC Ptolemy II is open source & free