AG VLSI Design and Architecture

SFB 501 - Project D1: Application System "Buildings"

PSiGene

Pattern Catalog

[PSiGene]

11.1 Pattern Statemachine

Intent

This pattern adds the ability to an object, to act differently in different states, and to let these states be changed from outside via events.

Also Known As

Endlicher Automat [Nol99]

Motivation

This pattern is aimed to be a frontend to generation of statemachines, that follow a notation as described in [Nol99] . The statemachine is given as a file, that is read during generation of the according support structures.

After modelling a statemachine (e.g. with a certain editor but also via conversion from sdl), this pattern can be used to apply the modelled statemachine to the class hierarchy to deine the reactive behaviour of a class.

Applicability

There is no general limitation in applying this pattern. however certain bindings (e.g. ParallelMachine to parallelity) may need certain support structures to exist (in that case: activeObject).

Using multiple statemachines with one object class and inappropriate bindings to parallelity , accumulation , init and establish may cause unexpected behaviour.

Structure

This pattern is mainly a frontend: it aggregates subpatterns for generation of object side elements (given via parameters parallelity and accumulation ) on the one hand and a bundle of subpatterns for the generation of the different states.

Currently the only generation activity performed by this pattern is creation of an own Statemachine class and provide a list of possible states for it.

Participants

Objects:
Relations:
Attributes:
Methods:
Expressions:

Collaborations

The different subclasses of MachineParallelity may be used as parameter to parallelity to influence the parallelity behaviour of the statemachines of an object. The different subclasses of StatesInterface have the same purpose for the ability of using one or more statemachine in one object; they are used via the accumulation directive. In a similar way the different Substate subclasses (applied via the parameter statesgeneration ) control the style, code is generated in. While for MachineParallelity and StatesInterface subclasses there is aggregated exactly one subpattern for each Statemachine pattern, the number of aggregated Substate subclass aggregations depends on the number of states in the statemachine.

Consequences

As stated above, this pattern can be added to nearly every object in the model. Indeed it should be used rarely as it creates some overhead for each active object.

Applicating this pattern, the SimulatorKernel described in [Hei96] must be implemented into the system. This kernel serves all used functionality for event- and thread-handling.

Implementation

Please have a look into the source and the code templates. And read the documentation of the merely aggregated subpatterns used (not in this catalogue).

Related Patterns

ActuatorServer, ContinuousComputation, (ConvenientPattern, Substate, StatesInterface, MachineParallelity)

PEdit description

 


previous page next page up   Table of Contents PSiGene