Modeling and Visualization of CFSM Networks in JavaTime Michael Shilman James Shin Young EE249 Project Presentation December 8 1998 Outline Introduction JavaTime Components Abstract Reactive Model Modeling of CFSM s AR and CFSM JavaTime Packages Visualization of CFSM Networks Design Example Seatbelt Controller Conclusions Introduction The JavaTime Project Collection of tools libraries and methodologies for embedded systems design Use JavaTM enhanced via packages as textual design input syntax Graphical input syntax and visualization infrastructure Common model for system representation Goals for EE249 Incorporate CFSM model into JavaTime environment Describe visualize and execute CFSM networks on standard Java platforms JavaTime Component Package Components Connections Central design entities Ports Relation between ports Containers Access points for connecting components C o n ta in e r C om ponent P o rt C o n n e c tio n Hierarchical nesting of components and containers The Abstract Reactive Model Components react to all input events Events are changes in signal values Fully asynchronous communication No events happen at the same time Networks for abstraction Temporal and structural abstraction Fundamental mode asynchronous assumption All internal signals converge to a stable value before output is emitted Used in JavaTime as building block for describing other models The javatime jcp ar Package ARComponent User specifies behavior by defining the react ARPort p Object v method ARNetwork Executes components contained within according to semantics of AR model ARThread Enables Esterel style description of component behavior public class Foo extends ARComponent public void react do something Modeling CFSM s in AR CFSM s are modeled as AR components with two implicit ports Activate input runnable output Transitions of CFSM s controlled by scheduler component C F S M N e tw o rk r u n n a b le CFSM a c tiv a te S c h e d u le r CFSM CFSM The javatime jcp cfsm Package Implemented using the javatime jcp ar package CFSM public class Bar User specifies behavior by definingextends CFSM public void transition transition method do something eventPresent Input I method tests for presence of events CFSMNet Contains a scheduler component responsible for activating CFSM s CFSMThread Esterel style input for CFSM s Esterel style Programs in Java Esterel provides compact syntax for synchronous reactive programming await do watching etc Construct similar conveniences in Java Provided in ARThread CFSMThread classes await awaitWatching methods Uses standard Java threads public class Blah extends ARThread monitors to implement public void run Esterel like facilities while true do something Maintains compatibility with await standard Java syntax tools and execution platforms CFSM Visualization Our goal view edit and animate component networks at different levels of abstraction E d ito r s D e s ig n P ro b e s C u s to m V is u a liz a tio n s Focus on infrastructure rather than application Make it easy to construct visualizations rather than trying to pre package all possible visualizations Able to develop in parallel with modeling effort Visualization Probes Components which sample signals to construct visualizations Modular and easy to write drag and drop just like any other component Probe to modify network display as system executes via protocol based API Image probes at different stages in a JPEG decoder Animation and Instrumentation Listener interface allows monitoring of execution state Instrumentation by procedural insertion of probes Simple traversal of JCP design hierarchy Code instrumentation using JavaTime AST tools Create extra output ports to communicate instrumentation results Visualization Protocols Software protocols for reusable visualization surfaces Support for incremental update Read modification capabilities Sample protocols Protocol Geometry Data types Shape color line thickness etc Graph Graph node edge Tuple String number tuple Schematic Component port network connection Anatomy of a Protocol V ie w s h a p e c o lo r lin e Multiple Multipleviews views standard standard sketch sketch G ra p h M odel g ra p h n o d e e d g e S c h e m a tic M odel n e t c o m p o n e n t p o r t c o n n e c t io n ja v a tim e jc p Filters Filters scheduler scheduler activate runnable activate runnableports ports visualization probes visualization probes Multi Syntax Editing Different visual syntax for different models of computation Illustrate relationship between different models AR View CFSM View Design Example Implemented the POLIS seatbelt controller example using javatime jcp cfsm package Original design CFSM behavior described with two Esterel modules CFSM network described in Ptolemy Ported design CFSM s described as Java classes Network also a Java class Design Example Esterel module belt control input reset key on key off belt on end 5 end 10 output alarm boolean start timer loop do emit alarm false every key on do do emit start timer await end 5 emit alarm true await end 10 watching key off or belt on emit alarm false end watching reset end Design Example JavaTime public void run Condition watch new Condition public boolean isTrue return eventPresent reset eventPresent keyOff eventPresent beltOn while true try emit alarm Boolean FALSE awaitWatching reset if eventPresent keyOn try emit startTimer awaitWatching end5 watch emit alarm Boolean TRUE awaitWatching end10 watch catch WatchException e if eventPresent reset throw e emit alarm Boolean FALSE catch WatchException e Conclusions Java as an input syntax for reactive systems Resulting specification not as concise as Esterel but provides compatibility with standard Java tools Programming language extensions as packages Extends utility of a language without compromising compatibility Avoid high overhead of new language development a good option for niche domains Relationship between AR and CFSM models CFSM networks can be modeled as AR systems The reverse is probably also true More Conclusions Visual editing and animation of systems Multi syntax editing reveals relationship between models of computation Software protocols enable rapid development of interactive visualizations Visualization probes simplify user level construction of visualizations
View Full Document
Unlocking...