gem5
v20.1.0.0
|
A scoreboard of register dependencies including, for each register: The number of in-flight instructions which will generate a result for this register. More...
#include <scoreboard.hh>
Public Types | |
typedef unsigned short int | Index |
Type to use when indexing numResults. More... | |
Public Member Functions | |
Scoreboard (const std::string &name) | |
bool | findIndex (const RegId ®, Index &scoreboard_index) |
Sets scoreboard_index to the index into numResults of the given register index. More... | |
void | markupInstDests (MinorDynInstPtr inst, Cycles retire_time, ThreadContext *thread_context, bool mark_unpredictable) |
Mark up an instruction's effects by incrementing numResults counts. More... | |
void | clearInstDests (MinorDynInstPtr inst, bool clear_unpredictable) |
Clear down the dependencies for this instruction. More... | |
InstSeqNum | execSeqNumToWaitFor (MinorDynInstPtr inst, ThreadContext *thread_context) |
Returns the exec sequence number of the most recent inst on which the given inst depends. More... | |
bool | canInstIssue (MinorDynInstPtr inst, const std::vector< Cycles > *src_reg_relative_latencies, const std::vector< bool > *cant_forward_from_fu_indices, Cycles now, ThreadContext *thread_context) |
Can this instruction be issued. More... | |
void | minorTrace () const |
MinorTraceIF interface. More... | |
Public Member Functions inherited from Named | |
Named (const std::string &name_) | |
const std::string & | name () const |
Public Attributes | |
const unsigned | numRegs |
The number of registers in the Scoreboard. More... | |
std::vector< Index > | numResults |
Count of the number of in-flight instructions that have results for each register. More... | |
std::vector< Index > | numUnpredictableResults |
Count of the number of results which can't be predicted. More... | |
std::vector< int > | fuIndices |
Index of the FU generating this result. More... | |
std::vector< Cycles > | returnCycle |
The estimated cycle number that the result will be presented. More... | |
std::vector< InstSeqNum > | writingInst |
The execute sequence number of the most recent inst to generate this register value. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Named | |
const std::string | _name |
A scoreboard of register dependencies including, for each register: The number of in-flight instructions which will generate a result for this register.
Definition at line 57 of file scoreboard.hh.
typedef unsigned short int Minor::Scoreboard::Index |
Type to use when indexing numResults.
Definition at line 69 of file scoreboard.hh.
|
inline |
Definition at line 92 of file scoreboard.hh.
bool Scoreboard::canInstIssue | ( | MinorDynInstPtr | inst, |
const std::vector< Cycles > * | src_reg_relative_latencies, | ||
const std::vector< bool > * | cant_forward_from_fu_indices, | ||
Cycles | now, | ||
ThreadContext * | thread_context | ||
) |
Can this instruction be issued.
Are any of its source registers due to be written by other marked-up instructions in flight
Definition at line 216 of file scoreboard.cc.
References StaticInst::disassemble(), DPRINTF, DTRACE, findIndex(), Minor::flattenRegIndex(), fuIndices, MipsISA::index, StaticInst::numSrcRegs(), numUnpredictableResults, X86ISA::reg, returnCycle, and StaticInst::srcRegIdx().
void Scoreboard::clearInstDests | ( | MinorDynInstPtr | inst, |
bool | clear_unpredictable | ||
) |
Clear down the dependencies for this instruction.
clear_unpredictable must match mark_unpredictable for the same inst.
Mark each destination register
Definition at line 181 of file scoreboard.cc.
References DPRINTF, findIndex(), fuIndices, MipsISA::index, StaticInst::numDestRegs(), numResults, numUnpredictableResults, X86ISA::reg, returnCycle, and writingInst.
InstSeqNum Scoreboard::execSeqNumToWaitFor | ( | MinorDynInstPtr | inst, |
ThreadContext * | thread_context | ||
) |
Returns the exec sequence number of the most recent inst on which the given inst depends.
Useful for determining which inst must actually be committed before a dependent inst can call initiateAcc
Definition at line 152 of file scoreboard.cc.
References DPRINTF, findIndex(), Minor::flattenRegIndex(), MipsISA::index, StaticInst::numSrcRegs(), X86ISA::reg, StaticInst::srcRegIdx(), and writingInst.
Sets scoreboard_index to the index into numResults of the given register index.
Returns true if the given register is in the scoreboard and false if it isn't
Definition at line 49 of file scoreboard.cc.
References CCRegClass, FloatRegClass, IntRegClass, MiscRegClass, ArmISA::NumCCRegs, ArmISA::NumFloatRegs, ArmISA::NumIntRegs, ArmISA::NumVecRegs, panic, X86ISA::reg, VecElemClass, VecPredRegClass, and VecRegClass.
Referenced by canInstIssue(), clearInstDests(), execSeqNumToWaitFor(), and markupInstDests().
void Scoreboard::markupInstDests | ( | MinorDynInstPtr | inst, |
Cycles | retire_time, | ||
ThreadContext * | thread_context, | ||
bool | mark_unpredictable | ||
) |
Mark up an instruction's effects by incrementing numResults counts.
If mark_unpredictable is true, the inst's destination registers are marked as being unpredictable without an estimated retire time
Mark each destination register
Definition at line 108 of file scoreboard.cc.
References StaticInst::destRegIdx(), DPRINTF, findIndex(), Minor::flattenRegIndex(), fuIndices, MipsISA::index, IntRegClass, StaticInst::numDestRegs(), numResults, numUnpredictableResults, X86ISA::reg, returnCycle, writingInst, and ArmISA::ZeroReg.
void Scoreboard::minorTrace | ( | ) | const |
MinorTraceIF interface.
Definition at line 288 of file scoreboard.cc.
References ArmISA::i, MINORTRACE, numRegs, numResults, numUnpredictableResults, returnCycle, and writingInst.
std::vector<int> Minor::Scoreboard::fuIndices |
Index of the FU generating this result.
Definition at line 79 of file scoreboard.hh.
Referenced by canInstIssue(), clearInstDests(), and markupInstDests().
const unsigned Minor::Scoreboard::numRegs |
The number of registers in the Scoreboard.
These are just the integer, CC and float registers packed together with integer regs in the range [0,NumIntRegs-1], CC regs in the range [NumIntRegs, NumIntRegs+NumCCRegs-1] and float regs in the range [NumIntRegs+NumCCRegs, NumFloatRegs+NumIntRegs+NumCCRegs-1]
Definition at line 66 of file scoreboard.hh.
Referenced by minorTrace().
std::vector<Index> Minor::Scoreboard::numResults |
Count of the number of in-flight instructions that have results for each register.
Definition at line 73 of file scoreboard.hh.
Referenced by clearInstDests(), markupInstDests(), and minorTrace().
std::vector<Index> Minor::Scoreboard::numUnpredictableResults |
Count of the number of results which can't be predicted.
Definition at line 76 of file scoreboard.hh.
Referenced by canInstIssue(), clearInstDests(), markupInstDests(), and minorTrace().
std::vector<Cycles> Minor::Scoreboard::returnCycle |
The estimated cycle number that the result will be presented.
This can be offset from to allow forwarding to be simulated as long as instruction completion is strictly in order with respect to instructions with unpredictable result timing
Definition at line 85 of file scoreboard.hh.
Referenced by canInstIssue(), clearInstDests(), markupInstDests(), and minorTrace().
std::vector<InstSeqNum> Minor::Scoreboard::writingInst |
The execute sequence number of the most recent inst to generate this register value.
Definition at line 89 of file scoreboard.hh.
Referenced by clearInstDests(), execSeqNumToWaitFor(), markupInstDests(), and minorTrace().