3.3 A Hierarchical Model for Asynchronous Systems
3.3.2 Supported Hierarchical Constructs
This section lists the hierarchical constructs that will be used throughout this dissertation: a single stage, sequential constructs, parallel constructs, conditionals, and iteration. For each construct, this section describes its behavior and illustrates its structure; this is sufficient in- formation to understand the use of these constructs in the remainder of this dissertation. For the reference of readers wishing to implement dataflow analysis using these components, an equation for the IN set of each component is also listed. Given a system that has a known hi- erarchical structure, using these equations obviates the need to run time-consuming dataflow algorithms while ensuring that each stage receives all the necessary data and no unnecessary data.
S
IN(S) OUT(S)
Figure 3.17: A hierarchically composable single pipeline stage
A Single Stage
The single pipeline stage is the building block of all the hierarchical components. Figure3.17 shows a graphical representation of a single stage. The stage has one passive port for input and one active port for output.
The IN set of the stage, IN(S), is the set of values used in stageSin addition to the set of values used by components connected at its output port, less the set of values that are assigned new values by that stage (i.e.the killed values.) The out set of S can be computed only when the next stage in the hierarchy is known, and is equivalent to the IN set of the component connected at the output port. For reference, the equation for calculating the IN set of a single stage is shown below:
IN(S) =use(S)∪out(S)∩ ¬killed(S)
Sequential
The sequential component takes two other hierarchically composable components and at- taches the output port of one to the input port of the other in sequence. Figure 3.18 shows a graphical representation of the hierarchically composable sequential component. The two blocks,c1andc2, in the figure each represent any possible choice of hierarchical component.
c1 c2
seq
IN(seq) OUT(seq)
Figure 3.18: A hierarchically composable sequential component
The overall behavior of this component is to first route data through component c1, and then route the output of that computation to the input of c2. The IN set of the sequential
component can be computed using the IN sets of the two component parts.
IN(seq) =use(c1)∪(use(c2)∩ ¬killed(c1))∪(out(seq)∩ ¬killed(c1)∩ ¬killed(c2))
Parallel
The parallel component takes two other hierarchically composable components and connects them using fork and join stages. Figure3.19shows a graphical representation of the parallel construct. The two outputs of the fork stage are attached to the respective input ports of the sub-components, c1 and c2. Similarly, the two inputs of the join stage are attached to the respective output ports of the sub-components.
fork join c1 c2 IN(c1) IN(c2) OUT(c2) OUT(c1) par IN(par) OUT(par)
Figure 3.19: A hierarchically composable parallel component
Overall, the behavior of a parallel component is to route incoming data to both components
c1andc2simultaneously. The fork stage sends exactly one data item toc1for each data item it sends toc2, and the join stage waits to receive data from bothc1andc2before it can send data along further.
The IN set of a parallel component is a combination of the use sets of the two components and the out set.
IN(seq) =use(c1)∪use(c2)∪(out(par)∩ ¬kill(c1)∩ ¬kill(c2))
Conditionals
A conditional (i.e. if/then/else ) construct can be implemented hierarchically in one of two ways. A speculative conditional, as seen in Figure3.20, is implemented as a parallel construct with three branches: the two computation branches and one branch to compute the Boolean
value. All branches operate in parallel, and both c1 andc2produce data to send to the join stage. The join stage has logic functionality that uses the value of the computed Boolean to determine which values to send on and which to discard. In later chapters of this thesis, the speculative conditional is not treated as a special case, but instead is analyzed just as any parallel component. IN(c1) IN(c2) OUT(c2) OUT(c1) fork join c1 c2 cond IN(cond) OUT(cond) B IN(B)
Figure 3.20: A hierarchically composable parallel component with speculative conditional
Conditionals can also be implemented non-speculatively. That is, the data is sent in either thethenpath or theelsepath, but not both simultaneously. Figure3.21, shows an implemen- tation of a non-speculative conditional. The Boolean value must be pre-computed and passed into the component, rather than being computed within the conditional.
IN(c1) IN(c2) OUT(c2) OUT(c1) split merge c1 c2 cond buffer Boolean Boolean IN(cond) OUT(cond)
Figure 3.21: A hierarchically composable non-speculative conditional compo- nent
The behavior of the conditional is to wait for the Boolean value and the data value before sending the data to either component c1 or component c2. The Boolean value is also sent along a buffered path with no computation to the merge stage, which uses it to select a data value to send out.
The IN set for a non-speculative conditional can be computed from the in sets of the two sub-components,c1andc2, and also includes the pre-computed Boolean value.
IN(cond) =use(c1)∪use(c2)∪(out(par)∩ ¬(kill(c1)∩kill(c2)))∪Bool
Iteration
The loop component, which is discussed in more detail in Section 5.3.3 implements an al- gorithmic loop. Figure 3.22 gives a graphical representation of a pipelined loop. The loop connects a hierarchical componentc1to a loop interface that handles the entry and exit of the data. The IN set for the loop is the same as the IN set for componentc1.
if dist counter arbiter c1 IN(c1) IN(c1) IN(c1) IN(loop) OUT(loop) loop
Figure 3.22: A hierarchically composable data-dependent loop component