Here's part of last year's midterm.
Consider the instructions Jump (J), Jump Register (JR), Branch, Integer, FP, Load, and Store.
Consider a Tomosulo pipeline (similar to PowerPC 620 in text) with stages IF, ID, IS (the process of moving instructions to reservation stations), EX (1 cycle integer, 2-cycle LSU, 3-cycle FP mult or add), and WB (commit). There is one integer unit with two reservation stations (I1, I2), 1 FP unit with two reservation stations (F1, F2), 1 Load/Store unit with two reservation stations (LS1, LS2), and one Branch unit with 2 reservation stations (B1, B2) that takes 1 cycle.
Indicate the clock cycle for each of the following instructions would be in the various stages. Assume 1 instruction issue per cycle and serparate FP and integer result busses. Assume that
In the RS# column indicate the reservation station slot (e.g., F1, I2, B1) that was used. For an instruction already in a reservation station, EX1 can commence during the same cycle as the common data bus write in WB. EX2 and EX3 are not used for all instructions -- leave blank for those that do not need them. A new instruction can be loaded into a reservation station when the old one is in WB -- WB and IS can overlap.
| IF | ID | IS | EX1 | EX2 | EX3 | WB | RS # | |
| foo: LD F2, 0(R1) | ||||||||
| MULTD F5, F2, F2 | ||||||||
| MULTD F4, F5, F0 | ||||||||
| LD F6, 0(R2) | ||||||||
| ADDD F6, F4, F6 | ||||||||
| SD 0(R2), F6 | ||||||||
| ADDI R1, R1, #8 | ||||||||
| ADDI R2, R2, #8 | ||||||||
| SGTI R3, R1, done | ||||||||
| BNEQZ R3, foo |
Spare diagram:
| IF | ID | IS | EX1 | EX2 | EX3 | WB | RS # | |
| foo: LD F2, 0(R1) | ||||||||
| MULTD F5, F2, F2 | ||||||||
| MULTD F4, F5, F0 | ||||||||
| LD F6, 0(R2) | ||||||||
| ADDD F6, F4, F6 | ||||||||
| SD 0(R2), F6 | ||||||||
| ADDI R1, R1, #8 | ||||||||
| ADDI R2, R2, #8 | ||||||||
| SGTI R3, R1, done | ||||||||
| BNEQZ R3, foo |