Question: You are given the following RISC - V assembly code. lw t 0 , 0 ( t 1 ) lw s 1 , 0 (

You are given the following RISC-V assembly code.
lw t0,0(t1)
lw s1,0(s0)
addi t0, t0,1
add t2, t0, t1
add s2, s2, s2
addi s1, s1,1
add s3, s2, s1 Suppose the code is executing on a RISC-V processor with a 5-stage pipeline, without support for forwarding, but with support for hazard detection. The processor uses stall cycles (nops) to resolve data hazards. How many stall cycles (nops) will the code incur? How many cycles does the code take to execute on this processor? Assume execution starts with an empty pipeline. Suppose the code is executing on a RISC-V processor with a 5-stage pipeline, with support for forwarding and hazard detection. How many stall cycles (nops) will the code incur? How many cycles does the code take to execute on this processor? Assume execution starts with an empty pipeline. What is the speedup of the processor with forwarding and hazard detection compared to the processor without forwarding? Round your answer to two digits.

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 Databases Questions!