高级计算机体系结构设计及其在数据中心和云计算的应用Lecture 6Scoreboarding
高级计算机体系结构设计及其在数据中心和云计算的应用 Lecture 6 Scoreboarding
高级计算机体系结构设计及其在数据中心和云计算的应用OverviewTechniquefor implementing an instruction queuethat supports dynamic reordering.Developed on CDC 6600 (decades ago)Reordering must check WAR/WAW hazards:← Long-runningF0,F2,F4DIVD←ADDD1F10_F0.F8Depends on DIV< Anti-depends on ADDSUBD F8,F8,F14Goal:Begin execution of instructions as early aspossible2
高级计算机体系结构设计及其在数据中心和云计算的应用 Overview • Technique for implementing an instruction queue that supports dynamic reordering. • Developed on CDC 6600 (decades ago). • Reordering must check WAR/WAW hazards: DIVD F0,F2,F4 Long-running 2 DIVD F0,F2,F4 Long-running ADDD F10,F0,F8 Depends on DIV SUBD F8,F8,F14 Anti-depends on ADD • Goal: Begin execution of instructions as early as possible
高级计算机体系结构设计及其在数据中心和云计算的应用SimpleScoreboardedDatapathRegistersData busesFP multFPmultFPdivideFPaddIntegerunitScoreboardControl/Control/statusstatus
高级计算机体系结构设计及其在数据中心和云计算的应用 Simple Scoreboarded Datapath 3
高级计算机体系结构设计及其在数据中心和云计算的应用Pipeline with Scoreboarding(F)Fetchinstructionfromcacheorprefetchbuffer(0)Issueinst.toanexecutionpath (whenno structural/WAWhazards)(R)Readoperands (whennoRAWhazardsremain)(E)Executeinstruction(possiblymulti-cycle)(W)Writeresults (whennoWARhazardsremain)Scoreboard/Pre-executionPost-executionbuffersbuffersControl UnitReadExecutionunit 1operandsInstructionInstructionWriteFetchIssueresultsReadExecutionunit 2operandsPre-issuebufferInstructionDecode
高级计算机体系结构设计及其在数据中心和云计算的应用 Pipeline with Scoreboarding • (F) Fetch instruction from cache or prefetch buffer • (I) Issue inst. to an execution path (when no structural/WAW hazards) • (R) Read operands (when no RAW hazards remain) • (E) Execute instruction (possibly multi-cycle) • (W) Write results (when no WAR hazards remain) Scoreboard / Pre-execution Post-execution 4 Instruction Fetch Instruction Issue Pre-issue buffer Execution unit 1 Execution . unit 2 Write results Pre-execution buffers Post-execution buffers Read operands Read operands Scoreboard / Control Unit Instruction Decode
高级计算机体系结构设计及其在数据中心和云计算的应用Instruction Issue (is) StageReplaces first halfReceivenewly-fetchedinstructionofID stageDecode binary instruction format Check for structural hazards:-Instructionneedsexecution unitcurrentlyin use,whoseinitiationinterval hasn't passed?CheckforWAWhazards:Instruction wants to write to a register that an active instruction(issued, but notyetfinished)wantsto writeto?Badiftheyfinishout-of-order!Stall all current (& future) instruction issuing, until none ofthese hazards remainIssue instructions (in-order) to the appropriate execution units& track status on scoreboard5
高级计算机体系结构设计及其在数据中心和云计算的应用 Instruction Issue (IS) Stage • Receive newly-fetched instruction • Decode binary instruction format • Check for structural hazards: – Instruction needs execution unit currently in use, whose initiation interval hasn’t passed? • Check for WAW hazards: Replaces first half of ID stage 5 • Check for WAW hazards: – Instruction wants to write to a register that an active instruction (issued, but not yet finished) wants to write to? • Bad if they finish out-of-order! • Stall all current (& future) instruction issuing, until none of these hazards remain. • Issue instructions (in-order) to the appropriate execution units & track status on scoreboard