Professional Documents
Culture Documents
Assignment 2 - Solution
Assignment 2 - Solution
Assignment 2
Q1: (1 point) Execute the following assembly code on a MC FP MIPS pipeline and complete the table with stall detection and with data forwarding. This
version uses ROB, instruction queue, and memory enhancement (i.e., only integer unit goes through memory stage). Observe the following lengths of
execution stage for different FUs.
2 DIV.D F5, F2, F4 7,8-9 10-29 30 Waiting for Branch hazard (branch outcome)
2 L.D F5, 0(R3) 8,9 10-11 12 Branch hazard (Waiting for branch outcome)
2 MUL.D F2, F4, F5 9, 10-12 13-22 23 RAW (F5) FROM L.D
2 ADD.D F4, F5, F3 10, 11-12 13-14 15 RAW (F5) FROM L.D
2 DADDI R3, R3, -8 11 12 13
2 BNEZ R3, Loop 12, 13 14 15, 16 RAW(R3), STRUCTU (CDB)
Q4 (1.5 points): Complete the following table for two iterations of a loop using Tomasulo’s algorithm. Assume that there is no inter-loop dependence of
instructions and we can do speculative execution with ROB. Register all stalls in the comments column. Assume we have infinite no. of reservation stations
available with us. Observe the following lengths for execution stage.