Fun State An Internal Design Representation for Codesign

  • Slides: 25
Download presentation
Fun. State – An Internal Design Representation for Codesign n A model that enables

Fun. State – An Internal Design Representation for Codesign n A model that enables representations of different types of system components. Mixture of functional programming and state machines. Relationship to other models, regular state machines, communicating FSMs, marked graphs and synchronous dataflow, Boolean and dynamic dataflow graphs, Petri Nets, and SPI.

Issues of Complex Embedded Systems n n Increasing heterogeneity and complexity, decreasing expected time-to-market.

Issues of Complex Embedded Systems n n Increasing heterogeneity and complexity, decreasing expected time-to-market. Encompasses a broad range of allocation, scheduling, and binding issues in both hardware and software. SPI (System Property Intervals) is a methodology designed to deal with certain modeling problems. Capture semantics of multiple input languages.

What is Fun. State? n n n Functions driven by State machines Supports verification

What is Fun. State? n n n Functions driven by State machines Supports verification and representation of different design decisions. SPI and Fun. State are semantically equivalent. Incremental implementation and verification. Major results of Fun. State: n n n Use as a internal representation of heterogeneous embedded systems for scheduling and verification. Explicit separation of control and dataflow can represent many different models of computation. Fun. States as regular state machines allows many previously investigated properties to be applied here.

Previous Fun Work n n n Many different models of computations including discrete-event, reactive,

Previous Fun Work n n n Many different models of computations including discrete-event, reactive, and dataflow. Codesign FSMs also combine synchronous dataflow with FSMs PSMs Hierarchical FSMs introduced by Harel including *charts and statecharts. Fun. State attempts to reduce complexity by modeling only characteristics of an input specification which are relevant to a particular design method.

Basics of Fun. State n n Basic components include a network, N, and a

Basics of Fun. State n n Basic components include a network, N, and a FSM, M. Network N contains (F, S, E) n n n F is a set of functions S is a set of storage units (either queues of unbounded length or registers, linear arrays of pairs of an address and a value) E is a set of directed edges of (F X S) U (S X F) Data is represented as valued tokens. Datapath must be alternate between storage units and functions.

Simple Fun. State Model

Simple Fun. State Model

Functions n n Inputs and outputs have associated variables that denote the number of

Functions n n Inputs and outputs have associated variables that denote the number of consumed tokens and number of produced tokens. Can add or subtract nondeterministic (can be bounded) number of tokens.

The State Machine n n n Can use different models to specify the FSM

The State Machine n n n Can use different models to specify the FSM which controls the datapath. Use a model based on ARGOS similar to Harel’s statecharts. Transitions are labeled with conditions and actions. Predicates must be true, then the transition is taken.

Bringing the Functions and States Together Initialize the current state of the state machine

Bringing the Functions and States Together Initialize the current state of the state machine to its initial value. 1. ) Predicate Evaluation 2. ) Check for progress 3. ) State machine reaction 4. ) Functions fire

Model Extensions n n n The state machine can be a hierarchical FSM with

Model Extensions n n n The state machine can be a hierarchical FSM with XOR and AND states. The network may contain embedded components. This allows for arbitrarily deep hierarchy.

Computational Model for Fun. States n n Use regular state machines for computation purposes.

Computational Model for Fun. States n n Use regular state machines for computation purposes. Assuming that there are no data dependencies, hierarchy has been completely flattened, and functions have constant rates of consumption and production; Fun. State models may be translated into static state diagrams and dynamic sate diagrams.

Static and Dynamic State Diagrams n n Static state diagram has a set of

Static and Dynamic State Diagrams n n Static state diagram has a set of nodes, a set of directed edges which have integer distances between them, predicate functions, and some initial state. Dynamic state diagrams is an inifinite directed graph which has transitions that may connect nodes dynamically, with an initial state.

Relationship with Communicating FSMs FSM M 1 can write to a queue during a

Relationship with Communicating FSMs FSM M 1 can write to a queue during a transition. M 2 can guard its transition with predicates. If transition is taken the token is removed. POLIS models may also be represented with this model.

Marked Graphs and Synchronous Dataflow Graphs n n n Nodes representing actors are connected

