Question: Problem 6 Consider the following RISC - V code running on the standard 5 - stage pipeline. LW x 2 , 4 ( x 3
Problem
Consider the following RISCV code running on the standard stage pipeline.
LW xx ;; Instruction X
SW xx ;; Instruction A
OR x x x ;; Instruction B
BEQ x x L ;; Instruction C
OR x x x ;; Instruction D
L: ADD x x x ;; Instruction E
Parta Identify all control and RAW data hazards. If you think there is a RAW data hazard between instructions A and B due to register x then you should say
A B RAW Data Hazard on Register x
You will get point for each wrong answer to prevent random guessing andor listing all dependencies hoping some would be correct.
Part b Rewrite the above program inserting the minimum number of NOPs stalls so that the program runs correctly on the stage RISCV pipeline that does NOT have any forwarding logic. However, the register file is written in first half of the cycle and read in the second half of the cycle. You can assume that branches are resolved in ID stage, which means the register comparison and computation of the branch target address takes place in ID stage, and the correct instruction is available in the following cycle. There is NO branch prediction.
Part c Now assume with full forwarding and branch prediction we eliminated ALL the stallsNOPS What is the average CPI of the program?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
