gem5
|
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... | |
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.
Scoreboard::Scoreboard | ( | const std::string & | _my_name, |
unsigned | _numPhysicalRegs, | ||
unsigned | _numMiscRegs, | ||
PhysRegIndex | _zeroRegIdx, | ||
PhysRegIndex | _fpZeroRegIdx | ||
) |
Constructs a scoreboard.
_numPhysicalRegs | Number of physical registers. |
_numMiscRegs | Number of miscellaneous registers. |
_zeroRegIdx | Index of the zero register. |
_fpZeroRegIdx | Index of the FP zero register (if any, currently used only for Alpha). |
Definition at line 38 of file scoreboard.cc.
|
inline |
Destructor.
Definition at line 104 of file scoreboard.hh.
|
inline |
Checks if the register is ready.
Definition at line 110 of file scoreboard.hh.
References isZeroReg(), numPhysRegs, numTotalRegs, and regScoreBoard.
|
inlineprivate |
Definition at line 83 of file scoreboard.hh.
References fpZeroRegIdx, and zeroRegIdx.
Referenced by getReg(), and unsetReg().
|
inline |
|
inline |
Sets the register as ready.
Definition at line 128 of file scoreboard.hh.
References DPRINTF, numPhysRegs, numTotalRegs, and regScoreBoard.
|
inline |
Sets the register as not ready.
Definition at line 144 of file scoreboard.hh.
References isZeroReg(), numPhysRegs, numTotalRegs, and regScoreBoard.
|
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().
|
private |
The index of the FP zero register.
Definition at line 81 of file scoreboard.hh.
Referenced by isZeroReg().
|
private |
The number of actual physical registers.
Definition at line 68 of file scoreboard.hh.
Referenced by getReg(), setReg(), and unsetReg().
|
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().
|
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().
|
private |
The index of the zero register.
Definition at line 78 of file scoreboard.hh.
Referenced by isZeroReg().