gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Scoreboard Class Reference

Implements a simple scoreboard to track which registers are ready. More...

#include <scoreboard.hh>

Public Member Functions

 Scoreboard (const std::string &_my_name, unsigned _numPhysicalRegs, unsigned _numMiscRegs, PhysRegIndex _zeroRegIdx, PhysRegIndex _fpZeroRegIdx)
 Constructs a scoreboard. More...
 
 ~Scoreboard ()
 Destructor. More...
 
std::string name () const
 Returns the name of the scoreboard. More...
 
bool getReg (PhysRegIndex reg_idx) const
 Checks if the register is ready. More...
 
void setReg (PhysRegIndex reg_idx)
 Sets the register as ready. More...
 
void unsetReg (PhysRegIndex reg_idx)
 Sets the register as not ready. More...
 

Private Member Functions

bool isZeroReg (PhysRegIndex idx) const
 

Private Attributes

const std::string _name
 The object name, for DPRINTF. More...
 
std::vector< bool > regScoreBoard
 Scoreboard of physical integer registers, saying whether or not they are ready. More...
 
unsigned numPhysRegs
 The number of actual physical registers. More...
 
unsigned M5_CLASS_VAR_USED numTotalRegs
 The total number of registers which can be indexed, including the misc registers that come after the physical registers and which are hardwired to be always considered ready. More...
 
PhysRegIndex zeroRegIdx
 The index of the zero register. More...
 
PhysRegIndex fpZeroRegIdx
 The index of the FP zero register. More...
 

Detailed Description

Implements a simple scoreboard to track which registers are ready.

This class operates on the unified physical register space, so integer and floating-point registers are not distinguished. For convenience, it also accepts operations on the physical-space mapping of misc registers, which are numbered starting after the end of the actual physical register file. However, there is no actual scoreboard for misc registers, and they are always considered ready.

Definition at line 56 of file scoreboard.hh.

Constructor & Destructor Documentation

Scoreboard::Scoreboard ( const std::string &  _my_name,
unsigned  _numPhysicalRegs,
unsigned  _numMiscRegs,
PhysRegIndex  _zeroRegIdx,
PhysRegIndex  _fpZeroRegIdx 
)

Constructs a scoreboard.

Parameters
_numPhysicalRegsNumber of physical registers.
_numMiscRegsNumber of miscellaneous registers.
_zeroRegIdxIndex of the zero register.
_fpZeroRegIdxIndex of the FP zero register (if any, currently used only for Alpha).

Definition at line 38 of file scoreboard.cc.

Scoreboard::~Scoreboard ( )
inline

Destructor.

Definition at line 104 of file scoreboard.hh.

Member Function Documentation

bool Scoreboard::getReg ( PhysRegIndex  reg_idx) const
inline

Checks if the register is ready.

Definition at line 110 of file scoreboard.hh.

References isZeroReg(), numPhysRegs, numTotalRegs, and regScoreBoard.

bool Scoreboard::isZeroReg ( PhysRegIndex  idx) const
inlineprivate

Definition at line 83 of file scoreboard.hh.

References fpZeroRegIdx, and zeroRegIdx.

Referenced by getReg(), and unsetReg().

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

Returns the name of the scoreboard.

Definition at line 107 of file scoreboard.hh.

References _name.

void Scoreboard::setReg ( PhysRegIndex  reg_idx)
inline

Sets the register as ready.

Definition at line 128 of file scoreboard.hh.

References DPRINTF, numPhysRegs, numTotalRegs, and regScoreBoard.

void Scoreboard::unsetReg ( PhysRegIndex  reg_idx)
inline

Sets the register as not ready.

Definition at line 144 of file scoreboard.hh.

References isZeroReg(), numPhysRegs, numTotalRegs, and regScoreBoard.

Member Data Documentation

const std::string Scoreboard::_name
private

The object name, for DPRINTF.

We have to declare this explicitly because Scoreboard is not a SimObject.

Definition at line 61 of file scoreboard.hh.

Referenced by name().

PhysRegIndex Scoreboard::fpZeroRegIdx
private

The index of the FP zero register.

Definition at line 81 of file scoreboard.hh.

Referenced by isZeroReg().

unsigned Scoreboard::numPhysRegs
private

The number of actual physical registers.

Definition at line 68 of file scoreboard.hh.

Referenced by getReg(), setReg(), and unsetReg().

unsigned M5_CLASS_VAR_USED Scoreboard::numTotalRegs
private

The total number of registers which can be indexed, including the misc registers that come after the physical registers and which are hardwired to be always considered ready.

Definition at line 75 of file scoreboard.hh.

Referenced by getReg(), setReg(), and unsetReg().

std::vector<bool> Scoreboard::regScoreBoard
private

Scoreboard of physical integer registers, saying whether or not they are ready.

Definition at line 65 of file scoreboard.hh.

Referenced by getReg(), setReg(), and unsetReg().

PhysRegIndex Scoreboard::zeroRegIdx
private

The index of the zero register.

Definition at line 78 of file scoreboard.hh.

Referenced by isZeroReg().


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

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