A hazard we did not deal with in HW12 is the modify-store hazard, which occurs when a store instruction stores a value that was modified in the previous few instructions. You specifically need to handle the cases where the value was modified in the instruction 1 before or 2 before the store instruction. For example
add r1, r0, r0 sw r1, 4(r3)
add r1, r0, r0 sub r2, r3, r0 sw r1, 2(r3)
(r1=r0+r0) (r2=r3-r0) (mem[2+r3]=r1
You willmodify the provided pipeline-start.circ Logisim file to add handling of this hazard. You should NOT handle any other hazards or cases besides the 2 described above. You may not start with your solution to HW12, you must use my start file or grading will be impossible. The provided circuit handles the basic pipeline datapath with the addition of the NOP instruction. It also handles pipeline startup by sending a NOP through from the initial decode stage, then the actual instructions for the rest of the run.
Your program should work no matter what the first few instructions are, or what instructions precede the store. For example, a store after a NOP or branch should not forward from that previous instruction, though it still may forward from the instruction 2 previous if appropriate. Also, your program should be able to start with any instruction from the implemented set of instructions, e.g. add r0, r0, r0.