Hierarchical Giotto Model

This example has no interesting functionality, but carefully illustrates the semantics of Giotto, and is easy to follow. It is defined by the following block diagram:

The model consists of a constant source that produces the value 1, a pair of composites that function as accumulators, simply adding the current value to a running sum, and a plotter. The source and the upper composite run at frequency 1, meaning that they get invoked once per iteration. The lower composite and the plotter run at frequency 2, meaning that they are invoked twice per iteration.

The composites are defined as follows:

They contain an adder that adds the current input to the previous output, in a feedback loop. This illustrates the Giotto semantic property that on each arc, the output value from the previous iteration is available.

The composite has a parameter, internalFrequency, which sets the frequency of each adder. The upper composite has this frequency set to 3, and the lower has it set to 2. Because of this, each invocation of the upper composite adds 3 to the running sum, and each invocation of the bottom composite adds 2 to its running sum. The upper composite is invoked half as often as the plotter, which is why its output values are each plotted twice.