XC2200 Derivatives
System Units (Vol. 1 of 2)
Central Processing Unit (CPU)
User’s Manual
4-5
V2.1, 2008-08
CPUSV2_X, V2.2
In general the instructions move through 7 pipeline stages, where each stage processes
its individual task (see
for a summary):
•
the 2-stage fetch pipeline prefetches instructions from program memory and stores
them into an instruction FIFO
•
the 5-stage processing pipeline executes each instruction stored in the instruction
FIFO
Because passing through one pipeline stage takes at least one clock cycle, any isolated
instruction takes at least five clock cycles to be completed. Pipelining, however, allows
parallel (i.e. simultaneous) processing of up to five instructions (with branches up to six
instructions). Therefore, most of the instructions appear to be processed during one
clock cycle as soon as the pipeline has been filled once after reset.
The pipelining increases the average instruction throughput considered over a certain
period of time.
4.2
Instruction Fetch and Program Flow Control
The Instruction Fetch Unit (IFU) prefetches and preprocesses instructions to provide a
continuous instruction flow. The IFU can fetch simultaneously at least two instructions
via a 64-bit wide bus from the Program Management Unit (PMU). The prefetched
instructions are stored in an instruction FIFO.
Preprocessing of branch instructions enables the instruction flow to be predicted. While
the CPU is in the process of executing an instruction fetched from the FIFO, the
prefetcher of the IFU starts to fetch a new instruction at a predicted target address from
the PMU. The latency time of this access is hidden by the execution of the instructions
which have already been buffered in the FIFO. Even for a non-sequential instruction
execution, the IFU can generally provide a continuous instruction flow. The IFU contains
two pipeline stages: the Prefetch Stage and the Fetch Stage.
During the prefetch stage, the Branch Detection and Prediction Logic analyzes up to
three prefetched instructions stored in the first Instruction Buffer (can hold up to six
instructions). If a branch is detected, then the IFU starts to fetch the next instructions
from the PMU according to the prediction rules. After having been analyzed, up to three
instructions are stored in the second Instruction Buffer (can hold up to three instructions)
which is the input register of the Fetch Stage.
In the case of an incorrectly predicted instruction flow, the instruction fetch pipeline is
bypassed to reduce the number of dead cycles.