Work through the following snippet of code on your scratch p…
Work through the following snippet of code on your scratch paper, noting the state of the reservation stations and register file for each of the first 7 clock cycles (show as much or as little detail as you need to attain the correct answers, keeping in mind that partial credit can only be given for incorrect answers if you show the details and I can identify your mistakes.) You may assume that add/sub and load/store take 1 cycle for execution and mult/div instructions take 20 cycles for execution. For the register file and the Q fields, you may identify the instruction producing results being waited on with the instruction number. (HINT – remember the timing required for instructions waiting on operand values – the waiting instructions cannot begin execution on the same clock cycle that the instruction producing the operand value commits.) The state column represents the current execution state that the instruction is in. Possible states are: (I) Issue, (W) Waiting for operands, (R) Ready to execute (all operands are available), (E) Executing, and (C) Commit results. Note that an instruction may be in both Issued and Ready at the same time if all operands are available upon instruction issue. That instruction can go directly from Issued to Executing if other constraints are met (i.e., not all instructions will be in the Ready state specifically). The register file contains a starting value of r6 = 10. Please propagate all values through all subsequent clock cycles. Inst # Instruction Notes A1 load r4, 60(r6) # The value at memory location 60+r6 is 3 A2 add r4, r4, r6 # OP result, j, k (same format for all ALU Instr.) A3 load r2, 40(r6) # The value at memory location 40+r6 is 7 A4 mult r5, r2, r4 A5 store r5, 60(r3) # Assume the value of r3 = 20 For an example first clock cycle is completed for you. Cock cycle 1: Name Inst. # Vj Vk Qj Qk State Add/Sub 1 Mult/Div1 Name Inst. # Address V (for stores) Q (for stores) State Load/Store 1 A1 70 Load/Store 2 r0 r1 r2 r3 r4 r5 r6 A1 10 Answer the following questions: a) At which clock cycle, r4 will have a numeric value? (3 points) b) In which clock cycle, does instruction A3 begin execution? Provide a numeric value. (3 points) c) What clock cycle does r4 update to the value 13? (3 points) d) In which clock cycle, does instruction A4 begin execution? Provide a numeric value. (3 points) e) How many total clock cycles does the system take to complete execution, write all results back to the register file and/or memory, and leave all reservation stations empty? You don’t have to show all the clock cycles in your scratch pad to answer the question. (8 points)
Read Details