






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Make the pipelined processor work!
Data HazardsData Hazards
n Instruction having register R as source follows shortly after instruction having register R as destination
n Common condition, don’t want to slow down pipeline
Control HazardsControl Hazards
n Mispredict conditional branch
n Getting return address for ret instruction
Making Sure It Really WorksMaking Sure It Really Works
n What if multiple special cases happen simultaneously?
FetchFetch
n Select current PC
n Read instruction
n Compute incremented PC
DecodeDecode
n Read program registers
ExecuteExecute
n Operate ALU
MemoryMemory
n Read or write data memory
Write BackWrite Back
n Update register file
PC increment
PC increment
CCCC^ ALUALU
Data memory Data memory
Fetch
Decode
Execute
Memory
Write back
Register file Register file
A B (^) M E
Register file Register file
A B (^) M E valP
d_srcA, d_srcB
valA, valB
aluA, aluB
Bch valE
Addr, Data
valM
PC
W_icode, W_valM W_valE, W_valM, W_dstE, W_dstM
icode, ifun, rA, rB, valC
E
M
W
F
D
valP
f_PC
predPC
Instruction memory
Instruction memory
M_icode, M_Bch, M_valA
n Pipeline registers hold intermediate values from instruction execution
Forward (Upward) PathsForward (Upward) Paths
n Values passed from one stage to next
n Cannot jump past stages
E
M
W
F
D
Instruction memory
Instruction memory PC increment
PC increment
Register file
Register file
ALUALU
Data memory
Data memory
Select PC
rB
SelectA dstE dstM
ALU A ALU B
Mem. control
Addr
srcA srcB
read write
ALU fun.
Fetch
Decode
Execute
Memory
Write back
icode data out
data in
A B (^) M E
M_valA
W_valM W_valE
M_valA W_valM
d_rvalA
f_PC
Predict PC
valE valM dstE dstM
icode Bch valE valA dstE dstM
icode ifun valC valA valB dstE dstM srcA srcB
icode ifun rA valC valP
predPC
CC CC
d_srcA d_srcB
e_Bch
M_Bch
Data Dependencies: 2 Nop’s Data Dependencies: 2 Nop’s
0x000: irmovl $10,%edx
1 2 3 4 5 6 7 8 9
# demo-h2.ys^10
R[%eax]