1 / 19

Scoreboarding Simulation

Scoreboarding Simulation. Advanced Computer Architecture Linda Wills Animation by: Chris Lee. What is Scoreboarding?.

berg
Download Presentation

Scoreboarding Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scoreboarding Simulation Advanced Computer Architecture Linda Wills Animation by: Chris Lee

  2. What is Scoreboarding? Scoreboarding is a technique used to prevent data and structural hazards. It does this by keeping relevant information stored in a data structure comprising of an instruction queue, a table of function unit status, and a table for register result status.

  3. Properties of Scoreboarding • Large data structure to hold relevant information • In-order issue, but out-of-order completion • Can issue an instruction when: • All earlier instructions have been issued • The needed functional unit is free • No other active instruction has the same destination register (WAW)

  4. Properties of Scoreboarding (Cont) • Reads operands when both become available • Executes the instruction when the instruction has been issued and both operands have been read • Writes result to destination register (Rd) after all pending instructions that have Rd as a source operand have read their operands (WAR).

  5. A Closer Look at Scoreboarding Tables • Three types of tables: • Instruction Queue Status • Keeps track of instructions and their progress. • Function Unit Status • Keeps track of what hardware is currently in use and what it will need to read from and write to. • Register Result Status • Tracks which functional unit is computing a register's value.

  6. Instruction Queue Status • Instruction Queue Status • Instruction (Operation, Resultant, Operand1, Operand2) • Issued - has the instruction been issued? • Op. Read - are both operands available and have they been read? • Ex. Cmpl. - Has the execution of this instruction completed yet? • Result - Has the result of this instruction been written back to the register?

  7. Function Unit Status • Function Unit Status • List of functional units • Busy - Is this functional unit currently executing? • Op - Operation is this functional unit performing • Dest - Name of destination register • Sop1, Sop2 - Source operand 1 and 2 respectively • Unit1, Unit 2 - Functional unit currently computing operand 1 and 2 respectively

  8. Register Result Status • Register Result Status • Keeps a list of all registers • Keeps a record of which functional unit is computing the value of this register.

  9. An Example We have the following program: LF F6,34(R2) LF F2,45(R3) MULTF F0,F2,F4 SUBF F8,F6,F2 DIVF F10,F0,F6 ADDF F6,F8,F2 Assume the initial state is that the first instruction has completed. The Second LF has just completed execution and is about to write its results.

  10. An Example (Cont) 4[+] 5[/] 2[*1] 3[*2] 1[i] 10 Cycles 10 Cycles 2 Cycles 40 Cycles 1 Cycle Suppose we have the following hardware: 1 ALU for integer operations (including loads and stores), called 1[i], with a latency of 1 cycle. 2 FP multiplication units, 2[*1] and 3[*2], with latencies of 10 cycles each. 1 FP addition and subtraction unit, 4[+], with a latency of 2 cycles 1 FP division unit, 5[/], with a latency of 40 cycles

  11. Which instructions can issue? Let’s issue as many as is allowed and fill in the status tables. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] Y Load F2 R3 * 2[*1] N 3[*2] N 4[+] N 5[/] N

  12. In this step, the MULTF was issued. The changes are noted in Red. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] Y Load F2 R3 * 2[*1] Y Mult F0 F2 F4 1[i] No Yes 3[*2] N 4[+] N 5[/] N

  13. In this step, the SUBF was issued. The changes are noted in Red. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] Y Load F2 R3 * 2[*1] Y Mult F0 F2 F4 1[i] No Yes 3[*2] N 4[+] Y Sub F8 F6 F2 1[i] Yes No 5[/] N

  14. In this step, the DIVF was issued. The changes are noted in Red. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] Y Load F2 R3 * 2[*1] Y Mult F0 F2 F4 1[i] No Yes 3[*2] N 4[+] Y Sub F8 F6 F2 1[i] Yes No 5[/] Y Div F10 F0 F6 2[*1] No Yes

  15. In this step, the ADDF was attempted but not issued. Why was this not issued? Answer Because there is no free floating point adding unit, this instruction cannot be issued at this time. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] Y Load F2 R3 * 2[*1] Y Mult F0 F2 F4 1[i] No Yes 3[*2] N 4[+] Y Sub F8 F6 F2 1[i] Yes No 5[/] Y Div F10 F0 F6 2[*1] No Yes

  16. The Second LF Writes Back The changes are noted in Red. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] N 2[*1] Y Mult F0 F2 F4 Yes Yes 3[*2] N 4[+] Y Sub F8 F6 F2 Yes Yes 5[/] Y Div F10 F0 F6 2[*1] No Yes

  17. * * The MULTF and SUBF can now read needed operands. The changes are noted in Red. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] N 2[*1] Y Mult F0 F2 F4 3[*2] N 4[+] Y Sub F8 F6 F2 * * 5[/] Y Div F10 F0 F6 2[*1] No Yes

  18. * * The SUBF instruction will complete before the MULTF. The changes are noted in Red. 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] N 2[*1] Y Mult F0 F2 F4 * * 3[*2] N 4[+] Y Sub F8 F6 F2 5[/] Y Div F10 F0 F6 2[*1] No Yes

  19. * * The SUBF Writes Results and Frees up FU4, Allowing I4 to be Issued. The changes are noted in Red. Question Which instruction should finish next? 2. Function Unit Status FU Busy Op Dest Sop1 Sop2 Unit1 Unit2 Rdy1 Rdy2 1[i] N 2[*1] Y Mult F0 F2 F4 No Yes 3[*2] N 4[+] Y Add F6 F8 F2 5[/] Y Div F10 F0 F6 2[*1] No Yes

More Related