高级计算机体系结构设计及其在数据中心和云计算的应用Read Operands (RO) StageReceiveinstructionissuedtofunctional unit Check for RAw hazards: Are all source operands availableyet?- If no: Hold instruction in a pre-execution buffer.. If buffer has only 1 entry, this and all not-yet-issuedinstructions using this functional unit must waitIf yes:Read operandsfromregisterfile, &startinstruction down the execution unit's pipelineReplaces secondhalfofIDstage6
高级计算机体系结构设计及其在数据中心和云计算的应用 Read Operands (RO) Stage • Receive instruction issued to functional unit. • Check for RAW hazards: Are all source operands available yet? – If no: Hold instruction in a pre-execution buffer. • If buffer has only 1 entry, this and all not-yet-issued 6 • If buffer has only 1 entry, this and all not-yet-issued instructions using this functional unit must wait. – If yes: Read operands from register file, & start instruction down the execution unit’s pipeline. Replaces second half of ID stage
高级计算机体系结构设计及其在数据中心和云计算的应用Execution (Ex) Stage. Once operands are received, begin executionof the instruction in the execution unit. Execution may take multiple cycles.When result is ready, notify scoreboard ofinstruction completionReplacesoldEXstage
高级计算机体系结构设计及其在数据中心和云计算的应用 Execution (EX) Stage • Once operands are received, begin execution of the instruction in the execution unit. • Execution may take multiple cycles. • When result is ready, notify scoreboard of 7 instruction completion. Replaces old EX stage
高级计算机体系结构设计及其在数据中心和云计算的应用Write Result (WR) stageReceive completed instruction & its result fromexecution unit.CheckforWARhazards:- Does any previously-issued instruction that has not yetread its operands depend on the old value we are about tooverwrite? (Does it anti-depend on us?).While yes:Stall instruction in a post-execution buffer..When no:Write instruction result to register fileReplaces WB stage8
高级计算机体系结构设计及其在数据中心和云计算的应用 Write Result (WR) stage • Receive completed instruction & its result from execution unit. • Check for WAR hazards: – Does any previously-issued instruction that has not yet read its operands depend on the old value we are about to 8 overwrite? (Does it anti-depend on us?) • While yes: Stall instruction in a post-execution buffer. • When no: Write instruction result to register file. Replaces WB stage
高级计算机体系结构设计及其在数据中心和云计算的应用Scoreboard Implementation: One typical implementation uses three tables:-Instruction status,foreachinstructiononthescoreboard. Which stage of execution is the instruction currently in?-FunctionalUnit(FU)status,foreachFU:: What instruction (if any) is being processed?.Ifinst.isinROstage,thenforeachoperand:- What registeris the operand comingfrom?-Istheoperandready?Ifnot,whichFUwill producetheoperand?-Registerresultstatus,foreachreg.intheISA:.Whichcurrently-runningFU(ifany)isscheduledtooverwritethegiven register?
高级计算机体系结构设计及其在数据中心和云计算的应用 Scoreboard Implementation • One typical implementation uses three tables: – Instruction status, for each instruction on the scoreboard • Which stage of execution is the instruction currently in? – Functional Unit (FU) status, for each FU: • What instruction (if any) is being processed? 9 • If inst. is in RO stage, then for each operand: – What register is the operand coming from? – Is the operand ready? – If not, which FU will produce the operand? – Register result status, for each reg. in the ISA: • Which currently-running FU (if any) is scheduled to overwrite the given register?
高级计算机体系结构设计及其在数据中心和云计算的应用Functional Unit Status TableFor each functional unit, the following fields:- Busy - ls the unit busy (Yes/No)?-Op-WhichexactopcodetoperformintheFU?-F,-Destinationregisterof instruction intheFU F,Fk- Source registers of instruction These fields are only needed during RO stage:: Q,Qk- FUs to write new values of source registers, or 0· R,Rk- Are operands Fj,Fk ready? (Yes/No)Register result status table has only 1 field:-Result-Whichcurrently-executingFUwill write itsresultto this register?10
高级计算机体系结构设计及其在数据中心和云计算的应用 Functional Unit Status Table • For each functional unit, the following fields: – Busy – Is the unit busy (Yes/No)? – Op – Which exact opcode to perform in the FU? – Fi – Destination register of instruction in the FU – Fj ,Fk – Source registers of instruction 10 – Fj ,Fk – Source registers of instruction – These fields are only needed during RO stage: • Qj ,Qk – FUs to write new values of source registers, or 0 • Rj ,Rk – Are operands Fj,Fk ready? (Yes/No) • Register result status table has only 1 field: – Result – Which currently-executing FU will write its result to this register?