Multimode Giotto Model

This (toy) example illustrates the use of a finite-state machine (implemented in the FSM domain) to get a modal Giotto model. The block diagram is given below:

This model contains three components, all of which have frequency one. The middle component is defined by the following FSM:

This state machine has three states and starts in state Init. The transition from Init to State0 is always enabled and will be taken in the first firing of the state machine. The actions on the transition properly initialize the refinement of State0. The guards on the transitions between State0 and State1 cause the transitions to be taken each time the input to the state machine is a multiple of 4. The guards read:

    in_isPresent && (in % 4 == 0)
which is interpreted as follows. The variable in_isPresent has value true when the input in is present. The variable in is the value of the input. The expression will be true when the input is a multiple of 4.

Each state refines to a separate instance of the following model:

In State1, the lower ramp has frequency 2, and therefore increments at twice the rate of the version in State0. This is the behavior exhibited by the plot above.