| |||
| Home > Coprocessor Interface > Coprocessor pipeline > Pipeline control | |||
The coprocessor pipeline is very similar to the core pipeline, but lacks the Fetch stages. Instructions are passed from the core directly into the Decode stage of the coprocessor pipeline, which takes the form of a FIFO queue.
The Decode stage then decodes the instruction, rejecting non-coprocessor instructions and any coprocessor instructions containing a non-matching coprocessor number.
The length of any vectored data transfer is also decided at this point and sent back to the core. The decoded instruction then passes into the Issue (I) stage. This stage decides if this particular instance of the instruction can be accepted. If it cannot, because it addresses a non-existent register, the instruction is bounced, informing the core that it cannot be accepted.
If the instruction is both valid and executable, it then passes down the execution pipeline, Ex1 to Ex6. At the bottom of the pipeline, in Ex6, the instruction waits for retirement, which it can do when it receives a matching token from another queue fed by the core.
Figure 11.3 shows the coprocessor pipeline, the main fields within each stage, and the main control signals. Each stage controls the flow of information from the previous stage in the pipeline by passing its Enable signal back. When a pipeline stage is not enabled, it cannot accept information from the previous stage.
Each pipeline stage contains a decoded instruction, and a tag, plus a few status flags:
This flag is set whenever the pipeline stage contains an instruction.
This flag is set to indicate that the instruction in the stage is a phantom. See Cancel operations.
This flag is set to indicate that the instruction is the tail of an iterated instruction. See Loads.
There might also be other flags associated with the decoding of the instruction.
Each stage is controlled not only by its own state, but also by external signals and signals from the following state, as follows:
This signal prevents the stage from accepting a new instruction or passing its own instruction on, and only affects the D, I, Ex1, and Ex6 stages.
This signal indicates that the instruction in the stage must be iterated in order to implement a multiple load or store and only applies to the Issue stage.
This signal indicates that the next stage in the pipeline is ready to accept data from the current stage.
These signals are combined with the current state of the pipeline to determine if the stage can accept new data, and what the new state of the stage is going to be. Table 11.3 shows how the new state of the pipeline stage is derived.
Table 11.3. Pipeline stage update
| Stall | Enable input | Iterate | State | Enable | To next stage | Remarks |
|---|---|---|---|---|---|---|
| 0 | 0 | X | Empty | 1 | None | Bubble closing |
| 0 | 0 | X | Full | 0 | - | Stalled by next stage |
| 0 | 1 | 0 | Empty | 1 | None | Normal pipeline movement |
| 0 | 1 | 0 | Full | 1 | Current | Normal pipeline movement |
| 0 | 1 | 1 | Empty | - | - | Impossible |
| 0 | 1 | 1 | Full | 0 | Current | Iteration (I stage only) |
| 1 | X | X | X | 0 | None | Stalled (D, I, Ex1, and Ex6 only) |
The Enable input comes from the next stage in the pipeline and indicates if data can be passed on. In general, if this signal is unasserted the pipeline stage cannot receive new data or pass on its own contents. However, if the pipeline stage is empty it can receive new data without passing any data on to the next stage. This is known as bubble closing, because it has the effect of filling up empty stages in the pipeline by enabling them to move on while lower stages are stalled.