Ptolemy II Domains

Chapter 1, "Heterogeneous Modeling," of the book, "System Design, Modeling, and Simulation Using Ptolemy II," describes domains as:

"A semantic domain in Ptolemy II, often just called a domain , defines the "laws of physics" for the interaction between components in a design. It provides the rules that govern concurrent execution of the components and the communication between components [...]. A collection of such rules is called a modelof computation (MoC). We will use the terms "model of computation" and "domain" (nearly) interchangeably, though technically we think of a domain as being an implementation of a MoC. The MoC is an abstract model, whereas the domain is its concrete implementation in software."

"The rules that constitute a model of computation fall into three categories. The first set of rules specifies what constitutes a component. In this book, a component is generally an actor [...]. The second set of rules specifies the execution and concurrency mechanisms. Are actors invoked in order? Simultaneously? Nondeterministically? The third specifies the communication mechanisms. How do actors exchange data?"

Below is the list of Ptolemy II domains in alphabetical order.


Algebraic

The Algebraic model of computation includes a director that solves algebraic loops.

As of August, 2014, this model of computation is under active development and should be seen as a work in progress.

Algebraic Demonstrations


CA (Cellular Automata)

The Cellular Automata (CA) model of computation uses the number of neighbors of a cell to determine if the cell lives or dies at the next iteration.

The CA domain was created by Zach Ezzell.

Resources

Cellular Automata Demonstrations


CI (Component Interaction)

The component interaction (CI) domain models systems that blend data-driven and demand-driven styles of computation. As an example, the interaction between a web server and a browser is mostly demand-driven. When the user clicks on a link in the browser, it pulls the corresponding page from the web server. A stock-quote service can use a data-driven style of computation. The server generates events when stock prices change. The data drive the clients to update their displayed information. Such push/pull interaction between a data producer and consumer is common in distributed systems, and has been included in middleware services, most notably in the CORBA event service. These services motivated the design of this domain to study the interaction models in distributed systems, such as stock-quote services, traffic or weather information systems. Other applications include database systems, file systems, and the Click modular router.

An actor in a CI model can be active, which means it possesses its own thread of execution. For example, an interrupt source of an embedded system can be modeled as an active source actor. Such a source generates events asynchronously with respect to the software execution on the embedded processor. CI models can be used to simulate and study how the embedded software handles the asynchronous events, such as external interrupts and asynchronous I/O.

References

  1. Xiaojun Liu, Yang Zhao, "The Component Interaction Domain: Modeling Event-Driven and Demand- Driven Applications", 5th Biennial Ptolemy Miniconference, Berkeley, CA, May 9, 2003.

Component Interaction Demonstrations


Continuous

The Continuous Time Model of Computation defines a semantics used for continuous-time simulations. Continuous Time models consist of Actors that have continuous time signals as their inputs and outputs, and may have a state that changes over time advancement. These actors are connected by relations denoting particular signals. At a sequence of time increments, the values of all signals are determined using a continuous time solving algorithm. If a given precision cannot be accomplished, finer time increments are used adaptively.

The domain models systems with continuous dynamics, including for example analog circuits and mechanical systems, but also cleanly supports discrete events, modal behaviors, and signals that mix continuous-time behaviors with discrete events. Models for continuous dynamics are equivalent to linear or nonlinear integral equations. A sophisticated numerical solver for these equations is integrated with the director. The clean semantics of the Continuous domain enables its integration in hierarchical heterogeneous models that use the Synchronous/Reactive (SR) and Discrete Event (DE) domains. Arbitrary hierarchical mixtures of these domains are supported, although if SR is at the top level, then the period parameter of the director must be used so that time advances. Domain interactions are documented in Lee and Zheng, 2007.

The clean semantics of the Continuous domain enables its integration in hierarchical heterogeneous models that use the Synchronous/Reactive (SR) and Discrete Event (DE) domains. Arbitrary hierarchical mixtures of these domains are supported, although if SR is at the top level, then the period parameter of the director must be used so that time advances. Domain interactions are documented in Goderis et al.

References

  1. Janette Cardoso, Edward A. Lee, Jie Liu and Haiyang Zheng, "Continuous-Time Models," a chapter from
    Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
    The models provided in this chapter are also available online.
  2. In System Design, Modeling, and Simulation using Ptolemy II. Ptolemy.org 2014.
  3. A. Goderis, C. Brooks, I. Altintas, E. A. Lee, and C. Goble, "Heterogeneous Composition of Models of Computation," EECS Department, University of California, Berkeley, Tech. Rep. UCB/EECS-2007-139, Nov. 2007.
  4. Edward A. Lee, Haiyang Zheng, "Leveraging Synchronous Language Principles for Heterogeneous Modeling and Design of Embedded Systems," EMSOFT, September 30 - October 2, 2007, Salzburg, Austria.
  5. Haiyang Zheng, "Operational Semantics of Hybrid Systems," Ph.D. Dissertation, EECS Department, University of California, Berkeley, Technical Report No. UCB/EECS-2007-68, May 18, 2007.
  6. Edward A. Lee and Haiyang Zheng, "Operational Semantics of Hybrid Systems," Invited paper in Proceedings of Hybrid Systems: Computation and Control (HSCC) LNCS 3414, Zurich, Switzerland, March 9-11, 2005, pp.25-53.

