gem5 v24.0.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. | |
Public Member Functions | |
Scoreboard (const std::string &name, const BaseISA::RegClasses ®_classes) | |
bool | findIndex (const RegId ®, Index &scoreboard_index) |
Sets scoreboard_index to the index into numResults of the given register index. | |
void | markupInstDests (MinorDynInstPtr inst, Cycles retire_time, ThreadContext *thread_context, bool mark_unpredictable) |
Mark up an instruction's effects by incrementing numResults counts. | |
void | clearInstDests (MinorDynInstPtr inst, bool clear_unpredictable) |
Clear down the dependencies for this instruction. | |
InstSeqNum | execSeqNumToWaitFor (MinorDynInstPtr inst, ThreadContext *thread_context) |
Returns the exec sequence number of the most recent inst on which the given inst depends. | |
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. | |
void | minorTrace () const |
MinorTraceIF interface. | |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Public Attributes | |
const BaseISA::RegClasses | regClasses |
const unsigned | intRegOffset |
const unsigned | floatRegOffset |
const unsigned | ccRegOffset |
const unsigned | vecRegOffset |
const unsigned | vecRegElemOffset |
const unsigned | vecPredRegOffset |
const unsigned | matRegOffset |
const unsigned | numRegs |
The number of registers in the Scoreboard. | |
std::vector< Index > | numResults |
Count of the number of in-flight instructions that have results for each register. | |
std::vector< Index > | numUnpredictableResults |
Count of the number of results which can't be predicted. | |
std::vector< int > | fuIndices |
Index of the FU generating this result. | |
std::vector< Cycles > | returnCycle |
The estimated cycle number that the result will be presented. | |
std::vector< InstSeqNum > | writingInst |
The execute sequence number of the most recent inst to generate this register value. | |
Static Public Attributes | |
static constexpr int | invalidFUIndex = -1 |
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 65 of file scoreboard.hh.
typedef unsigned short int gem5::minor::Scoreboard::Index |
Type to use when indexing numResults.
Definition at line 87 of file scoreboard.hh.
|
inline |
Definition at line 111 of file scoreboard.hh.
bool gem5::minor::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 208 of file scoreboard.cc.
References gem5::StaticInst::disassemble(), DPRINTF, findIndex(), gem5::RegId::flatten(), fuIndices, gem5::ThreadContext::getIsaPtr(), gem5::MipsISA::index, invalidFUIndex, gem5::StaticInst::numSrcRegs(), numUnpredictableResults, gem5::X86ISA::reg, returnCycle, and gem5::StaticInst::srcRegIdx().
void gem5::minor::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 173 of file scoreboard.cc.
References DPRINTF, findIndex(), fuIndices, gem5::MipsISA::index, invalidFUIndex, gem5::StaticInst::numDestRegs(), numResults, numUnpredictableResults, gem5::X86ISA::reg, returnCycle, and writingInst.
InstSeqNum gem5::minor::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 143 of file scoreboard.cc.
References DPRINTF, findIndex(), gem5::RegId::flatten(), gem5::ThreadContext::getIsaPtr(), gem5::MipsISA::index, gem5::StaticInst::numSrcRegs(), gem5::X86ISA::reg, gem5::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 51 of file scoreboard.cc.
References gem5::CCRegClass, ccRegOffset, gem5::FloatRegClass, floatRegOffset, gem5::IntRegClass, gem5::InvalidRegClass, gem5::MatRegClass, matRegOffset, gem5::MiscRegClass, panic, gem5::X86ISA::reg, gem5::VecElemClass, gem5::VecPredRegClass, vecPredRegOffset, gem5::VecRegClass, vecRegElemOffset, and vecRegOffset.
Referenced by canInstIssue(), clearInstDests(), execSeqNumToWaitFor(), and markupInstDests().
void gem5::minor::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 99 of file scoreboard.cc.
References gem5::StaticInst::destRegIdx(), DPRINTF, findIndex(), gem5::RegId::flatten(), fuIndices, gem5::ThreadContext::getIsaPtr(), gem5::MipsISA::index, gem5::StaticInst::numDestRegs(), numResults, numUnpredictableResults, gem5::X86ISA::reg, returnCycle, and writingInst.
void gem5::minor::Scoreboard::minorTrace | ( | ) | const |
MinorTraceIF interface.
Definition at line 282 of file scoreboard.cc.
References gem5::ArmISA::i, gem5::minor::minorTrace(), numRegs, numResults, numUnpredictableResults, returnCycle, and writingInst.
const unsigned gem5::minor::Scoreboard::ccRegOffset |
Definition at line 72 of file scoreboard.hh.
Referenced by findIndex().
const unsigned gem5::minor::Scoreboard::floatRegOffset |
Definition at line 71 of file scoreboard.hh.
Referenced by findIndex().
std::vector<int> gem5::minor::Scoreboard::fuIndices |
Index of the FU generating this result.
Definition at line 97 of file scoreboard.hh.
Referenced by canInstIssue(), clearInstDests(), and markupInstDests().
const unsigned gem5::minor::Scoreboard::intRegOffset |
Definition at line 70 of file scoreboard.hh.
|
staticconstexpr |
Definition at line 98 of file scoreboard.hh.
Referenced by canInstIssue(), and clearInstDests().
const unsigned gem5::minor::Scoreboard::matRegOffset |
Definition at line 76 of file scoreboard.hh.
Referenced by findIndex().
const unsigned gem5::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 84 of file scoreboard.hh.
Referenced by minorTrace().
std::vector<Index> gem5::minor::Scoreboard::numResults |
Count of the number of in-flight instructions that have results for each register.
Definition at line 91 of file scoreboard.hh.
Referenced by clearInstDests(), markupInstDests(), and minorTrace().
std::vector<Index> gem5::minor::Scoreboard::numUnpredictableResults |
Count of the number of results which can't be predicted.
Definition at line 94 of file scoreboard.hh.
Referenced by canInstIssue(), clearInstDests(), markupInstDests(), and minorTrace().
const BaseISA::RegClasses gem5::minor::Scoreboard::regClasses |
Definition at line 68 of file scoreboard.hh.
std::vector<Cycles> gem5::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 104 of file scoreboard.hh.
Referenced by canInstIssue(), clearInstDests(), markupInstDests(), and minorTrace().
const unsigned gem5::minor::Scoreboard::vecPredRegOffset |
Definition at line 75 of file scoreboard.hh.
Referenced by findIndex().
const unsigned gem5::minor::Scoreboard::vecRegElemOffset |
Definition at line 74 of file scoreboard.hh.
Referenced by findIndex().
const unsigned gem5::minor::Scoreboard::vecRegOffset |
Definition at line 73 of file scoreboard.hh.
Referenced by findIndex().
std::vector<InstSeqNum> gem5::minor::Scoreboard::writingInst |
The execute sequence number of the most recent inst to generate this register value.
Definition at line 108 of file scoreboard.hh.
Referenced by clearInstDests(), execSeqNumToWaitFor(), markupInstDests(), and minorTrace().