gem5  v20.1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
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 Minor::Scoreboard:
Named

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

Additional Inherited Members

- Protected Attributes inherited from Named
const std::string _name
 

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

Member Typedef Documentation

◆ Index

typedef unsigned short int Minor::Scoreboard::Index

Type to use when indexing numResults.

Definition at line 69 of file scoreboard.hh.

Constructor & Destructor Documentation

◆ Scoreboard()

Minor::Scoreboard::Scoreboard ( const std::string &  name)
inline

Definition at line 92 of file scoreboard.hh.

Member Function Documentation

◆ canInstIssue()

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

◆ clearInstDests()

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.

◆ execSeqNumToWaitFor()

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.

◆ findIndex()

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

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

◆ minorTrace()

void Scoreboard::minorTrace ( ) const

MinorTraceIF interface.

Definition at line 288 of file scoreboard.cc.

References ArmISA::i, MINORTRACE, numRegs, numResults, numUnpredictableResults, returnCycle, and writingInst.

Member Data Documentation

◆ fuIndices

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

◆ numRegs

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

◆ numResults

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

◆ numUnpredictableResults

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

◆ returnCycle

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

◆ writingInst

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


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

Generated on Wed Sep 30 2020 14:03:06 for gem5 by doxygen 1.8.17