In this question, we examine how data dependences affect execution in the basic 5-stage pipeline for code below
sub $t0, $t1,$t5
lw $t0, 0($t1)
add $t2, $t0,$t6
add $t7,$t2,$t0
Assume the following cycle times for each of the without forwarding and full forwarding.
Without Forwarding
With Full Forwarding
250ps
300ps
a. Assume there is no forwarding in this pipelined processor. Indicate hazards and add NOP instructions to eliminate them and rewrite these instructions with the NOP instructions in your answer.
b. Assume there is full forwarding. Indicate hazards and add NOP instructions to eliminate them and rewrite these instructions with the NOP instructions in your answer.
b. Assume there is ALU-ALU forwarding. Indicate hazards and add NOP instructions to eliminate them and rewrite these instructions with the NOP instructions in your answer.
d. What is the total execution time of this instruction sequence without forwarding and with full forwarding? What is the speedup achieved by adding full forwarding to a pipeline that had no forwarding?
Note:
Speedup is not the difference in two timings. Consider two execution times t1 = 200 ns and t2 = 150 ns.
The speed up is ratio of Higher Time(Slower Execution) / Lower Time(Faster Execution). Thus, speedup = 200/150(Unit needs to be same - in this case nanoseconds) = 1.33