




















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth analysis of pipelining in ece 4436 and ece 5367, comparing single-cycle machines and pipelined multi-cycle machines. Topics covered include instruction execution time, structural and control hazards, stall on branch performance, and branch prediction. The document also discusses the impact of pipelining on mips and the elimination of data hazards through data forwarding.
Typology: Exams
1 / 60
This page cannot be seen from the preview
Don't miss anything!





















































Simple Pipelining Example^ Time
lw $10,20($1)sub $11,$2,$
Instruction
memory
Address
Add
Add result
Shiftleft 2
Instruction
0 Mux 1 Add
Writedata
1 Mux
Registers
Read data 1
Read data 2
Readregister 1Readregister 2
Sign extend
WriteregisterWritedata
Read
data
result
Mux
Zero
Instruction decode
lw $10, 20($1)
sub $11, $2, $3Instruction fetch
Instruction
memory
Address
Add
Add result
Shiftleft 2
Instruction
0 Mux 1 Add
Writedata
1 Mux
Registers
Read data 1
Read data 2
Readregister 1Readregister 2
Sign extend
WriteregisterWritedata
Read
data
result
Mux
Zero
lw $10, 20($1)Instruction fetch
Address
Data memory
Address
Data memory
Clock 1 Clock 2
lw $10,20($1)sub $11,$2,$
Instruction
memory
Address
Add
Add result
result
Zero
Shiftleft 2
Instruction
Write back
0 Mux 1 Add
Writedata
1 Mux
Registers
Read data 1
Read data 2
Readregister 1Readregister 2
Sign extend
Mux
Read
data
WriteregisterWritedata
lw $10, 20($1)
Instruction
memory
Address
Add
Add result
result
Zero
Shiftleft 2
Instruction
Write back
0 Mux 1 Add
Writedata
1 Mux
Registers
Read data 1
Read data 2
Readregister 1Readregister 2
Sign extend
Mux
Read
data
WriteregisterWritedata
sub $11, $2, $
Memory
sub $11, $2, $
Address
Data memory
Address
Data memory
Clock 5 Clock 6
Instruction
fetch
Reg
ALU
Data
access
Reg
8 ns
Instruction
fetch
Reg
ALU
Data
access
Reg
8 ns
Instruction
fetch
8 ns
Time
lw $1, 100($0)lw $2, 200($0)lw $3, 300($0)
2
4
6
8
10
12
14
16
18
2
4
6
8
10
12
14
...
Programexecutionorder(in instructions)
Instruction
fetch
Reg
A
LU
Data
access
Reg
Time
lw $1, 100($0)lw $2, 200($0)lw $3, 300($0)
2 ns
Instruction
fetch
Reg
A
LU
Data
access
Reg
2 ns
Instruction
fetch
Reg
A
LU
Data access
Reg
2 ns
2 ns
2 ns
2 ns
2 ns
Programexecutionorder(in instructions)
Structural Hazards
same time (such as reg. file, mem., or ALU)
Control Hazards
to fetch the next instruction. Results in stalls
Data Hazards
instruction. Unfortunately, the previousinstruction has not completed.
Control Hazard
WB
MEM
EX
ID/RF
IF
Control Hazard
Instruction
fetch
Reg
ALU
Data
access
Reg
Time
beq $1, $2, 40
add $4, $5, $
lw $3, 300($0)
4 ns
Instruction
fetch
Reg
ALU
Data
access
Reg
2ns
Instruction
fetch
Reg
ALU
Data
access
Reg
2ns
2
4
6
8
10
12
14
16
Programexecutionorder(in instructions)
Note: This is assuming we add a bunch of extra hardware so that we canresolve the branch test at the end of the second stage. (Which is not thecase in our machine.)
Branch Prediction
hardware)
WB
MEM
EX
ID/RF
IF
Branch Prediction
WB
MEM
EX
ID/RF
IF