gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 TheISA::RegIndex RegIndex
 Type to use for thread context registers. More...
 
typedef unsigned short int Index
 Type to use when indexing numResults. More...
 

Public Member Functions

 Scoreboard (const std::string &name)
 
bool findIndex (RegIndex 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 59 of file scoreboard.hh.

Member Typedef Documentation

typedef unsigned short int Minor::Scoreboard::Index

Type to use when indexing numResults.

Definition at line 74 of file scoreboard.hh.

typedef TheISA::RegIndex Minor::Scoreboard::RegIndex

Type to use for thread context registers.

Definition at line 71 of file scoreboard.hh.

Constructor & Destructor Documentation

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

Definition at line 97 of file scoreboard.hh.

Member Function Documentation

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 221 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 186 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 157 of file scoreboard.cc.

References DPRINTF, findIndex(), Minor::flattenRegIndex(), MipsISA::index, StaticInst::numSrcRegs(), X86ISA::reg, StaticInst::srcRegIdx(), and writingInst.

bool Scoreboard::findIndex ( RegIndex  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 51 of file scoreboard.cc.

References CCRegClass, FloatRegClass, AlphaISA::FP_Reg_Base, IntRegClass, MiscRegClass, AlphaISA::NumCCRegs, AlphaISA::NumIntRegs, X86ISA::reg, regIdxToClass(), and AlphaISA::ZeroReg.

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

References StaticInst::destRegIdx(), DPRINTF, findIndex(), Minor::flattenRegIndex(), fuIndices, MipsISA::index, StaticInst::numDestRegs(), numResults, numUnpredictableResults, X86ISA::reg, returnCycle, writingInst, and AlphaISA::ZeroReg.

void Scoreboard::minorTrace ( ) const

MinorTraceIF interface.

Definition at line 293 of file scoreboard.cc.

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

Member Data Documentation

std::vector<int> Minor::Scoreboard::fuIndices

Index of the FU generating this result.

Definition at line 84 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 68 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 78 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 81 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 90 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 94 of file scoreboard.hh.

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


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

Generated on Fri Jun 9 2017 13:04:33 for gem5 by doxygen 1.8.6