• No results found

7.3.1

Stage Description

This chapter introduces a set of five new pipeline stages which, together with theMOUSETRAP stages presented in Section7.2, create a full suite of pipeline stages capable of implementing all the hierarchical constructs presented in Section 3.3. In particular, these new stages are needed to implement both speculative and non-speculative conditionals as well as pipelined loops. The names and a brief description of the behavior of each stage is listed below.

• conditional split: A conditional split stage is analogous to a router: it receives a data item from an input channel, and a Boolean value (select) from a second input channel. Based on the value of select, the data item is sent to one of the two output channels. In some applications, the Boolean select value and the data value could be bundled together onto the same channel (i.e., the data itself includes the routing information). In yet other applications, the select could be simply be a value provided by the system

without any handshaking (e.g., a global or external input, or a local value that changes infrequently). In these special cases, our proposed circuit implementation for the more general case can be simplified/optimized.

• conditional select: A conditional select stage is similar to an event multiplexer: it has two data input channels, and a third input channel that supplies a Boolean value (select). It has one output channel. The behavior is to first read the select channel; then, based on the value of select, read one of the two data channels, and send the result to the output channel. A value that is not selected is stored to be later sent out when the corresponding Boolean value arrives.

• conditional join: A conditional join is similar to a conditional select, except that all input channels are read even though data from only one of them is forwarded; data from the remaining input channels is discarded. Thus, the handshake behavior is identical to a simple 3-way pipeline join stage. The datapath operation is identical to a combinational multiplexor. This simple implementation waits for both inputs to arrive before sending out one and discarding the other.

• merge without arbitration: This pipeline stage has two input channels and one output channel. Data is read from whichever input channel has new data, and then sent to the output. No arbitration is provided; it is assumed that the input channels are mutually exclusive.

• arbitration stage: This pipeline stage performs arbitration between two input channels, and produces results on two output channels. Only one input channel is read at any time, and its value is sent to its corresponding output channel. This circuit can be combined with the merge without arbitration circuit above to produce a merge with arbitration.

S

IN(S) OUT(S)

Figure 7.4: A hierarchically composable single pipeline stage

7.3.2

Implementing Hierarchical Constructs

With the introduction of these new stages, all of the hierarchical constructs of Section 3.3 can be realized. This section lists the supported hierarchical constructs and describes their implementation usingMOUSETRAPstages. Figures from Section3.3are repeated here for the reader’s convenience.

Single Stage

The single stage construct

Figure7.4shows a single pipeline stage. A singleMOUSETRAPstage [55], as described in Section7.2, implements the single stage hierarchical component.

Sequential

c1 c2

seq

IN(seq) OUT(seq)

Figure 7.5: A hierarchically composable sequential component

Figure 7.5 shows a sequential component. This component does not need any special- purpose stages as part of its implementation, because all pipeline stages can potentially be composed together in sequence.

Parallel

Figure7.6 shows a parallel component. The fork and join stages displayed in the Figure are implemented by theMOUSETRAPfork and join stages [55] presented in Section7.2.

fork join c1 c2 IN(c1) IN(c2) OUT(c2) OUT(c1) par IN(par) OUT(par)

Figure 7.6: A hierarchically composable parallel component

Conditionals IN(c1) IN(c2) OUT(c2) OUT(c1) fork join c1 c2 cond IN(cond) OUT(cond) B IN(B)

Figure 7.7: A hierarchically composable parallel component with speculative conditional

The MOUSETRAPfork components [55] along with the new conditional join component can be used together to form the speculative conditional found in Figure 7.7. In particular, the MOUSETRAPfork stage [55] needs to be modified to have three rather than two parallel outputs, so it can be used as the fork stage of the speculative conditional. In addition, the conditional join—which was designed for use in a speculative conditional—will take signals from all three paths as input and send out the data that is selected by the Boolean value.

IN(c1) IN(c2) OUT(c2) OUT(c1) split merge c1 c2 cond buffer Boolean Boolean IN(cond) OUT(cond)

Figure 7.8: A hierarchically composable non-speculative conditional compo- nent

The implementation of a non-speculative conditional, as seen in Figure7.8, requires two of the newly designed stages. In particular, the conditional split and conditional select are designed to work together to implement an if-then-else construct without speculation. The conditional split first sends data along one of two paths, based on a Boolean value, thereby splitting one data stream into two. Subsequently, based on that Boolean value, the conditional select receives data from the correct path, thereby recombining the two data streams into one.

Iteration if dist counter arbiter c1 IN(c1) IN(c1) IN(c1) IN(loop) OUT(loop) loop

Figure 7.9: A hierarchically composable data-dependent loop component

As seen in Figure 7.9, the loop interface is made up of several stages, each of which requires a different implementation. A new data item entering the loop first arrives at the distributor stage, which sends the new item into the loop if the counter indicates that it is not already full. This joining of information between the incoming data and the counter can be implemented as aMOUSETRAPjoin stage.

The arbiter of the loop interface prevents collisions between data items that are entering the loop and data items that are already within the loop. It is implemented using two of the new stages that this section introduces: the arbitration stage and the merge without arbitration. In particular, the arbiter first chooses whether the new data arriving into the loop or the old data cycling through the loop arrived first. It then sends a signal out on exactly one of its outputs. The merge without arbitration takes in this signal and sends the data into the loop.

Finally, a conditional split implements the behavior of theif block in Figure7.9. Specifi- cally, it takes in a Boolean conditional that determines whether the data item is ready to leave and sends that item either out of the loop or back to the arbiter. Additionally, every time a data item leaves the ring, a signal should be sent to the counter that acts as a decrement.