Question: Consider the following RISC V Code ( use this data for both ( a ) and ( b ) subparts: addi s 0 , zero,

Consider the following RISC V Code (use this data for both (a) and (b) subparts:
addi s0, zero, 2
L1:
lw t1,0(s1)
beq t1, s2, FD
addi s1, s1,4
addi s0, s0,-1
bne s0, zero, L1
jal zero, NFD
FD: addi s0, zero, 1
NFD: sw s0,0(s3)
[Assume that s1 contains 0x10010000, which is starting
address of an array which consists of words which are
powers of 2 till 16.
e.g.
0x00000001,0x00000002,0x00000004,...
0x00000010.
Assume s2 contains 0x00000002]
(a) Assume that normal 5-stage pipelined processor (discussed in class), which supports EX-to-EX and
MEM-to-EX forwarding and Hazard detection, is used to execute the above program. Assume the
processor uses predict not-taken static branch predictor. For each instruction, determine the clock cycle
(numbers) in which it enters IF, ID, EX, Mem and WB stage. If any instruction does not enter a particular
pipeline stage, then you can mark NA or in the corresponding column. If any instruction is executed
more than once, all the clock cycle numbers in which the instruction enters the pipeline stage should be
mentioned separated by a semicolon. [For example, if lw t1,0(s1) instruction enters instruction fetch twice
(because of looping) once in 2nd clock cycle and second time in 11th clock cycle then in the column
corresponding to IF you have to write 2; 11]

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!