Question: To execute the following assembly code segment using a 5 - stage MIPS pipelined processor, Instruction ID Instruction 1 lw $t 0 , 0 (

To execute the following assembly code segment using a 5-stage MIPS pipelined processor,
Instruction ID
Instruction
1
lw $t0,0($t1)
2
add $t2, $t0, $t2
3
addi $t3, $t2,8
4
lw $s0,0($s1)
5
add $s2, $s0, $s0
6
addi $s3, $s2,9
7
...
a. How many different data hazards can you find? Where are they (e.g. between ins_1 and ins_2)?
b. Suppose the processor had NO forwarding feature and the compiler could NOT reorder the instructions to avoid pipeline stalls, pipeline stall is the only approach to handle the data hazards. How many clock cycles it would take to execute the above code segment?
c. Suppose the processor had both the forwarding feature and instruction reordering feature, how many clock cycles it would take to execute the above code segment?
Write down the reordered instructor order and mark which hazards could be solved by forwarding, which hazard could be solved by recordering.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!