![Infineon Technologies XC2200 User Manual Download Page 149](http://html1.mh-extra.com/html/infineon-technologies/xc2200/xc2200_user-manual_2055439149.webp)
XC2200 Derivatives
System Units (Vol. 1 of 2)
Central Processing Unit (CPU)
User’s Manual
4-11
V2.1, 2008-08
CPUSV2_X, V2.2
4.3
Instruction Processing Pipeline
The XC2200 uses five pipeline stages to execute an instruction. All instructions pass
through each of the five stages of the instruction processing pipeline. The pipeline stages
are listed here together with the 2 stages of the fetch pipeline:
1st -> PREFETCH:
This stage prefetches instructions from the PMU in the predicted
order. The instructions are preprocessed in the branch detection unit to detect branches.
The prediction logic decides if the branches are assumed to be taken or not.
2nd -> FETCH:
The instruction pointer of the next instruction to be fetched is calculated
according to the branch prediction rules. For zero-cycle branch execution, the Branch
Folding Unit preprocesses and combines detected branches with the preceding
instructions. Prefetched instructions are stored in the instruction FIFO. At the same time,
instructions are transported out of the instruction FIFO to be executed in the instruction
processing pipeline.
3rd -> DECODE:
The instructions are decoded and, if required, the register file is
accessed to read the GPR used in indirect addressing modes.
4th -> ADDRESS:
All the operand addresses are calculated. Register SP is
decremented or incremented for all instructions which implicitly access the system stack.
5th -> MEMORY:
All the required operands are fetched.
6th -> EXECUTE:
An ALU or MAC-Unit operation is performed on the previously fetched
operands. The condition flags are updated. All explicit write operations to CPU-SFRs
and all auto-increment/auto-decrement operations of GPRs used as indirect address
pointers are performed.
7th -> WRITE BACK:
All external operands and the remaining operands within the
internal DPRAM space are written back. Operands located in the internal SRAM are
buffered in the Write Back Buffer.
Specific so-called injected instructions are generated internally to provide the time
needed to process instructions requiring more than one CPU cycle for processing. They
are automatically injected into the decode stage of the pipeline, then they pass through
the remaining stages like every standard instruction. Program interrupt, PEC transfer,
and OCE operations are also performed by means of injected instructions. Although
these internally injected instructions will not be noticed in reality, they help to explain the
operation of the pipeline.
The performance of the CPU (pipeline) is decreased by bandwidth limitations (same
resource is accessed by different stages) and data dependencies between instructions.
The XC2200’s CPU has dedicated hardware to detect and to resolve different kinds of
dependencies. Some of those dependencies are described in the following section.
Because up to five different instructions are processed simultaneously, additional
hardware has been dedicated to deal with dependencies which may exist between
instructions in different pipeline stages. This extra hardware supports ‘forwarding’ of the
operand read and write values and resolves most of the possible conflicts — such as