
MOTOROLA
Chapter 7. Instruction Timing
7-19
Execution Unit Timings
7.4.1.2.1
Predicted Branch Timing Examples
Figure 7-6 shows how both taken and non-taken branches are handled and how the G2 core
handles both correct and incorrect predictions. The example shows the timing for the
following instruction sequence (note that the first
bc
instruction is correctly taken, whereas
the second
bc
is incorrectly predicted):
0
1
2
3
4
5
6
T0 add
T1 add
T2 add
T3 add
T4 and
T5 or
0. During clock cycle 0, instructions 0 and 1 are dispatched in the beginning of clock
cycle 1.
1. In clock cycle 1, instructions 2 and 3 are fetched in the IQ. Instruction 2 is a branch
instruction that updates the CTR and instruction 3 is a
mulhw
instruction on which
instruction 4 depends. Instruction 0 enters the IU. Instruction 1 has a single-cycle
stall.
2. In clock cycle 2, instructions 4 (a second
bc
instruction) and 5 are fetched. The
second
bc
instruction is predicted as taken. It can be folded, but it cannot be
resolved until instruction 3 writes back. Instruction 0 completes at the end of this
cycle. Instruction 1 is dispatched to the IU. Instruction 2 takes entry in the CQ.
3. In clock cycle 3, target instruction T0 and T1 are fetched. Instructions 1 and 2
complete, instruction 4 has been folded, and instruction 5 has been flushed from the
IQ. Instruction 3 is assigned to CQ2.
4. In clock cycle 4, target instructions T2 and T3 are fetched. IU instructions T0 and
T1 have multiple stalls as one execution possible in a clock cycle. Instruction 3 is
assigned to CQ0.
5. In clock cycle 5, instruction 3, on which the second branch instruction depended,
writes back and the branch prediction is proven incorrect. Even though T0 is in
CQ0, where it could be written back, it is not because the prediction was incorrect.
All target instructions are flushed from their positions in the pipeline at the end of
this clock cycle, as there are many results in the rename registers.
add
add
bc
mulhw
bc T0
fadd
and
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.