Marked Graphs and Synchronous Dataflow Graphs n n n Nodes representing actors are connected with edges representing communication queues. A function determines the number of initial tokens in queues, two functions denote the numbers of tokens removed and added by firing of target and source actors, respectively. For Fun. State models, we can replace each actor with a function and each edge with an edge-queue-edge. There are existing functions for production and consumption of tokens. State machine has one state with a transition for every actor.

Cyclo-Static Dataflow Graphs n Production and consumption rates of actors change.

Cyclo-Static Dataflow Graphs n Production and consumption rates of actors change.

Boolean and Dynamic Dataflow Graphs n Introduce data-dependent datapath.

Boolean and Dynamic Dataflow Graphs n Introduce data-dependent datapath.

Differences with Petri Nets n n n Queues in Fun. States have a FIFO

Differences with Petri Nets n n n Queues in Fun. States have a FIFO behavior, unlike Colored Petri Nets (CPNs) No registers defined in CPN. Transitions are controlled by a FSM, whereas they are always ready in a CPN.

Differences with SPI n n n SPI does not explicitly separate control and dataflow.

Differences with SPI n n n SPI does not explicitly separate control and dataflow. States are not explicitly represented. The “state” of a SPI model is only the channel contents. SPI processes are autonomous like actors in a dataflow model. Fun. State functions are all controlled. SPI autonomous systems can be modeled by Fun. State models using local control. The most important difference is the control strategy.

Translating between SPI and Fun. State n n Translate the Fun. State component with

Translating between SPI and Fun. State n n Translate the Fun. State component with a single state and several transitions. Actions of these transitions trigger functions corresponding to SPI process’s modes. Or we can model the state-dependent behavior of the Fun. State by using virtual feedback networks in SPI. Then the SPI has a virtual state machine that can control the mode tags.

Formal Verification n n Fun. States can be verified with existing techniques because of

Formal Verification n n Fun. States can be verified with existing techniques because of their representation in regular state machines. Interval diagram techniques can be used to verify models efficiently and involves four steps: n n Formulation of the verification goal with a computation tree logic formula. Representation of state transitions in the form of an interval mapping diagram. Represent state sets as interval decision diagrams Apply boolean operations, quantification, and state set mapping until a fixed point is reached.

Scheduling Policies n n Verification can assist development of scheduling policies. Static scheduling may

Scheduling Policies n n Verification can assist development of scheduling policies. Static scheduling may use a simple FSM.

Symbolic and Conflict. Dependent Scheduling n n n Quasi-static scheduling may be modeled to

Symbolic and Conflict. Dependent Scheduling n n n Quasi-static scheduling may be modeled to overcome the disadvantages of static or dynamic schedule policies. Only datadependent choices are left to run-time decisions. Complex embedded systems have a growing problem of multiple types of non-determinism. More complex models of computation designed to handled these have their own problems of system deadlocks and queue overflows.

Conflict Dependent Scheduling n n Guaranteed to find a deadlock-free and bounded solution if

Conflict Dependent Scheduling n n Guaranteed to find a deadlock-free and bounded solution if one exists. This may be applied to a Fun. State model as a refinement in the internal representation: n n Specify all possible schedules through a non-determinate transition behavior; representing all design alternatives Search state space for cycles representing valid schedules Extracted schedule is made into a FSM and compacted using state minimization techniques Replace original specification part with the result, it may be transformed into program code.

Example: Molecular Dynamics Simulation n n Simple algorithm mapped onto a main workstation (Host)

Example: Molecular Dynamics Simulation n n Simple algorithm mapped onto a main workstation (Host) and a special purpose hardware accelerator (Co. Proc). Repeated computations in a feedback loop distributed among both processors. Certain computations are unknown at runtime, represented as conflicts. Dark circles represent alternatives that may be chosen during development. Goal: Replace dark circles with white circles, which represent determinate solutions and only one or completely disjoint transitions.

Conclusion n Fun. State model allows internal representation of complex heterogeneous system behavior. Can

Conclusion n Fun. State model allows internal representation of complex heterogeneous system behavior. Can easily be used to relate other models of computation. Hierarchy and step-wise refinement can be easily used to reduce nondeterminism.