Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

DOUBLE CPU Data Hazard

Gnemuri

Newbie
Joined
Jun 25, 2023
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
16
Hello Everyone, 😄
I'm studying the 5 Stages Pipelined version of Mips, but I got lost in this double data hazard example.
I'm pasting you what the book says about this:


"One complication is potential data hazards between the result of the instruction in the WB stage, the result of the instruction in the MEM stage, and the source operand of the instruction in the ALU stage. For example, when summing a vector of numbers in a single register, a sequence of instructions will all read and write to the same register:

add $1,$1,$2
add $1,$1,$3
add $1,$1,$4

In this case, the result is forwarded from the MEM stage
because the result in the MEM stage is the more recent result."



But why am i forwarding from the MEM Stage? If i try to execute the three instructions, I've got a data hazard at Clock Cicle 4 when the Instrucion 2 is in the EX stage, and in the Clock Cicle 5 when the Instruction 3 is from in its EX Stage.
So in my mind the solution is to:
Forward from the I1 to I2 at CC4 (Clock Cicle 4)
Forward from the I2 to I3 at CC5
But this would happen from EX/MEM stage in both cases, differently from the solution of the book.
Can anybody help me please?

Thank you in advance!
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top