Specification of Control Flow in Ptolemy
Bilung Lee, Xiaojun Liu, UC Berkeley
bilung@eecs.berkeley.edu, liuxj@eecs.berkeley.edu

Most modern systems include control logic for the proper sequencing of computational tasks, and for switching and coordinating between different operating modes. Finite state machines (FSMs) have long been used to specify control flow for control-dominated problems. In large systems, however, the control functionality can become so complex that the flat, sequential FSM model becomes impractical.

Hierarchical concurrent FSMs (HCFSMs) increase the usefulness of FSMs by extending them with structuring and communication mechanisms. However, most formalisms that support HCFSMs, such as Statecharts and its variants, tightly integrate the concurrency semantics with the FSM semantics. In our approach [1], we add hierarchy and heterogeneity to the FSM model. This allows the FSM to be hierarchically combined with various concurrency models, in particular dataflow, discrete events and synchronous/reactive models. In this heterogeneous model, the semantics of FSM, concurrency and hierarchy are naturally supported. Our scheme decouples the FSM from the concurrency models, enabling selection of the most appropriate concurrency model for the problem at hand.

An FSM domain has been developed in Ptolemy Classic and is integrated with existing DE, SDF, and SR domains. We are currently implementing the FSM domain in Ptolemy II [2] with a focus on combining the CT and FSM domains for hybrid system modeling and integrating the FSM domain with process domains such as CSP and PN.

A. Girault, B. Lee, and E. A. Lee, "Hierarchical Finite State Machines with Multiple Concurrency Models," IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, Vol. 18, No. 6, pp.742-760, 1999.
John Davis II, et al., "Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java," Memorandum UCB/ERL M99/40, Electronics Research Laboratory, University of California, Berkeley, CA 94720, July 1999.