Model Transformation with Hierarchical Discrete-Event Control

Slides:



Advertisements
Similar presentations
Architecture Representation
Advertisements

1 Towards formal manipulations of scenarios represented by High-level Message Sequence Charts Loïc Hélouet Claude Jard Benoît Caillaud IRISA/PAMPA (INRIA/CNRS/Univ.
Rule Based Operational Semantics Specification in Ptolemy Yanwar Asrigo COMP 763B - Modeling and Simulation Based Design 30 th April 2008.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Chess Review May 8, 2003 Berkeley, CA Classes and Inheritance in Actor- Oriented Models Stephen Neuendorffer Edward Lee UC Berkeley.
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.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
Using Interfaces to Analyze Compositionality Haiyang Zheng and Rachel Zhou EE290N Class Project Presentation Dec. 10, 2004.
Causality Interface  Declares the dependency that output events have on input events.  D is an ordered set associated with the min ( ) and plus ( ) operators.
February 12, 2009 Center for Hybrid and Embedded Software Systems Encapsulated Model Transformation Rule A transformation.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
CS 267 Spring 2008 Horst Simon UC Berkeley May 15, 2008 Code Generation Framework for Process Network Models onto Parallel Platforms Man-Kit Leung, Isaac.
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.
A Denotational Semantics For Dataflow with Firing Edward A. Lee Jike Chong Wei Zheng Paper Discussion for.
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.
Tool Integration of Ptolemy II EE290N Class Project Haiyang Zheng May
MOBIES Project Progress Report Engine Throttle Controller Design Using Multiple Models of Computation Edward Lee Haiyang Zheng with thanks to Ptolemy Group.
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.
McGill University Proposal Exam School of Computer Science Ph.D. Candidate in the Modelling, Simulation and Design Lab Eugene Syriani.
Ch.2 Part A: Requirements, State Charts EECE **** Embedded System Design.
- 1 - Embedded Systems—State charts Specifications.
Course Outline DayContents Day 1 Introduction Motivation, definitions, properties of embedded systems, outline of the current course How to specify embedded.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2005/6 Universität Dortmund Specifications.
Chapter 10 State Machine Diagrams
ESL: Panacea or Hype? FERMAT | Sandeep Shukla | June 2005 Acknowledgement: NSF, Project Tech, and the “Chip.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Composing Models of Computation in Kepler/Ptolemy II
Validated Model Transformation Tihamér Levendovszky Budapest University of Technology and Economics Department of Automation and Applied Informatics Applied.
Ch. 2. Specification and Modeling 2.1 Requirements Describe requirements and approaches for specifying and modeling embedded systems. Specification for.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
States.
Incremental Checkpointing with Application to Distributed Discrete Event Simulation Thomas Huining Feng and Edward A. Lee {tfeng,
Actor Oriented Programming with CAL -designing embedded system components Johan Eker Department of Automatic Control, Lund University Chris Chang, Jörn.
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
CS 5991 Presentation Ptolemy: A Framework For Simulating and Prototyping Heterogeneous Systems.
Control of Dynamic Discrete-Event Systems Lenko Grigorov Master’s Thesis, QU supervisor: Dr. Karen Rudie.
Marilyn Wolf1 With contributions from:
TensorFlow– A system for large-scale machine learning
Dynamic structure modelling for Causal Block Diagrams
Main issues: • What do we want to build • How do we write this down
Object-Oriented Analysis and Design
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Event Relation Graphs and Extensions in Ptolemy II
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Gabor Madl Nikil Dutt Domain-specific Modeling of Power Aware Distributed Real-time Embedded Systems Gabor Madl
Compositionality in Synchronous Data Flow
Model Transformation with Hierarchical Discrete-Event Control
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Retargetable Model-Based Code Generation in Ptolemy II
States.
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Modeling Shari L. Pfleeger and Joanne M. Atlee, Software Engineering: Theory and Practice, 4th edition, Prentice Hall, Hans Van Vliet, Software Engineering:
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Hybrid and Embedded Systems: Generalized Hybrid Systems
States.
Model Transformation with the Ptera Controller
Concurrent Models of Computation
Presented By: Darlene Banta
Concurrent Models of Computation
Presentation transcript:

Model Transformation with Hierarchical Discrete-Event Control Thomas Huining Feng Center for Hybrid and Embedded Software Systems EECS, UC Berkeley Advisor: Prof. Edward A. Lee

Outline Motivation and Contribution Transformation Rules: Syntax and Semantics Ptera (Ptolemy Event Relationship Actor) Model-Based Transformation Conclusion and Future Directions

Motivation Models can get large A simplified 4-way Intersection (230 actors, 2000 attributes) How about Street? How about City? Other types? (n-way, irregular, European) Need automatic model construction and maintenance

Sinewave Example An SDF (synchronous dataflow) model to generate a sine wave with: Static partial evaluation improves run-time performance (similar to program optimization in compilers) sin( 2πFn ) Fs

Contribution A model transformation tool Convenient − an intuitive visual syntax Flexible − compositional workflow Efficient − by using an appropriate model of computation The Ptera model of computation Syntax and semantics based on event graphs Hierarchical composition Composition with DE, FSM and more Applications Transformation for actor models Simulation of discrete-event processes

Outline Motivation and Contribution Transformation Rules: Syntax and Semantics Ptera (Ptolemy Event Relationship Actor) Model-Based Transformation Conclusion and Future Directions

Intuition of Model Transformation Pattern matching (locate a part of the model)

Intuition of Model Transformation Pattern matching (locate a part of the model) Replace the part with a more compact design

Intuition of Model Transformation Pattern matching (locate a part of the model) Replace the part with a more compact design Repeat transformations until fixpoint

Control A control mechanism is needed Examples of existing approaches Transform until fixpoint Try multiple alternative transformation rules Pause and ask user a question Branch with user input or current state Perform IO before/after transformation … Examples of existing approaches Priority (AToM3, AGG) Control flow + Statecharts (FUJABA) Abstract state machines (VIATRA2) Dataflow + Implicit shared variables (GReAT) Imperative programs (PROGRES) The Ptolemy II approach Hierarchical heterogeneous models of computation Ptera (Ptolemy event relationship actor)

A Ptera Transformation Workflow SimplifyMultiply Demo here. SimplifyDivide RemoveMultiply

Outline Motivation and Contribution Transformation Rules: Syntax and Semantics Ptera (Ptolemy Event Relationship Actor) Model-Based Transformation Conclusion and Future Directions

CarWash: single queue multiple servers Syntax Based on event graphs [Schruben 1983] Visual representation Nodes are events Edges are scheduling relations Compare to FSM Actions on events Can schedule multiple events Timed Variable Initial Event Action Final Event Delay (δ) CarWash: single queue multiple servers Guard The CarWash model

Execution During execution, the event queue stores instances of events Start by scheduling an instance of each initial events at time 0 Remove and process the first instance in each firing Terminate when the event queue becomes empty Wash Enter 4 6 Wash Enter Enter Leave 2 4 6 8 Enter Enter Leave Leave Leave 2 4 8 8 10 Start End End End End End 50 50 50 50 50 0.0 2.0 2.0 4.0 4.0 6.0 time S = 3 Q = 0 S = 3 Q = 1 S = 2 Q = 0 S = 2 Q = 1 S = 1 Q = 0 S = 1 Q = 1

Simultaneous Events ... Events with instances that coexist in the event queue, and are scheduled to occur at the same time E.g., Enter and Leave. Wash Enter End Leave 50 12 10 Enter 8.0 8 6 8 Wash Enter Enter Leave 4 6 8 8 Enter Leave Leave Leave 6 8 8 10 Leave Leave Leave Leave ... 8 10 10 12 End End End End 50 50 50 50 4.0 6.0 6.0 8.0 time S = 1 Q = 0 S = 1 Q = 1 S = 0 S = 0 Q = 0 Q = 1

Simultaneous Events ... Events with instances that coexist in the event queue, and are scheduled to occur at the same time E.g., Enter and Leave. Wash Leave 6 8 Wash Enter Leave Enter End Leave 50 12 10 Enter 8 8.0 4 6 8 8 Enter Leave Enter Leave 6 8 8 10 Leave Leave Leave Leave ... 8 10 10 12 End End End End 50 50 50 50 4.0 6.0 6.0 8.0 time S = 1 Q = 0 S = 1 Q = 1 S = 0 S = 1 Q = 0 Q = 0

FIFO and LIFO Policies With FIFO (First In First Out) policy With LIFO (Last In First Out) policy time End Leave 50 10 8 Enter 6 6.0 ... Wash time End Leave 50 10 8 Enter 6 6.0 ... Wash

Rationale for FIFO and LIFO With FIFO, when x*t1 = y*t2 Λ t1 > t2 ReadOpen → WriteOpen → Read → Write → ReadClose → WriteClose With LIFO, always (ReadOpen → Read → ReadClose), (WriteOpen → Write → WriteClose)

Execution Algorithm Initialize E to contain all initial events While E is not empty Remove the top instance t from E Execute t’s actions Terminate if t is a final event Schedule events in E in the order of Time stamp FIFO or LIFO policy Event name Scheduling relation name 0.0 2.0 Start time End Enter Wash 50 2 4

Model Hierarchy: Previous Attempts Submodel associated with scheduling relation [Schruben 1995] Submodel associated with event [Schruben 1995] LEGOs (Listener Event Graph Objects) [Buss & Sánchez 2002] Producer Consumer

Model Hierarchy: The Ptera Approach A submodel is itself a model No difference in syntax Conceptually equipped with an isolated event queue A global notion of model time Implication: events (or tasks) are no longer instantaneous Start of an event causes start of its submodel End of the submodel causes end of the event

Hierarchical CarWash Hierarchical workflow: ... Global time, separate event queues A composite task (CT) is composed of smaller tasks Execution of CTs interleave The whole workflow is a top-level CT (LIFO) Wash 4 Wash Wash Wash Enter Wash 2 3 4 4 5 Enter Enter Enter Wash Enter ... 4 4 4 5 6 End End End End End 50 50 50 50 50 2.0 3.0 4.0 4.0 4.0 HighPr 4 HighPr FoamP Wheel Rinse Rinse 2 3 4 5 5 2.0 3.0 4.0 4.0

Outline Motivation and Contribution Transformation Rules: Syntax and Semantics Ptera (Ptolemy Event Relationship Actor) Model-Based Transformation Conclusion and Future Directions

Transformation Workflow A simple workflow for repeated transformation

Hierarchical Workflow A hierarchical workflow to break down complexity Schedule multiple events (compare to FSM and control flow) Model time is useful for animation specifying time or cost simulation …

Comparison Priority: not expressive enough Control flow, state machine: bounded state, not hierarchical, not timed Imperative program: lack of abstraction Dataflow: overhead of message passing Shared variables are introduced in GReAT to improve performance, but they cause new problems. Const Actors Run Time (sec) Ptera DDF C (from DDF) 8 0.016 0.113 0.015 16 0.032 0.250 0.031 32 0.063 0.875 0.078 64 0.188 4.088 0.218 128 0.750 17.254 0.717 256 3.261 74.850 3.276 512 14.431 366.679 12.386 1024 72.736 2054.172 59.764

Applications Model optimization E.g., partial evaluation, removal of nonfunctional parts Model construction E.g., generating a family of products Model refactoring E.g., flattening hierarchy, introducing hierarchy Simulation E.g., Conway’s game of life

Outline Motivation and Contribution Transformation Rules: Syntax and Semantics Ptera (Ptolemy Event Relationship Actor) Model-Based Transformation Conclusion and Future Directions

Conclusion and Future Directions Transformation rule in the same modeling language Model-based transformation is essentially a model Ptera Convenient and expressive Compositional Timed Avoids message passing Future Directions: Analyze properties of transformations Compose Ptera with other MoCs (DE and FSM studied) Model checking (bound of event queue, simultaneous events, termination condition, …) Behavior-preserving concurrent and distributed execution

Acknowledgments Dissertation committee Prof. Edward A. Lee (chair, advisor) Prof. Rastislav Bodik Prof. Lee W. Schruben Students, researchers and staff in Cory (545.*) Christopher Brooks and Mary Steward Industrial collaborators Naomi team at Lockheed Martin ATL Thomas Mandl at Bosch research Prof. Hans Vangheluwe (former advisor at McGill) Friends in EECS Family