Question: Problem 1 Consider the following MIPS code. I 0 : Iw $s 1 , 0 ( $s 2 ) 1 1 : add $ s
Problem
Consider the following MIPS code.
I: Iw $s$s
: add $$$ # $s: $s $s
: beq $$ # if $s $s goto L
: Iw $$
: $$
: L: sw $$
A Suppose a MIPS processor uses the simple stage pipeline, where the stages are instruction fetch IF instruction decode and operand fetch ID execute and calculate address
EX memory access M and write back WB In addition, suppose that:
The instruction and data cache are unified and can only support one read or write or instruction fetch operation each cycle.
The pipeline does not have "forwarding" hardware. Thus, if an instruction relies on a value written into a register by an instruction i then the execute stage for
cannot proceed until the register write stage for i has completed.
In the absence of hazards, a new instruction can be fed to the pipeline every cycle.
Assume the branch is not taken.
How many cycles does this code take to complete? Use the table below.
cycles
B Suppose that the MIPS processor with the stage pipeline from part A In addition, suppose that:
The instruction and data caches are split.
The pipeline has hazard detection and forwarding.
Branches stall cycle if one of the test registers is the destination of the immediately preceding arithmetic or logic instruction.
How many cycles does this code take to complete? Use the table below.
cycles
C Suppose now that the Execution stage of the pipeline is split into two stages E and E and that instruction cannot use E until instruction i has released E or more
general E cannot be used again until E is finished processing. Using the assumptions from part B how many cycles does this code take to complete? Use the table below.
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
