Question: This exercise is intended to help you understand the relationship between forwarding, hazard detection, and ISA design. Problems in this exercise refer to the following

This exercise is intended to help you understand the relationship between forwarding, hazard detection, and ISA design. Problems in this exercise refer to the following sequence of instructions, and assume that it is executed on a 5-stage pipelined datapath:

add r5,r2,rl r3,4(r5) r2,0(r2) r3,r5,r3 r3,0(r5) 1 w 1w or SW

1. If there is no forwarding or hazard detection, insert nops to ensure correct execution.

2. Repeat 4.13.1 but now use nops only when a hazard cannot be avoided by changing or rearranging these instructions. You can assume register R7 can be used to hold temporary values in your modified code.

3. If the processor has forwarding, but we forgot to implement the hazard detection unit, what happens when this code executes?

4. If there is forwarding, for the first five cycles during the execution of this code, specify which signals are asserted in each cycle by hazard detection and forwarding units in Figure 4.60.

Hazard detection ID/EX.MemRead unit ID/EX wB EX/MEM Control M WB MEM/WB IF/ID EX WB Registers ALU- Instruction memory Da

5. If there is no forwarding, what new inputs and output signals do we need for the hazard detection unit in Figure 4.60? Using this instruction sequence as an example, explain why each signal is needed.

6. For the new hazard detection unit from 4.13.5, specify which output signals it asserts in each of the first five cycles during the execution of this code.

add r5,r2,rl r3,4(r5) r2,0(r2) r3,r5,r3 r3,0(r5) 1 w 1w or SW Hazard detection ID/EX.MemRead unit ID/EX wB EX/MEM Control M WB MEM/WB IF/ID EX WB Registers ALU- Instruction memory Data memory IF/ID.RegisterRs IF/ID.RegisterRt IF/ID.RegisterRt IF/ID.RegisterRd ID/EX.RegisterRt M. Rt Rs Rt Forwarding unit PCWrite IF/DWrile Instruction 5

Step by Step Solution

3.41 Rating (173 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 2 We can move up an instruction by swapping its place with another instruction that has no dependences with it so we can try to fill some NOP slots ... View full answer

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 Computer Organization Design Questions!