gem5  v22.1.0.0
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
gem5::minor::Scoreboard Class Reference

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>

Inheritance diagram for gem5::minor::Scoreboard:
gem5::Named

Public Types

typedef unsigned short int Index
 Type to use when indexing numResults. More...
 

Public Member Functions

 Scoreboard (const std::string &name, const BaseISA::RegClasses &reg_classes)
 
bool findIndex (const RegId &reg, 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 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 vecPredRegOffset
 
const unsigned numRegs
 The number of registers in the Scoreboard. More...
 
std::vector< IndexnumResults
 Count of the number of in-flight instructions that have results for each register. More...
 
std::vector< IndexnumUnpredictableResults
 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< CyclesreturnCycle
 The estimated cycle number that the result will be presented. More...
 
std::vector< InstSeqNumwritingInst
 The execute sequence number of the most recent inst to generate this register value. More...
 

Static Public Attributes

static constexpr int invalidFUIndex = -1
 

Detailed Description

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 66 of file scoreboard.hh.

Member Typedef Documentation

◆ Index

typedef unsigned short int gem5::minor::Scoreboard::Index

Type to use when indexing numResults.

Definition at line 86 of file scoreboard.hh.

Constructor & Destructor Documentation

◆ Scoreboard()

gem5::minor::Scoreboard::Scoreboard ( const std::string &  name,
const BaseISA::RegClasses reg_classes 
)
inline

Definition at line 110 of file scoreboard.hh.

Member Function Documentation

◆ canInstIssue()

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 202 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().

◆ clearInstDests()

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 167 of file scoreboard.cc.

References DPRINTF, findIndex(), fuIndices, gem5::MipsISA::index, invalidFUIndex, gem5::StaticInst::numDestRegs(), numResults, numUnpredictableResults, gem5::X86ISA::reg, returnCycle, and writingInst.

◆ execSeqNumToWaitFor()

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 137 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.

◆ findIndex()

bool gem5::minor::Scoreboard::findIndex ( const RegId reg,
Index scoreboard_index 
)

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 52 of file scoreboard.cc.

References gem5::CCRegClass, ccRegOffset, gem5::FloatRegClass, floatRegOffset, gem5::IntRegClass, gem5::InvalidRegClass, gem5::MiscRegClass, panic, gem5::X86ISA::reg, gem5::VecElemClass, gem5::VecPredRegClass, vecPredRegOffset, gem5::VecRegClass, and vecRegOffset.

Referenced by canInstIssue(), clearInstDests(), execSeqNumToWaitFor(), and markupInstDests().

◆ 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 93 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.

◆ minorTrace()

void gem5::minor::Scoreboard::minorTrace ( ) const

MinorTraceIF interface.

Definition at line 276 of file scoreboard.cc.

References gem5::ArmISA::i, gem5::minor::minorTrace(), numRegs, numResults, numUnpredictableResults, returnCycle, and writingInst.

Member Data Documentation

◆ ccRegOffset

const unsigned gem5::minor::Scoreboard::ccRegOffset

Definition at line 73 of file scoreboard.hh.

Referenced by findIndex().

◆ floatRegOffset

const unsigned gem5::minor::Scoreboard::floatRegOffset

Definition at line 72 of file scoreboard.hh.

Referenced by findIndex().

◆ fuIndices

std::vector<int> gem5::minor::Scoreboard::fuIndices

Index of the FU generating this result.

Definition at line 96 of file scoreboard.hh.

Referenced by canInstIssue(), clearInstDests(), and markupInstDests().

◆ intRegOffset

const unsigned gem5::minor::Scoreboard::intRegOffset

Definition at line 71 of file scoreboard.hh.

◆ invalidFUIndex

constexpr int gem5::minor::Scoreboard::invalidFUIndex = -1
staticconstexpr

Definition at line 97 of file scoreboard.hh.

Referenced by canInstIssue(), and clearInstDests().

◆ numRegs

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 83 of file scoreboard.hh.

Referenced by minorTrace().

◆ numResults

std::vector<Index> gem5::minor::Scoreboard::numResults

Count of the number of in-flight instructions that have results for each register.

Definition at line 90 of file scoreboard.hh.

Referenced by clearInstDests(), markupInstDests(), and minorTrace().

◆ numUnpredictableResults

std::vector<Index> gem5::minor::Scoreboard::numUnpredictableResults

Count of the number of results which can't be predicted.

Definition at line 93 of file scoreboard.hh.

Referenced by canInstIssue(), clearInstDests(), markupInstDests(), and minorTrace().

◆ regClasses

const BaseISA::RegClasses gem5::minor::Scoreboard::regClasses

Definition at line 69 of file scoreboard.hh.

◆ returnCycle

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 103 of file scoreboard.hh.

Referenced by canInstIssue(), clearInstDests(), markupInstDests(), and minorTrace().

◆ vecPredRegOffset

const unsigned gem5::minor::Scoreboard::vecPredRegOffset

Definition at line 75 of file scoreboard.hh.

Referenced by findIndex().

◆ vecRegOffset

const unsigned gem5::minor::Scoreboard::vecRegOffset

Definition at line 74 of file scoreboard.hh.

Referenced by findIndex().

◆ writingInst

std::vector<InstSeqNum> gem5::minor::Scoreboard::writingInst

The execute sequence number of the most recent inst to generate this register value.

Definition at line 107 of file scoreboard.hh.

Referenced by clearInstDests(), execSeqNumToWaitFor(), markupInstDests(), and minorTrace().


The documentation for this class was generated from the following files:

Generated on Wed Dec 21 2022 10:24:17 for gem5 by doxygen 1.9.1