Continuous Demonstrations


CSP (Communicating Sequential Processes)

The Communicating Sequential Processes (CSP) domain in Ptolemy II models a system as a network of processes communicating with messages through unidirectional channels. If a process is ready to send a message, it blocks until the receiving process is ready to accept it. Similarly if a process is ready to accept a message, it blocks until the sending process is ready to send it. Thus the communication between processes is rendezvous based as both the reading and writing processes block until the other side is ready to communicate. This model of computation is non-deterministic as a process can be blocked waiting to send or receive on any number of channels. It is also highly concurrent due to the nature of the model.

The model of computation used in the CSP domain is based on the CSP model first proposed by Hoare[2] in 1978. In this model, a system is modeled as a network of processes communicating via messages along unidirectional channels. This is the only way processes can communicate as there is no shared state. The transfer of message between processes is via rendezvous, which means both the sending and receiving of a messages from a channel are blocking: i.e. the sending or receiving process stalls until the message is transferred. Some of the notation used here is borrowed from Andrews' book on concurrent programming [1], which refers to rendezvous-based message passing as synchronous message passing.

Applications for the CSP domain include resource management and high level system modeling early in the design cycle. Resource management is often required when modeling embedded systems, and to further support this, a notion of time has been added to the model of computation used in the domain. This differentiates our CSP model from those more commonly encountered, which do not typically have any notion of time, although several versions of timed CSP have been proposed[3]. It might thus be more accurate to refer to the domain using our model of computation as the "Timed CSP" domain, but since the domain can be used with and without time, it is simply referred to as the CSP domain.

References

  1. Neil Smyth "Communicating Sequential ProcessesDomain in Ptolemy II," MS Report, UCB/ERL Memorandum M98/70, Dept. of EECS, University of California, Berkeley, CA 94720, December 1998.
  2. Andrews, G. R., Concurrent Programming - Principles and Practice, Addison-Wesley, 19991.
  3. Hoare, C. A. R., "Communicating Sequential Processes," Communications of the ACM, vol. 21, no. 8, August 1978.
  4. Hinchey, M. G. and Jarvis, S. A., Concurrent Systems: Formal Developments in CSP, Mcgraw-Hill, 1995.

Communicating Sequential Processes Demonstrations


DDE (Distributed Discrete Event)

The Distributed Discrete Event (DDE) domain incorporates a distributed notion of time into a dataflow style communication semantic. Much of the functionality of the DDE domain is consistent with the Process Networks domain. In particular, this model of computation's mechanism for dealing with blocking due to empty or full queues is functionally identical to that of the PN domain.

The DDE domain's use of time serves as the point of divergence in the respective designs of DDE and PN. Time progress is communicated between actors by passing tokens that have time stamps associated with them. In a network of DDE actors each actor has a local notion of time. To facilitate this local notion of time, actors in a DDE model adhere to the following constraints.

The above rules facilitate a local notion of time and are consistent with the conservative blocking mechanism of Chandy and Misra's distributed discrete event system.

We are approaching the DDE model of computation as the intersection between dataflow and discrete event semantics. This allows us to study DDE semantics from two different perspectives. In particular, we can benefit from denotational semantics that are based on metric spaces (the Banach oriented DE approach) or posets (the Tarskian oriented dataflow approach). Matthews offers a partial metric topology which incorporates both of these mathematical tools.

The DDE domain is an experimental domain, the code has not been reviewed, and the interfaces are likely to change.

  1. Misra, Jayadev, "Distributed Discrete Event Simulation," ACM Computing Surveys, vol. 18, no. 1, March 1986, pp 39-65.
  2. Fujimoto, Richard M., "Parallel Discrete Event Simulation," Communications of the ACM, vol. 33, no. 10, October 1990, pp 30-53.
  3. Matthews, S. G., "Partial Metric Topology," General Topology and Applications, Proceedings of the 8th Summer Conference, Queen's College (1992), Annals of the New York Academy of Science, vol. 728, pp 183-197.

Distributed Discrete Event Demonstrations


DDF (Dynamic Dataflow)

