Actor Oriented Programming with CAL -designing embedded system components Johan Eker Department of Automatic Control, Lund University Chris Chang, Jörn.

Slides:



Advertisements
Similar presentations
Fakult ä t f ü r informatik informatik 12 technische universit ä t dortmund Data flow models Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra.
Advertisements

Interaction Modeling for Testing We would generate the test cases based on our understanding of the interactions that may happen. The source is, again,
Rule Based Operational Semantics Specification in Ptolemy Yanwar Asrigo COMP 763B - Modeling and Simulation Based Design 30 th April 2008.
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.
ACM SIGPLAN 2001 Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES'2001) Jun 22-23, 2001, Snowbird, Utah, USA Embedded Software from.
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Component Technologies for Embedded Systems Johan Eker.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Causality Interfaces for Actor Networks Ye Zhou and Edward A. Lee University of California,
Automated Analysis and Code Generation for Domain-Specific Models George Edwards Center for Systems and Software Engineering University of Southern California.
Chess Review May 8, 2003 Berkeley, CA Classes and Inheritance in Actor- Oriented Models Stephen Neuendorffer Edward Lee UC Berkeley.
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
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.
Hybrid/OCP Workgroup. Issues Heterogeneous model semantics (common principles, differences) – Ptolemy II – FRP – CHIRP – Simulink/Stateflow/Matlab – Giotto/Masaccio.
Scheduling for Embedded Real-Time Systems Amit Mahajan and Haibo.
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 C AL - An actor language Jörn W. Janneck The Ptolemy Group University of California, 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.
February 12, 2009 Center for Hybrid and Embedded Software Systems Encapsulated Model Transformation Rule A transformation.
Lock Inference for Systems Software John Regehr Alastair Reid University of Utah March 17, 2003.
An Extensible Type System for Component-Based Design
1 Quasi-Static Scheduling of Embedded Software Using Free-Choice Petri Nets Marco Sgroi, Alberto Sangiovanni-Vincentelli Luciano Lavagno University of.
The Ptolemy Group University of California at Berkeley Jörn W. Janneck Actors, actor composition, and an actor language describing the semantics of (some)
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.
A Denotational Semantics For Dataflow with Firing Edward A. Lee Jike Chong Wei Zheng Paper Discussion for.
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.
Designing Predictable and Robust Systems Tom Henzinger UC Berkeley and EPFL.
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 The Component Interaction Domain: Modeling Event-Driven and Demand- Driven Applications.
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 MESCAL Application Modeling and Mapping: Warpath Andrew Mihal and the MESCAL team UC Berkeley.
Mahapatra-Texas A&M-Fall'001 Codesign Framework Parts of this lecture are borrowed from lectures of Johan Lilius of TUCS and ASV/LL of UC Berkeley available.
System-Level Types for Component-Based Design Paper by: Edward A. Lee and Yuhong Xiong Presentation by: Dan Patterson.
Models of Computation Reading Assignment: L. Lavagno, A.S. Vincentelli and E. Sentovich, “Models of computation for Embedded System Design”
Models of Computation as Program Transformations Chris Chang
Department of Electrical Engineering and Computer Sciences University of California at Berkeley The Ptolemy II Framework for Visual Languages Xiaojun Liu.
Chess Review November 21, 2005 Berkeley, CA Edited and presented by Coupled Interface Modules for Heterogeneous Composition Ethan Jackson ISIS, Vanderbilt.
What’s Ahead for Embedded Software? - Edward A. Lee (2000) Wednesday November 10, 2010 Hokeun Kim.
Course Outline DayContents Day 1 Introduction Motivation, definitions, properties of embedded systems, outline of the current course How to specify embedded.
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
Mahapatra-A&M-Fall'001 Co-design Finite State Machines Many slides of this lecture are borrowed from Margarida Jacome.
C. André, J. Boucaron, A. Coadou, J. DeAntoni,
Pipes & Filters Architecture Pattern Source: Pattern-Oriented Software Architecture, Vol. 1, Buschmann, et al.
Submodule construction in logics 1 Gregor v. Bochmann, University of Ottawa Using First-Order Logic to Reason about Submodule Construction Gregor v. Bochmann.
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.
Qusay H. Mahmoud CIS* CIS* Service-Oriented Computing Qusay H. Mahmoud, Ph.D.
Incremental Checkpointing with Application to Distributed Discrete Event Simulation Thomas Huining Feng and Edward A. Lee {tfeng,
What’s Ahead for Embedded Software? (Wed) Gilsoo Kim
CPE555A: Real-Time Embedded Systems
Event Relation Graphs and Extensions in Ptolemy II
Code Generation for Ptolemy II
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Retargetable Model-Based Code Generation in Ptolemy II
Jörn W. Janneck The Ptolemy Group University of California, Berkeley
Automated Analysis and Code Generation for Domain-Specific Models
The Caltrop Actor Language a short introduction
Modeling Event-Based Systems in Ptolemy II EE249 Project Status Report
Presentation transcript:

Actor Oriented Programming with CAL -designing embedded system components Johan Eker Department of Automatic Control, Lund University Chris Chang, Jörn Janneck, Yang Zhao EECS, University of California at Berkeley LUCAS Seminar, October 22, 2002

Multipurpose tools Express almost anything, guarantee almost nothing “You only need to know one programming language!” Easy to get started, harder to finish Programmers+language, a lifelong marriage Examples: Java C/C++ with RTOS, ADA, Modula-2 RMA & EDF scheduling

Sharpen your tools Use problem specific tools Constrain the solutions Combine several dedicated tools “Don’t get it right, keep it right”

Component Technology a component is a component is a component Examples: Java beans, VB-components, etc Rationale Encapsulation & Reuse Successful in many areas Embedded components Problems with concurrency Threads do not compose well Difficult to encapsulate properties such as priorities, deadlines, execution times, etc. Static interfaces not good enough State-of-the art technology does not suffice

Enter actor oriented programming Actors and models An application (or a model) is expressed as a network of actors Actors communicate via token passing When an actor is fired it consumes tokens and produces token The actor itself is agnostic about when and how it is scheduled and how and with whom it is communicating

input portsoutput ports parameters Actor tokens ‘C’ 31 ‘L’ ‘A’ tokens 42 ‘P’ 9912‘\’ state 42 Actors decouple data and control N Data 41 FIRE What's an actor

A Model of Computation governs the actor interaction, i.e. Sheduling Communication What's an application A B C D A schedule Fire A Fire B Fire A Fire C Fire D

Hierarchical, heterogeneous modeling and design in Ptolemy II sensors leader Br Acc Ba bang-bang PID follower controller actuators S Models of computation Slide courtesy of Edward Lee

Components Actor = Component A network of actors can be transformed into a single actor + MoC

Enter CAL Cal Actor Language A domain-specific language for writing dataflow actors Ports, states, parameters Produces & consumes tokens actor A() Double input ==> Double output: mutable Integer n := 0; mutable Double sum := 0; action [a] ==> [sum / n] do n := n + 1; sum := sum + a; end A

Multiple actions and tags actor B() Integer in1, Integer in2 ==> Integer out: a1 : action [a, b], [] ==> [exp1] do... end a2 : action [a], [b] ==> [exp1, exp2] do... end a3 : action [a, b], [c]==> [exp1] do... end a4 : action [a], [b, c]==> [exp1] do... end end Port pattern example in1=[1,2,3], in2=[1] matches all in1=[1], in2=[2] matches a2 & a4 in1=[1,2,3], in2=[] matches a1 An actors defines a set of input-output relation

Parameters & Guards actor A(Double max) Double input ==> Double output: mutable Integer n := 0; mutable Double sum := 0; action [a] ==> [] guard sum > max do end action [a] ==> [sum / n] do n := n + 1; sum := sum + a; end

Action schedules, priorities & type parameters actor FairMerge[T]() T Input1, T Input2 ==> T Output: A : action [a], [] ==> [a] do end B : action [], [a] ==> [a] do end schedule (A B)* end end other selectors are conceivable, e.g. (A B)* | (B A)* ( (A B) | (B A) )* actor AnotherMerge[T]() T Input1, T Input2 ==> T Output: A: action [a], [] ==> [a] do end B: action [a], [b] ==> [a] do end priority B > A end end

A CAL Application actor A() T in ==> T out1, T out2: a1 : action [a] ==> [e1],[] do... end a2 : action [a] ==> [],[e2] do... end end actor B() T in ==> T out: b1 : action [a] ==> [e1] guard.. do... end b2 : action [a] ==> [e2] guard.. do... end end actor C() T in1, T in3 ==> T Out1, T Out2: c1 : action [a],[b] ==> [e1],[] do... end c2 : action [a], [] ==> [],[e2] do... end c3 : action [], [b] ==> [e1],[e2] do... end end B A C

Analysis of a CAL Application B A C 1. Map the network into a petri net 2. Compute firing vectors 3. Find legal firing sequences 4. Select a schedule 5. Calculate buffer sizes 6. Fold the CAL actor descriptions for A, B & C output input output

Source level transformation actor ABD() T in ==> T out: action [a] ==> [e1] A$a2(); B$b1(); C$c1(); end procedure A$a2() begin... end..... end 1.fire A, action a2 2.fire B, action b1 3.fire C, action c1 Assume we found the following schedule: Removes external buffers No need for a scheduler Source level components CAL provides an dynamic component interface What are the benefits? Components are refined upon composition!

Some Cal Buzzwords Control flow analysis Token production/consumption rates Side effect free expressions Lambda and procedural closures First class of course Type parametric Immutable varibles as default No aliasing

Key Concept: Orthogonal Concerns Communication Scheduling Algorithm

Summary Embedded system components Java code for Ptolemy II/Grafchart frameworks C-code Compiler is being developed at UCB and Thales Research Ltd, UK. More information Eker et al “Taming heterogeneity-the Ptolemy Approach”, IEEE Proceedings