1 / 44

MS108 Computer System I

MS108 Computer System I. Lecture 6 Scoreboarding Prof. Xiaoyao Liang 2014/3/17. Complex Pipeline. Floating Point ISA. FPU. Pipeline FPU. FP Multiplier Pipeline. Memory Timing. Pipeline Timing. Structure Hazard. Data Hazards. Detecting the Hazards. Memory Hazards.

yovela
Download Presentation

MS108 Computer System I

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. MS108 Computer System I Lecture 6 Scoreboarding Prof. Xiaoyao Liang 2014/3/17

  2. Complex Pipeline

  3. Floating Point ISA

  4. FPU

  5. Pipeline FPU

  6. FP Multiplier Pipeline

  7. Memory Timing

  8. Pipeline Timing

  9. Structure Hazard

  10. Data Hazards

  11. Detecting the Hazards

  12. Memory Hazards

  13. Instruction Scheduling

  14. Dynamic Pipeline

  15. Dynamic Scheduling

  16. Two Solutions

  17. CDC 6600, Seymour Cray, 1963

  18. Scoreboard

  19. Hazards for Dynamic Pipeline

  20. Scoreboard

  21. MIPS Scoreboard

  22. Pipeline with Scoreboard

  23. Scoreboard Components

  24. Example

  25. Dependency Graph

  26. Scoreboard Example: Cycle 1 FP Latency: Add = 2 cycles, Multiply = 10, Divide = 40 Instruction status Read Execution Write Instruction j k Issue operands complete Result L.D F6 34+ R2 1 L.D F2 45+ R3 MUL.D F0 F2 F4 SUB.D F8 F6 F2 DIV.D F10 F0 F6 ADD.D F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F6 R2 Yes Mult1 No Mult2 No Add No Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 1 FU Integer

  27. Scoreboard Example: Cycle 2 FP Latency: Add = 2 cycles, Multiply = 10, Divide = 40 Instruction status Read Execution Write Instruction j k Issue operands complete Result L.D F6 34+ R2 1 2 L.D F2 45+ R3 MUL.D F0 F2 F4 SUB.D F8 F6 F2 DIV.D F10 F0 F6 ADD.D F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F6 R2 Yes Mult1 No Mult2 No Add No Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 2 FU Integer • Issue second L.D? No, stall on structural hazard

  28. Scoreboard Example: Cycle 3 Instruction status Read Execution Write Instruction j k Issue operands complete Result L.D F6 34+ R2 1 2 3 L.D F2 45+ R3 ? MUL.D F0 F2 F4 SUB.D F8 F6 F2 DIV.D F10 F0 F6 ADD.D F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F6 R2 Yes Mult1 No Mult2 No Add No Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 3 FU Integer • Issue MUL.D? In-order issue !!!

  29. Scoreboard Example: Cycle 4 Instruction status Read Execution Write Instruction j k Issue operands complete Result L.D F6 34+ R2 1 2 3 4 L.D F2 45+ R3 MUL.D F0 F2 F4 SUB.D F8 F6 F2 DIV.D F10 F0 F6 ADD.D F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F6 R2 Yes Mult1 No Mult2 No Add No Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 4 FU Integer

  30. Scoreboard Example: Cycle 5 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 5 F2 45+ R3 F0 F2 F4 F8 F6 F2 F10 F0 F6 F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F2 R3 Yes Mult1 No Mult2 No Add No Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 5 FU Integer

  31. Scoreboard Example: Cycle 6 Instruction status Read Execution Write Instruction j k Issue operands complete Result L.D F6 34+ R2 1 2 3 4 L.D F2 45+ R3 5 6 MUL.D F0 F2 F4 6 SUB.D F8 F6 F2 DIV.D F10 F0 F6 ADD.D F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F2 R3 Yes Yes Mult F0 F2 F4 Integer No Yes Mult1 Mult2 No Add No Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Integer 6 FU

  32. Scoreboard Example: Cycle 7 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 F0 F2 F4 6 7 F8 F6 F2 F10 F0 F6 F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F2 R3 Yes Yes Mult F0 F2 F4 Integer No Yes Mult1 Mult2 No Yes Sub F8 F6 F2 Integer Yes No Add Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Add Integer 7 FU • Read multiply operands?

  33. Scoreboard Example: Cycle 8a(First half of cycle 8) L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 F0 F2 F4 6 7 F8 F6 F2 8 F10 F0 F6 F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer Yes Load F2 R3 Yes Yes Mult F0 F2 F4 Integer No Yes Mult1 Mult2 No Yes Sub F8 F6 F2 Integer Yes No Add Yes Div F10 F0 F6 Mult1 No Yes Divide Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Add Divide Integer 8 FU

  34. Scoreboard Example: Cycle 8b(Second half of cycle 8) L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 7 F8 F6 F2 8 F10 F0 F6 F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No Yes Mult F0 F2 F4 Yes Yes Mult1 Mult2 No Yes Sub F8 F6 F2 Yes Yes Add Yes Div F10 F0 F6 Mult1 No Yes Divide Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Add Divide 8 FU

  35. Scoreboard Example: Cycle 9 L.D L.D MUL.D SUB.D DIV.D ADD.D FP Latency: Add = 2 cycles, Multiply = 10, Divide = 40 Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 7 9 F8 F6 F2 8 F10 F0 F6 ? F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No Yes Mult F0 F2 F4 Yes Yes 10 Mult1 Mult2 No Yes Sub F8 F6 F2 Yes Yes 2 Add Yes Div F10 F0 F6 Mult1 No Yes Divide Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Add Divide 9 FU • Read operands for MUL.D & SUB.D? Issue ADD.D?

  36. Scoreboard Example: Cycle 11 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 7 9 11 F8 F6 F2 8 F10 F0 F6 F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No Yes Mult F0 F2 F4 Yes Yes 8 Mult1 Mult2 No Yes Sub F8 F6 F2 Yes Yes 0 Add Yes Div F10 F0 F6 Mult1 No Yes Divide Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Add Divide 11 FU

  37. Scoreboard Example: Cycle 12 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 7 9 11 12 F8 F6 F2 8 F10 F0 F6 F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No Yes Mult F0 F2 F4 Yes Yes 7 Mult1 Mult2 No No Add Yes Div F10 F0 F6 Mult1 No Yes Divide Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Divide 12 FU • Read operands for DIV.D?

  38. Scoreboard Example: Cycle 13 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 7 9 11 12 F8 F6 F2 8 F10 F0 F6 13 F6 F8 F2 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No Yes Mult F0 F2 F4 Yes Yes 6 Mult1 Mult2 No Yes Add F6 F8 F2 Yes Yes Add Yes Div F10 F0 F6 Mult1 No Yes Divide Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock Mult1 Add Divide 13 FU

  39. Scoreboard Example: Cycle 17 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 F8 F6 F2 7 9 11 12 F10 F0 F6 8 ? F6 F8 F2 13 14 16 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No 2 Mult1 Yes Mult F0 F2 F4 Yes Yes Mult2 No Add Yes Add F6 F8 F2 Yes Yes Divide Yes Div F10 F0 F6 Mult1 No Yes Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 17 FU Mult1 Add Divide • Write result of ADD.D? No, WAR hazard

  40. Scoreboard Example: Cycle 20 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 19 20 F8 F6 F2 7 9 11 12 F10 F0 F6 8 F6 F8 F2 13 14 16 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No No Mult1 Mult2 No Add Yes Add F6 F8 F2 Yes Yes Divide Yes Div F10 F0 F6 Yes Yes Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 20 FU Add Divide

  41. Scoreboard Example: Cycle 21 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 19 20 F8 F6 F2 7 9 11 12 F10 F0 F6 8 21 F6 F8 F2 13 14 16 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No No Mult1 Mult2 No Add Yes Add F6 F8 F2 Yes Yes Divide Yes Div F10 F0 F6 Yes Yes Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 21 FU Add Divide

  42. Scoreboard Example: Cycle 22 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 19 20 F8 F6 F2 7 9 11 12 F10 F0 F6 8 21 F6 F8 F2 13 14 16 22 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No No Mult1 Mult2 No Add No 40 Divide Yes Div F10 F0 F6 Yes Yes Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 22 FU Divide

  43. Scoreboard Example: Cycle 61 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 19 20 F8 F6 F2 7 9 11 12 F10 F0 F6 8 21 61 F6 F8 F2 13 14 16 22 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No No Mult1 Mult2 No Add No 0 Divide Yes Div F10 F0 F6 Yes Yes Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 61 FU Divide

  44. Scoreboard Example: Cycle 62 L.D L.D MUL.D SUB.D DIV.D ADD.D Instruction status Read Execution Write Instruction Block done Instruction j k Issue operands complete Result F6 34+ R2 1 2 3 4 F2 45+ R3 5 6 7 8 F0 F2 F4 6 9 19 20 F8 F6 F2 7 9 11 12 F10 F0 F6 8 21 61 62 F6 F8 F2 13 14 16 22 Functional unit status dest S1 S2 FU for j FU for k Fj? Fk? Time Name Busy Op Fi Fj Fk Qj Qk Rj Rk Integer No Mult1 No Mult2 No Add No 0 Divide No Register result status F0 F2 F4 F6 F8 F10 F12 ... F30 Clock 62 FU • We have: • In-oder issue, • Out-of-order execute and commit

More Related