The Dynamic Dataflow (DDF) domain is a superset of the Synchronous Dataflow (SDF) and Boolean dataflow (BDF) domains. In the SDF domain, an actor consumes and produces a fixed number of tokens per firing. This static information makes possible compile-time scheduling. In the DDF domain, an actor could change the production and consumption rates after each firing. The scheduler makes no attempt to construct a compile-time schedule, neither does it attempt to statically answer questions about deadlock and boundedness, which are fundamentally undecidable. Instead, each actor has a set of sequential firing rules (patterns) and can be fired if one of them is satisfied, i.e., one particular firing pattern forms a prefix of sequences of unconsumed tokens at input ports. The scheduler dynamically schedules the firing of actors according to some criteria. The canonical actors in the DDF domain include Select and Switch, which consume or produce tokens on different channels based on the token received from the control port.

References

  1. Gang Zhou, "Dynamic Dataflow Modeling in Ptolemy II," Master's Report, Technical Memorandum No. UCB/ERL M05/2, University of California, Berkeley, CA, 94720, USA, December 21, 2004.

Dynamic Dataflow Demonstrations


DE (Discrete Event)

The Discrete Event (DE) Model of Computation defines a semantics for a network of Actors that produce discrete events, and whose executions are triggered by discrete events. A discrete event is a value with a time associated with it that is global on the level of the model. Each event also has, as a destination, an associated input port on an Actor. This destination is determined by a relation connecting to this input port the output port, or model input, from which the event is produced, or enters the model, respectively.

When an event exist in the model, at a particular time, with an input port on an Actor as its destination, this Actor must respond to the event at the associated time. This response may be to produce no output. However, if output events are produced, the time associated with these events must be equal to or later than that of its inputs. This constraint ensures weak causality.

Furthermore, for the currently implemented form of the Discrete Event MoC in Ptolemy II, in a model every dependency cycle along the reaction to and production of events must have at least one Actor that produces events strictly later in associated time than those of its inputs. In more recent conceptions of these semantics this restriction is lifted to a strictly broader monotonicity condition.

This MoC is a Synchronous one, since at the time associated with every event in the model, associated with the relation connected to its destination, each relation can be determined uniquely to either have a single event associated with that same time, or have no event at that time, in which case the output of the Actor or model input connected to such a relation is said to produce absent. In other words, like the Synchronous Reactive model, at each Reaction event a unique value, including absent, can be determined at each relation.

DE models are extensively used in simulation of networks, queueing systems, and digital circuits.

References

Semantics and Theory

  1. Edward A. Lee, Jie Liu, Lukito Muliadi and Haiyang Zheng, "Discrete-Event Models," a chapter from
    Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
    The models provided in this chapter are also available online.
  2. Baccelli, F., G. Cohen, G. J. Olster and J. P. Quadrat (1992). Synchronization and Linearity, An Algebra for Discrete Event Systems. New York, Wiley.
  3. Cassandras, C. G. (1993). Discrete Event Systems, Modeling and Performance Analysis, Irwin.
  4. Cataldo, A., E. A. Lee, X. Liu, E. Matsikoudis and H. Zheng (2006). "A Constructive Fixed-Point Theorem and the Feedback Semantics of Timed Systems." Workshop on Discrete Event Systems (WODES), Ann Arbor, Michigan, July 10-12.
  5. Lee, E. A. (1999). "Modeling Concurrent Real-time Processes Using Discrete Events." Annals of Software Engineering 7: 25-45.
  6. Liu, X., E. Matsikoudis and E. A. Lee (2006). "Modeling Timed Concurrent Systems." CONCUR 2006 - Concurrency Theory, Bonn, Germany, August 27-30,Springer.
  7. Ramadge, P. J. G. and W. M. Wonham (1989). "The control of discrete event systems." Proceedings of the IEEE 77(1): 81-98.
  8. Zeigler, B. P., H. Praehofer and T. G. Kim (2000). Theory of Modeling and Simulation, Academic Press.

