model transformation with the ptera controller
DESCRIPTION
Model Transformation with the Ptera Controller. Thomas Huining Feng CHESS, EECS, UC Berkeley. Motivating Sinewave Example. An SDF model to generate a sine wave with Automatic partial evaluation improves performance. Intuition of Model Transformation. - PowerPoint PPT PresentationTRANSCRIPT
April 16, 20098th Biennial Ptolemy Miniconference
Model TransformationModel Transformationwith the Ptera Controllerwith the Ptera Controller
Thomas Huining Feng
CHESS, EECS, UC Berkeley
Ptolemy Miniconference, Thomas Feng, 04/16/2009
2 / 13
Motivating Sinewave ExampleMotivating Sinewave Example
An SDF model to generate a sine wave with
Automatic partial evaluation improves performance
Ptolemy Miniconference, Thomas Feng, 04/16/2009
3 / 13
Intuition of Model TransformationIntuition of Model Transformation
Pattern matching – find a context-free part of the model
Ptolemy Miniconference, Thomas Feng, 04/16/2009
4 / 13
Intuition of Model TransformationIntuition of Model Transformation
Pattern matching – find a context-free part of the modelReplace it with a more compact design (value statically computed)
Ptolemy Miniconference, Thomas Feng, 04/16/2009
5 / 13
Intuition of Model TransformationIntuition of Model Transformation
Pattern matching – find a context-free part of the modelReplace it with a more compact design (value statically computed)Continue with similar transformations until fixpoint
Ptolemy Miniconference, Thomas Feng, 04/16/2009
6 / 13
Ptera (Ptolemy Event Relationship Actor) WorkflowPtera (Ptolemy Event Relationship Actor) Workflow
SimplifyMultiply SimplifyDivide
RemoveMultiply
Ptolemy Miniconference, Thomas Feng, 04/16/2009
7 / 13
Based on event graphs [Schruben 1983]Visual representation
Nodes are eventsEdges are scheduling relations
Syntax and Semantics for PteraSyntax and Semantics for Ptera
Action GuardDelay
Variable
Initial EventFinal Event
Ptolemy Miniconference, Thomas Feng, 04/16/2009
8 / 13
Syntax and Semantics of PteraSyntax and Semantics of Ptera
Based on event graphs [Schruben 1983]Visual representation
Nodes are eventsEdges are scheduling relations
Execution with an unbounded event queue
0.0 1.0 2.0 10.0 10.0
…Start
1.0
Increase Increase IncreaseEnd
Increase
1.0 1.0 1.0
0.0
time
Ptolemy Miniconference, Thomas Feng, 04/16/2009
9 / 13
Hierarchical ModelHierarchical Model
Each event can be associated with a submodelA submodel is itself a model
No difference in syntaxConceptually equipped with a separate event queueModel time is global
When Compute occurs at time 1, the submodel startsWhen the submodel ends at time t (t ≥ 2), Compute is finishedEnd is processed at time t + 1
Ptolemy Miniconference, Thomas Feng, 04/16/2009
10 / 13
Events for Model TransformationEvents for Model Transformation
A simple workflow for repeating a transformation
Ptolemy Miniconference, Thomas Feng, 04/16/2009
11 / 13
The Sinewave OptimizerThe Sinewave Optimizer
SimplifyMultiply SimplifyDivide
RemoveMultiply
Ptolemy Miniconference, Thomas Feng, 04/16/2009
12 / 13
The Sinewave OptimizerThe Sinewave Optimizer
Hierarchical workflow breaks down complexityAll transformation rules access the shared Model variable. No need for messaging.Order of the 3 transformations is unimportant (but a deterministic order exists)When model time is synchronized with real time, execution produces animation
Ptolemy Miniconference, Thomas Feng, 04/16/2009
13 / 13
ConclusionConclusion
Transformation rule specified in the modeling language
The control is essentially a model(so we call it model-based transformation)
The Ptera model of computationSupports hierarchical workflowsBetter expressiveness than state machines and control flow diagramsShares data with variables instead of messagesPermits heterogeneous composition (with DE, FSM, dataflow, etc)
ApplicationsModel optimizationModel constructionDesign refactoringPtera can also simulate discrete-event systems
Available from Ptolemy II 8.0More demos in ptolemy/actor/gt/demo, ptolemy/domains/ptera/demo