gem5
v20.1.0.0
|
FreeList class that simply holds the list of free integer and floating point registers. More...
#include <free_list.hh>
Public Member Functions | |
UnifiedFreeList (const std::string &_my_name, PhysRegFile *_regFile) | |
Constructs a free list. More... | |
std::string | name () const |
Gives the name of the freelist. More... | |
SimpleFreeList * | getCCList () |
Returns a pointer to the condition-code free list. More... | |
PhysRegIdPtr | getIntReg () |
Gets a free integer register. More... | |
PhysRegIdPtr | getFloatReg () |
Gets a free fp register. More... | |
PhysRegIdPtr | getVecReg () |
Gets a free vector register. More... | |
PhysRegIdPtr | getVecElem () |
Gets a free vector elemenet register. More... | |
PhysRegIdPtr | getVecPredReg () |
Gets a free predicate register. More... | |
PhysRegIdPtr | getCCReg () |
Gets a free cc register. More... | |
void | addReg (PhysRegIdPtr freed_reg) |
Adds a register back to the free list. More... | |
template<class InputIt > | |
void | addRegs (InputIt first, InputIt last) |
Adds a register back to the free list. More... | |
void | addIntReg (PhysRegIdPtr freed_reg) |
Adds an integer register back to the free list. More... | |
void | addFloatReg (PhysRegIdPtr freed_reg) |
Adds a fp register back to the free list. More... | |
void | addVecReg (PhysRegIdPtr freed_reg) |
Adds a vector register back to the free list. More... | |
void | addVecElem (PhysRegIdPtr freed_reg) |
Adds a vector element register back to the free list. More... | |
void | addVecPredReg (PhysRegIdPtr freed_reg) |
Adds a predicate register back to the free list. More... | |
void | addCCReg (PhysRegIdPtr freed_reg) |
Adds a cc register back to the free list. More... | |
bool | hasFreeIntRegs () const |
Checks if there are any free integer registers. More... | |
bool | hasFreeFloatRegs () const |
Checks if there are any free fp registers. More... | |
bool | hasFreeVecRegs () const |
Checks if there are any free vector registers. More... | |
bool | hasFreeVecElems () const |
Checks if there are any free vector registers. More... | |
bool | hasFreeVecPredRegs () const |
Checks if there are any free predicate registers. More... | |
bool | hasFreeCCRegs () const |
Checks if there are any free cc registers. More... | |
unsigned | numFreeIntRegs () const |
Returns the number of free integer registers. More... | |
unsigned | numFreeFloatRegs () const |
Returns the number of free fp registers. More... | |
unsigned | numFreeVecRegs () const |
Returns the number of free vector registers. More... | |
unsigned | numFreeVecElems () const |
Returns the number of free vector registers. More... | |
unsigned | numFreeVecPredRegs () const |
Returns the number of free predicate registers. More... | |
unsigned | numFreeCCRegs () const |
Returns the number of free cc registers. More... | |
Private Attributes | |
const std::string | _name |
The object name, for DPRINTF. More... | |
SimpleFreeList | intList |
The list of free integer registers. More... | |
SimpleFreeList | floatList |
The list of free floating point registers. More... | |
SimpleFreeList | predList |
The list of free predicate registers. More... | |
SimpleFreeList | ccList |
The list of free condition-code registers. More... | |
PhysRegFile * | regFile |
The register file object is used only to distinguish integer from floating-point physical register indices. More... | |
SimpleFreeList | vecList |
The following two are exclusive interfaces. More... | |
SimpleFreeList | vecElemList |
The list of free vector element registers. More... | |
Friends | |
class | UnifiedRenameMap |
FreeList class that simply holds the list of free integer and floating point registers.
Can request for a free register of either type, and also send back free registers of either type. This is a very simple class, but it should be sufficient for most implementations. Like all other classes, it assumes that the indices for the floating point registers starts after the integer registers end. Hence the variable numPhysicalIntRegs is logically equivalent to the baseFP dependency. Note that while this most likely should be called FreeList, the name "FreeList" is used in a typedef within the CPU Policy, and therefore no class can be named simply "FreeList".
Definition at line 115 of file free_list.hh.
UnifiedFreeList::UnifiedFreeList | ( | const std::string & | _my_name, |
PhysRegFile * | _regFile | ||
) |
Constructs a free list.
_numPhysicalIntRegs | Number of physical integer registers. |
reservedIntRegs | Number of integer registers already used by initial mappings. |
_numPhysicalFloatRegs | Number of physical fp registers. |
reservedFloatRegs | Number of fp registers already used by initial mappings. |
Definition at line 37 of file free_list.cc.
References DPRINTF, PhysRegFile::initFreeList(), and regFile.
|
inline |
Adds a cc register back to the free list.
Definition at line 217 of file free_list.hh.
References SimpleFreeList::addReg(), and ccList.
|
inline |
Adds a fp register back to the free list.
Definition at line 203 of file free_list.hh.
References SimpleFreeList::addReg(), and floatList.
|
inline |
Adds an integer register back to the free list.
Definition at line 200 of file free_list.hh.
References SimpleFreeList::addReg(), and intList.
|
inline |
Adds a register back to the free list.
Definition at line 296 of file free_list.hh.
References SimpleFreeList::addReg(), ccList, CCRegClass, PhysRegId::className(), PhysRegId::classValue(), DPRINTF, floatList, FloatRegClass, PhysRegId::index(), intList, IntRegClass, panic, predList, VecElemClass, vecElemList, vecList, VecPredRegClass, and VecRegClass.
|
inline |
Adds a register back to the free list.
Definition at line 258 of file free_list.hh.
References SimpleFreeList::addRegs(), ccList, CCRegClass, floatList, FloatRegClass, intList, IntRegClass, panic, panic_if, predList, VecElemClass, vecElemList, vecList, VecPredRegClass, and VecRegClass.
Referenced by PhysRegFile::initFreeList(), and UnifiedRenameMap::switchFreeList().
|
inline |
Adds a vector element register back to the free list.
Definition at line 209 of file free_list.hh.
References SimpleFreeList::addReg(), and vecElemList.
|
inline |
Adds a predicate register back to the free list.
Definition at line 214 of file free_list.hh.
References SimpleFreeList::addReg(), and predList.
|
inline |
Adds a vector register back to the free list.
Definition at line 206 of file free_list.hh.
References SimpleFreeList::addReg(), and vecList.
|
inline |
Returns a pointer to the condition-code free list.
Definition at line 172 of file free_list.hh.
References ccList.
|
inline |
Gets a free cc register.
Definition at line 190 of file free_list.hh.
References ccList, and SimpleFreeList::getReg().
|
inline |
Gets a free fp register.
Definition at line 178 of file free_list.hh.
References floatList, and SimpleFreeList::getReg().
|
inline |
Gets a free integer register.
Definition at line 175 of file free_list.hh.
References SimpleFreeList::getReg(), and intList.
|
inline |
Gets a free vector elemenet register.
Definition at line 184 of file free_list.hh.
References SimpleFreeList::getReg(), and vecElemList.
Referenced by UnifiedRenameMap::switchFreeList().
|
inline |
Gets a free predicate register.
Definition at line 187 of file free_list.hh.
References SimpleFreeList::getReg(), and predList.
|
inline |
Gets a free vector register.
Definition at line 181 of file free_list.hh.
References SimpleFreeList::getReg(), and vecList.
Referenced by UnifiedRenameMap::switchFreeList().
|
inline |
Checks if there are any free cc registers.
Definition at line 235 of file free_list.hh.
References ccList, and SimpleFreeList::hasFreeRegs().
|
inline |
Checks if there are any free fp registers.
Definition at line 223 of file free_list.hh.
References floatList, and SimpleFreeList::hasFreeRegs().
|
inline |
Checks if there are any free integer registers.
Definition at line 220 of file free_list.hh.
References SimpleFreeList::hasFreeRegs(), and intList.
|
inline |
Checks if there are any free vector registers.
Definition at line 229 of file free_list.hh.
References SimpleFreeList::hasFreeRegs(), and vecElemList.
Referenced by UnifiedRenameMap::switchFreeList().
|
inline |
Checks if there are any free predicate registers.
Definition at line 232 of file free_list.hh.
References SimpleFreeList::hasFreeRegs(), and predList.
|
inline |
Checks if there are any free vector registers.
Definition at line 226 of file free_list.hh.
References SimpleFreeList::hasFreeRegs(), and vecList.
Referenced by UnifiedRenameMap::switchFreeList().
|
inline |
|
inline |
Returns the number of free cc registers.
Definition at line 253 of file free_list.hh.
References ccList, and SimpleFreeList::numFreeRegs().
|
inline |
Returns the number of free fp registers.
Definition at line 241 of file free_list.hh.
References floatList, and SimpleFreeList::numFreeRegs().
|
inline |
Returns the number of free integer registers.
Definition at line 238 of file free_list.hh.
References intList, and SimpleFreeList::numFreeRegs().
|
inline |
Returns the number of free vector registers.
Definition at line 247 of file free_list.hh.
References SimpleFreeList::numFreeRegs(), and vecElemList.
Referenced by UnifiedRenameMap::switchFreeList().
|
inline |
Returns the number of free predicate registers.
Definition at line 250 of file free_list.hh.
References SimpleFreeList::numFreeRegs(), and predList.
|
inline |
Returns the number of free vector registers.
Definition at line 244 of file free_list.hh.
References SimpleFreeList::numFreeRegs(), and vecList.
Referenced by UnifiedRenameMap::switchFreeList().
|
friend |
Definition at line 155 of file free_list.hh.
|
private |
The object name, for DPRINTF.
We have to declare this explicitly because Scoreboard is not a SimObject.
Definition at line 121 of file free_list.hh.
Referenced by name().
|
private |
The list of free condition-code registers.
Definition at line 142 of file free_list.hh.
Referenced by addCCReg(), addReg(), addRegs(), getCCList(), getCCReg(), hasFreeCCRegs(), UnifiedRenameMap::init(), and numFreeCCRegs().
|
private |
The list of free floating point registers.
Definition at line 127 of file free_list.hh.
Referenced by addFloatReg(), addReg(), addRegs(), getFloatReg(), hasFreeFloatRegs(), UnifiedRenameMap::init(), and numFreeFloatRegs().
|
private |
The list of free integer registers.
Definition at line 124 of file free_list.hh.
Referenced by addIntReg(), addReg(), addRegs(), getIntReg(), hasFreeIntRegs(), UnifiedRenameMap::init(), and numFreeIntRegs().
|
private |
The list of free predicate registers.
Definition at line 139 of file free_list.hh.
Referenced by addReg(), addRegs(), addVecPredReg(), getVecPredReg(), hasFreeVecPredRegs(), UnifiedRenameMap::init(), and numFreeVecPredRegs().
|
private |
The register file object is used only to distinguish integer from floating-point physical register indices.
Definition at line 148 of file free_list.hh.
Referenced by UnifiedFreeList().
|
private |
The list of free vector element registers.
Definition at line 135 of file free_list.hh.
Referenced by addReg(), addRegs(), addVecElem(), getVecElem(), hasFreeVecElems(), UnifiedRenameMap::init(), and numFreeVecElems().
|
private |
The following two are exclusive interfaces.
The list of free vector registers.
Definition at line 132 of file free_list.hh.
Referenced by addReg(), addRegs(), addVecReg(), getVecReg(), hasFreeVecRegs(), UnifiedRenameMap::init(), and numFreeVecRegs().