Simulators and Tools

  1. Edward A. Lee, Jie Liu, Lukito Muliadi and Haiyang Zheng, "Discrete-Event Models," a chapter from
    Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
  2. Varga, A. (2001). The OMNeT++ Discrete Event Simulation System. Proceedings of the European Simulation Multiconference (ESM'2001), Prague, Czech Republic, June 6-9.

Distributed DE

  1. Chen, G. and B. K. Szymanski (2002). Searching for Parallelism in Discrete Event Simulation. Summer Computer Simulation Conference, San Diego, CA, Relevant to Ptides.
  2. Jefferson, D. (1985). "Virtual Time." ACM Trans. Programming Languages and Systems 7(3): 404-425.
  3. Misra, J. (1986). "Distributed Discrete Event Simulation." ACM Computing Surveys 18(1): 39-65.

Discrete Event Demonstrations


DT (Discrete Time)

The Discrete Time (DT) domain is a timed extension of the Synchronous Dataflow (SDF) domain. Like SDF, it has static scheduling of the dataflow graph model. Likewise, DT requires that the rates on the ports of all actors be known beforehand and fixed. DT handles feedback systems in the same way that SDF does, but with additional constraints on initial tokens.

Because of the inherent concurrency occurring within SDF dataflow graph models, there are two notions of time in DT -- global time and local time. Global time increases steadily as execution progresses. Moreover, global time increments by fixed discrete chunks of time based on the value of the period parameter. On the other hand, local time applies to each of the actors in the model. All the actors have distinct local times as an iteration proceeds. The local time of an actor during an iteration depends on the global time, period, firing count, port rates, and the schedule. These local times obey the following constraint:

Global Time <= Local Time <= (Global Time + period)

The exact way that local time increments during an iteration is described in detail in the DTReceiver documentation.

The DT domain is an experimental domain, the code has not been reviewed, and the interfaces are likely to change.

References

  1. Edward A. Lee, Stephen Neuendorffer and Gang Zhou Dataflow, "Dataflow," a chapter from
    Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
    The models provided in this chapter are also available online.
  2. Chamberlain Fong, "Discrete-Time Dataflow Models for Visual Simulation in Ptolemy II," Master's Report, Memorandum UCB/ERL M01/9, Electronics Research Laboratory, University of California, Berkeley, January 2001.

Discrete Time Demonstrations


Giotto

Giotto is a domain designed by Christoph Meyer Kirsch to realize the semantics of the Giotto language, designed by Tom Henzinger, Ben Horowitz, and Christoph Meyer Kirsch. The semantics is a particular flavor of a synchronous model. Each component executes a specified number of times per iteration. The number of times it executes is called its frequency, and it defaults to one. The frequency can be specified to be something other than one by simply adding a parameter to the component named frequency, and then giving it a value different from one.

A particular feature of Giotto semantics is that the arcs connecting components are updated with a new value at well-defined points in the execution, irrespective of their execution time. If the frequency of the actor producing the data for the arc is one, then the value is updated only between iterations. Thus, each arc begins empty (having no value present), and acquires a value at the end of the first iteration.

If a component has frequency greater than one, then its output arcs are updated more than once per iteration. Suppose the frequency is two. Then its output arcs will be updated twice per iteration, but only the final update will be visible to components with frequency one (and only on the next iteration). If a component with frequency two is a destination of one of its outputs, then that component will see each update, but only in its next invocation. Thus, the second invocation of the destination in the iteration will see the value produced by the first invocation of the source in the iteration.

Giotto imposes the additional constraint that the frequencies of all components in a model bear harmonic relationships with one another. This means, for example, that frequencies of 2 and 3 cannot coexist in the same model. Frequencies 2 and 4 or 3 and 6 can, however, coexist.

The Giotto domain is highly preliminary, and the example models are not particularly interesting. Watch this space for more interesting examples.

References

  1. Haiyang Zheng, Edward Lee Christoph Kirsch, "Giotto Domain," a chapter from
    C. Brooks, E.A. Lee, X. Liu, S. Neuendorffer, Y. Zhao, H. Zheng (eds.), "
    Heterogeneous Concurrent Modeling and Design in Java (Volume 3: Ptolemy II Domains)," EECS Department, University of California, Berkeley, UCB/EECS-2008-37, April 15, 2008.
  2. M.A.A. Sanvido and Aaron Walburg, "Giotto Tutorial," Memorandum No. UCB/ERL M04/30, August 14, 2004, EECS Department, University of California at Berkeley, Berkeley, CA 94720, U.S.A
  3. Giotto Website

Giotto Demonstrations


GR (GR Three-D Graphics)

The GR domain is an experimental domain designed for three dimensional graphical animations. It is an untimed domain with particular optimizations aimed at reducing recomputations of scene graph components. A model consists of a set of three dimensional graphical elements, such as spheres, cylinders, etc., composed and transformed to form a scene graph. It is particularly interesting and useful to couple this domain with others, where the other domains provide the transformations for the graphical elements. For example, a model of a physical system might be constructed in CT and animated in GR.

Java3D

The GR domain demos require Java3D, which can be installed
http://java3d.dev.java.net/. You need not install Java3d if you are not planning on using GR domain.

If you plan on recompiling the GR domain, then install the Java 3D SDK and runtime. If you plan on only running the GR domain demos, then installing only the Java 3D runtime should be sufficient. We have verified the demos with the java3d-1_5_1-windows-i586.exe installer. from https://java3d.dev.java.net/.

You need not install Java3D if you are not planning on using GR domain.

If you plan on recompiling the GR domain, then install the Java 3D SDK and runtime. If you plan on only running the GR domain demos, then installing only the Java 3D runtime should be sufficient.

If you are running Ptolemy II under Web Start, see Installing Java 3D for use with Web Start

If, when you run the GR domain demos, you get a message about d3d8.dll missing, then you probably need to install DirectX.
DirectX can be downloaded from http://www.microsoft.com/downloads/search.aspx?displaylang=en&categoryid=2

Resources

  • Ptolemy II Plugin troubleshooting guide
  • GR Three-D Graphics Demonstrations


    HDF (Heterochronous Dataflow)

    The Heterochronous Dataflow (HDF) domain, created by Ye Zhou, is an extension of the Synchronous Dataflow (SDF) domain. In SDF, the set of port rates (called rate signatures) of an actor are constant. In HDF, however, rate signatures are allowed to change between iterations of the HDF schedule. The change of rate signatures can be modeled by state transitions of a modal model, in which each state refinement infers a set of rate signatures. Within each state, the HDF model behaves like an SDF model.

    References

    1. Ye Zhou, " Communication Systems Modeling in Ptolemy II," Master's Report, Technical Memorandum No. UCB/ERL M03/53, University of California, Berkeley, CA, 94720, USA, December 18, 2003.
    2. A. Girault, B. Lee, and E. A. Lee, " Hierarchical Finite State Machines with Multiple Concurrency Models," April 13, 1998.

    Heterochronous Dataflow Demonstrations


    Modal (Model Model)

    A Modal Model is a finite set of Actors (other models), all having the same set of inputs and outputs, associated each with states in a finite state machine. For any given state, the associated Actor is known as a Refinement of this state. During each firing of this Modal Model the refinements associated with the current state in the state machine fires. Subsequently, the evaluation of guards in the state machine determines which state, if any, to transition to, thereby determining the next refinement to fire.

    The modal domain replaces the fsm domain.

    References

    1. Thomas Huining Feng, Edward A. Lee, Xiaojun Liu, Stavros Tripakis, Haiyang Zheng and Ye Zhou, "Modal Models," a chapter from
      Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
      The models provided in this chapter are also available online.
    2. Edward A. Lee. "Finite State Machines and Modal Models in Ptolemy II," Technical report, EECS Department, University of California, Berkeley, UCB/EECS-2009-151, December, 2009.
    3. Edward A. Lee, Stavros Tripakis. "Modal Models in Ptolemy," Proceedings of 3rd International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools (EOOLT 2010), p. 11-22, 3, October, 2010.

    Model Model Demonstrations


    Petri Net

    This domain implements the basic Petri Net model where Places and Transitions form a bipartite graph and enabled Transitions can fire randomly. It also allows Transitions to be replaced by any other Actors in Ptolemy. It implements two forms of Hierarchical and compositional Petri nets. The first form of hierarchical and compositional Petri net semantics comes from the fact that a Transition can contain a sub-Petri-net which is invisible to the director of the container of the Transition. The second form of hierarchical and compositional Petri net semantics comes from a new Actor called PetriNetActor which is a collection of Places and Transitions, and those Places and Transitions are visible to the director of the container of the PetriNetActor. The users can choose which form of models to use, and/or mix them together.

    The basic Petri net is a directed, weighted, bipartite graph consisting of two kinds of nodes, called Places and Transitions, where arcs are either from a Place to a Transition or from a Transition to a Place. In graphical representation, Places are drawn as circles, Transitions as bars or boxes. Arcs are labeled with their weights (positive integers). Labels of unity weight are usually omitted. Multiple arcs can exist between a Place and a Transition. A marking assigns to each Place p an nonnegative integer k, we say that p is marked with k tokens. at the next iteration.

    References

    1. Wikipedia

    Petri Net Demonstrations


    PN (Process Networks)

    To model hardware and embedded applications, a highly concurrent model of computation is required. The PN domain in Ptolemy II presents a mechanism to model concurrency using the Kahn process networks model of computation [1]. The process networks model of computation has a dataflow flavor to it. This makes it well suited to modeling embedded dataflow applications and hardware architectures.

    In Ptolemy II, an implementation of the Kahn-MacQueen [2] semantics is provided. This is the bounded memory execution as proposed by T. Parks [3].

    The following are the most important features of the operational semantics of PN as proposed by Kahn and MacQueen:

    The above features make the execution of the network deterministic. The implementation in Ptolemy II is based on Java threads and synchronizing monitors.

    In addition to the above features, the PN domain has been extended to support a notion of global time. Time advances for a PN process either when the process is blocked on a read from some channel or when is explicitly waiting for time to advance. This is based primarily on Pamela [4].

    PN has been further extended to support dynamic changes to a graph. In case of timed-PN these changes are completely deterministic, while in case of untimed-PN, the changes could be non-deterministic and can depend on the schedule of the underlying java threads.

    References

    1. Neil Smyth, John S. Davis II, Thomas Huining Feng, Mudit Goel, Edward A. Lee, Thomas M. Parks and Yang Zhao, "Process Networks and Rendezvous," a chapter from
      Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
      The models provided in this chapter are also available online.
    2. M. Goel, "Process Networks in Ptolemy II," MS Report, ERL Technical Report UCB/ERL No. M98/69, University of California, Berkeley, CA 94720, December 16, 1998.
    3. G. Kahn, "The semantics of a simple language for parallel programming," Info. Proc. 74, vol.4, pp. 471-5, 1974.
    4. G. Kahn and D.B. MacQueen, "Coroutines and networks of parallel processes," Info. Proc. 77, vol. 7, pp. 993-8, 1997.
    5. T.M. Parks, Bounded scheduling of process networks. PhD thesis, Univ. of California at Berkeley, 1995.
    6. A. van Gemund, "Performance prediction of parallel processing systems: The Pamela methodology," in Proc. 7th ACM Int. Conf. on Supercomputing (Tokyo), pp.318-327, July 1993.
    7. Wikipedia

    Process Networks Demonstrations


    PSDF (Parameterized Synchronous Dataflow)

    The Parameterized Synchronous Dataflow (PSDF) domain is an extension of the Synchronous Dataflow (SDF) domain that allows for more extensive reconfiguration of models. The SDF domain uses static analysis of variable dependence to detect cases where rate parameters may change. By default, SDF disallows reconfiguration of all rate parameters. If rate parameters are allowed to change, then SDF checks that rate parameters do not change during execution of the schedule, and declares that inferred rate parameters for external ports change as often as the internal rate parameters.

    This domain offers two key extensions:

    1. Dependence analysis is used to determine if the modification to the rate parameters occurs during execution of the SDF schedule. If this test passes, then a parameterized schedule is constructed.
    2. The generated schedule is checked for local synchrony [1], to determine if external rate parameters may change. The correct dependency information for external ports is then declared.

    Note that the resulting behavior is identical to the SDF scheduler, with rate parameter changes allowed, except much more efficient, since scheduling on the fly is not necessary during every reconfiguration. Additionally, code can be generated for the PSDF domain that allows for efficient reconfiguration. The added precision of dependency analysis for external rate parameters also means that some hierarchical models that would be ruled out by the SDF checks are allowed.

    PSDF uses $PTII/lib/mapss.jar, which is a preliminary and experimental version of the MAPSS (MAryland Package for System Synthesis) package, developed at the University of Maryland. Publications related to the MAPSS project can be found at the link below. An overview of some of the core features in MAPSS is given in [2]. The mapss.jar file includes a basic subset of MAPSS features used to support scheduling in the Ptolemy II PSDF domain. A more complete distribution of MAPSS, including source code and documentation, is planned for the near future.

    References

    1. B. Bhattacharya and S. S. Bhattacharyya. Parameterized dataflow modeling for DSP systems. IEEE Transactions on Signal Processing, 49(10):2408-2421, October 2001.
    2. C. Hsu, F. Keceli, M. Ko, S. Shahparnia, and S. S. Bhattacharyya. DIF: An interchange format for dataflow-based design tools. In Proceedings of the International Workshop on Systems, Architectures, Modeling, and Simulation, Samos, Greece, July 2004.

    References [1] and [2] are available from the DSP-CAD Group publications page.

    Parameterized Synchronous Dataflow Demonstrations


    Ptera (Ptolemy Event Relation Actor)

    The Ptera (Ptolemy Event Relation Actor) domain is a discrete-event model of computation. A model in Ptera is represented with a graph of nodes and edges, where nodes represent events and directed edges between events represent scheduling relation. One or more events can be selected as initial events, which are scheduled at model time 0.0. When an event is fired, it possibly performs certain actions, and if there are outgoing edges from that event, the events at the end points of those edges are scheduled after non-negative delays. One or more events can also be selected as final events. The firing of final events causes the event queue to be emptied after their actions are performed, and therefore no more events can be processed.

    The Ptera domain supports a different kind of modal models called PteraModalModels, compared to modal models using FSMs (Finite State Machines) as the control. A PteraModalModel uses Ptera at the top level, and each event is refined into a sub-model. The refinements can use Ptera and any other Ptolemy models of computation.

    A Ptera model is timed. Although it should work in many domains, the DE (Discrete-Event) domain or Ptera domain itself are recommended. When embedded in those domains, the scheduling of the Ptera model is delegated to the container by calling the fireAt() function of its director.

    There are many useful additional features for Ptera, such as canceling edges and parameters. A canceling edge, denoted by a dotted line, cancels a previously scheduled event instead of scheduling a new one. If the pointed to event has multiple instances in the event queue, then the first instance is cancelled. Events may also have parameters, and the actual values for those parameters are specified by the expressions on the edges that schedule them. Those expressions are evaluated at run-time. The events may refer to the values of those parameters in their actions by parameter names.

    References

    1. Lee W. Schruben, "Simulation Modeling with Event Graphs," Communications of the ACM (CACM), 26(11): 957-963, 1983.
      Ptera is based on Lee W. Schruben's Event Graphs.
    2. Thomas Huining Feng and Edward A. Lee, "Ptera: An Event Oriented Model of Computation," a chapter from
      Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
      The models provided in this chapter are also available online.
    3. T. H. Feng, E. A. Lee, L. W. Schruben, "Ptera: An Event-Oriented Model of Computation for Heterogeneous Systems", EMSOFT, October 24-29, 2010, Scottsdale, Arizona, USA, ACM Press.
      A short explanation of Ptera.
    4. Thomas Huining Feng, "Model Transformation with Hierarchical Discrete-Event Control," Ph.D. Dissertation, EECS Department, University of California, Berkeley, Technical Report No. UCB/EECS-2009-77, May 20, 2009.
      See chapter three for an explanation of Ptera.

    Ptolemy Event Relation Actor Demonstrations


    Pthales (Pthales Model of Computation)

    Pthales is a multidimensional dataflow model of computation implemented in the heterogeneous modeling environment Ptolemy II. Pthales is based on Array-OL.

    References

    1. Boulet, P. (2007). "Array-OL Revisited, Multidimensional Intensive Signal Processing Specification," Technical Report 6113, INRIA, Orsay, France.
    2. Remi Barrere, Eric Lenormand, Dai Bui, Edward A. Lee, Christopher Shaver and Stavros Tripakis, "An Introduction to the Pthales Domain of Ptolemy II," EECS Department, University of California, Berkeley, Technical Report No. UCB/EECS-2011-32, April 26, 2011.

    Pthales Model of Computation Demonstrations


    Ptinyos (Ptolemy II PtinyOS)

    Viptos is an integration of a collection of Ptolemy II domains and TinyOS. The main domain behind Viptos is the PtinyOS domain, which supports the construction and simulation of programs in nesC.

    The nesC web page at http://nescc.sourceforge.net describes nesC as

    "an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS. TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM)."

    The PtinyOS domain leverages existing nesC libraries, using a tool called nc2moml to create the Ptolemy II libraries of components that are used to assemble models. Models are converted into nesC code by the PtinyOSDirector. TinyOS provides a rich library of nesC components. If you install TinyOS 1.x in $PTII/vendors/ptinyos, then the Ptolemy II configure script will find it and automatically make the TinyOS libraries available.

    In order to leverage another existing library of nesC components, you have to run nc2moml on that library.

    References

    1. Elaine Cheong, "Actor-Oriented Programming for Wireless Sensor Networks," Ph.D. Thesis, EECS Department, University of California, Berkeley, Technical Report No. UCB/EECS-2007-112, August 30, 2007
    2. Viptos Website

    Ptolemy II PtinyOS Demonstrations


    Rendezvous

    In the Rendezvous domain in Ptolemy II, each actor executes in its own thread of control, and communication between actors is by rendezvous. If an actor is ready to send a message, it blocks until the receiving actor is ready to receive it. Similarly if an actor is ready to receive a message, it blocks until the sending actor is ready to send it.

    This domain supports both conditional and multi-way rendezvous. In conditional rendezvous, an actor is willing to rendezvous with any one of several other actors. In multiway rendezvous, an actor requires rendezvous with multiple other actors at the same time. When using conditional rendezvous, the choice of which rendezvous occurs is nondeterministic, in general.

    The model of computation is based on the CSP model first proposed by Hoare[1] in 1978. Rendezvous-based communication is also known as synchronous message passing, but we avoid this term to avoid confusion with the SR (synchronous/reactive) domain.

    References

    1. Neil Smyth, John S. Davis II, Thomas Huining Feng, Mudit Goel, Edward A. Lee, Thomas M. Parks and Yang Zhao, "Process Networks and Rendezvous," a chapter from
      Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
      The models provided in this chapter are also available online.
    2. Hoare, C. A. R., "Communicating Sequential Processes," Communications of the ACM, vol. 21, no. 8, August 1978.

    Rendezvous Demonstrations


    SCR (Software Cost Reduction)

    The Software Cost Reduction (SCR) model of computation is a implementation of SCR. SCR "was created to help developers build specifications with greater assurance that the requirements will be complete, and the resulting software error-free."

    The Ptolemy II SCR model of computation is an incomplete prototype.

    References

    1. Heitmeyer CL, Marciniak JJ. 2002, "Software Cost Reduction," Encyclopedia of Software Engineering.

    Software Cost Reduction Demonstrations


    SDF (Synchronous Dataflow)

    Synchronous dataflow (SDF) is a special case of dataflow where the flow of control is sufficiently regular to be completely predictable at compile time. An SDF model is an interconnection of actors whose firings are enabled by fixed, pre-specified numbers of tokens on each of their inputs. Moreover, when an actor fires, it produces a fixed, pre-specified number of tokens on each of its outputs. The fact that these numbers are fixed makes it possible for a scheduler to determine the firing sequence at the time the model is initialized. Thus, SDF models are quite efficient, in that there is no multithreading needed, and run-time overhead consists only of a very simple dispatcher that implements the pre-computed schedule.

    References

    1. Edward A. Lee, Stephen Neuendorffer and Gang Zhou, "Dataflow," a chapter from
      Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
      The models provided in this chapter are also available online.
    2. Edward A. Lee and David G. Messerschmitt, "Synchronous Data Flow," Proceedings of the IEEE, vol. 75, no. 9, p 1235-1245, September, 1987
    3. Synchronous Data Flow (Wikipedia)

    Synchronous Dataflow Demonstrations


    SR (Synchronous Reactive)

    In the synchronous/reactive (SR) model of computation , the arcs represent data values that are aligned with global clock ticks. Thus, they are discrete signals, but unlike discrete time, a signal need not have a value at every clock tick. The entities represent relations between input and output values at each tick, and are usually partial functions with certain technical restrictions to ensure determinacy. Examples of languages that use the SR model of computation include Esterel, Signal, Lustre, and Argos.

    SR models are excellent for applications with concurrent and complex control logic. Because of the tight synchronization, safety-critical real-time applications are a good match. However, also because of the tight synchronization, some applications are overspecified in the SR model, limiting the implementation alternatives. Moreover, in most realizations, modularity is compromised by the need to seek a global fixed point at each clock tick.

    References

    1. Stephen A. Edwards, Edward A. Lee, Stavros Tripakis, Paul Whitaker, "Synchronous-Reactive Models," a chapter from
      Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II", Ptolemy.org, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf)
      The models provided in this chapter are also available online.
    2. Ptolemy II Documentation
    3. Paul Whitaker, "The Simulation of Synchronous Reactive Systems In Ptolemy II," Master's Report, Memorandum UCB/ERL M01/20, Electronics Research Laboratory, University of California, Berkeley, May 2001.
    4. Stephen A. Edwards and Edward A. Lee "The Semantics and Execution of a Synchronous Block-Diagram Language," Technical Memorandum UCB/ERL M01/33, University of California, Berkeley, CA 94720, October 25, 2001.
    5. Stephen A. Edwards, "The Specification and Execution of Heterogeneous Synchronous Reactive Systems," Ph.D. thesis, University of California, Berkeley, May 1997. Available as UCB/ERL M97/31.

    Synchronous Reactive Demonstrations


    TM (Timed Multitasking)

    The timed multitasking (TM) domain, created by Jie Liu, offers a model of computation based on priority-driven multitasking, as common in real-time operating systems (RTOSs), but with more deterministic behavior. In TM, actors (conceptually) execute as concurrent threads in reaction to inputs. The domain provides an event dispatcher, which maintains a prioritized event queue. The execution of an actor is triggered by the event dispatcher by invoking first its prefire() method. The actor may begin execution of a concurrent thread at this time. Some time later, the dispatcher will invoke the fire() and postfire() methods of the actor (unless prefire() returns false).

    The amount of time that elapses between the invocation of prefire() and fire() depends on the declared executionTime and priority of the actor (or more specifically, of the port of the port receiving the triggering event). The domain assumes there is a single resource, the CPU, shared by the execution of all actors. At one particular time, only one of the actors can get the resource and execute. Execution of one actor may be preempted by another eligible actor with a higher priority input event. If an actor is not preempted, then the amount of time that elapses between prefire() and fire() equals the declared. executionTime. If it is preempted, then it equals the sum of the executionTime and the execution times of the actors that preempt it. The model of computation is more deterministic than the usual priority-driven multitasking because the actor produces outputs (in its fire() method) only after it has been assured access to the CPU for its declared executionTime. In this domain, the model time may be synchronized to real time or not.

    References

    1. Jie Liu and Edward A. Lee, "Timed Multitasking for Real-Time Embedded Software," Invited paper in IEEE Control System Magazine, special issue on "Advances in Software Enabled Control", January 31, 2002.

    Timed Multitasking Demonstrations


    Wireless

    Modeling of wireless sensor networks requires sophisticated modeling of communication channels, sensor channels, ad-hoc networking protocols, localization strategies, media access control protocols, energy consumption in sensor nodes, etc. This modeling framework is designed to support a component-based construction of such models. It is intended to enable the research community to share models of disjoint aspects of the sensor nets problem and to build models that include sophisticated elements from several aspects.

    References

    1. Philip Baldwin, Sanjeev Kohli, Edward A. Lee, Xiaojun Liu, and Yang Zhao, "VisualSense: Visual Modeling for Wireless and Sensor Network Systems," Technical Memorandum UCB/ERL M05/25, University of California, Berkeley, CA 94720, USA, July 15, 2005.
    2. VisualSense Website

    Wireless Demonstrations