gem5
|
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... | |
PhysRegIndex | getIntReg () |
Gets a free integer register. More... | |
PhysRegIndex | getFloatReg () |
Gets a free fp register. More... | |
PhysRegIndex | getCCReg () |
Gets a free cc register. More... | |
void | addReg (PhysRegIndex freed_reg) |
Adds a register back to the free list. More... | |
void | addIntReg (PhysRegIndex freed_reg) |
Adds an integer register back to the free list. More... | |
void | addFloatReg (PhysRegIndex freed_reg) |
Adds a fp register back to the free list. More... | |
void | addCCReg (PhysRegIndex 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 | 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 | 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 | 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... | |
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 95 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 39 of file free_list.cc.
References DPRINTF, PhysRegFile::initFreeList(), and regFile.
|
inline |
Adds a cc register back to the free list.
Definition at line 161 of file free_list.hh.
References SimpleFreeList::addReg(), and ccList.
Referenced by PhysRegFile::initFreeList().
|
inline |
Adds a fp register back to the free list.
Definition at line 158 of file free_list.hh.
References SimpleFreeList::addReg(), and floatList.
Referenced by PhysRegFile::initFreeList().
|
inline |
Adds an integer register back to the free list.
Definition at line 155 of file free_list.hh.
References SimpleFreeList::addReg(), and intList.
Referenced by PhysRegFile::initFreeList().
|
inline |
Adds a register back to the free list.
Definition at line 183 of file free_list.hh.
References SimpleFreeList::addReg(), ccList, DPRINTF, floatList, intList, PhysRegFile::isCCPhysReg(), PhysRegFile::isFloatPhysReg(), PhysRegFile::isIntPhysReg(), and regFile.
|
inline |
Returns a pointer to the condition-code free list.
Definition at line 140 of file free_list.hh.
References ccList.
|
inline |
Gets a free cc register.
Definition at line 149 of file free_list.hh.
References ccList, and SimpleFreeList::getReg().
|
inline |
Gets a free fp register.
Definition at line 146 of file free_list.hh.
References floatList, and SimpleFreeList::getReg().
|
inline |
Gets a free integer register.
Definition at line 143 of file free_list.hh.
References SimpleFreeList::getReg(), and intList.
|
inline |
Checks if there are any free cc registers.
Definition at line 170 of file free_list.hh.
References ccList, and SimpleFreeList::hasFreeRegs().
|
inline |
Checks if there are any free fp registers.
Definition at line 167 of file free_list.hh.
References floatList, and SimpleFreeList::hasFreeRegs().
|
inline |
Checks if there are any free integer registers.
Definition at line 164 of file free_list.hh.
References SimpleFreeList::hasFreeRegs(), and intList.
|
inline |
|
inline |
Returns the number of free cc registers.
Definition at line 179 of file free_list.hh.
References ccList, and SimpleFreeList::numFreeRegs().
|
inline |
Returns the number of free fp registers.
Definition at line 176 of file free_list.hh.
References floatList, and SimpleFreeList::numFreeRegs().
|
inline |
Returns the number of free integer registers.
Definition at line 173 of file free_list.hh.
References intList, and SimpleFreeList::numFreeRegs().
|
friend |
Definition at line 123 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 101 of file free_list.hh.
Referenced by name().
|
private |
The list of free condition-code registers.
Definition at line 110 of file free_list.hh.
Referenced by addCCReg(), addReg(), getCCList(), getCCReg(), hasFreeCCRegs(), UnifiedRenameMap::init(), and numFreeCCRegs().
|
private |
The list of free floating point registers.
Definition at line 107 of file free_list.hh.
Referenced by addFloatReg(), addReg(), getFloatReg(), hasFreeFloatRegs(), UnifiedRenameMap::init(), and numFreeFloatRegs().
|
private |
The list of free integer registers.
Definition at line 104 of file free_list.hh.
Referenced by addIntReg(), addReg(), getIntReg(), hasFreeIntRegs(), UnifiedRenameMap::init(), and numFreeIntRegs().
|
private |
The register file object is used only to distinguish integer from floating-point physical register indices.
Definition at line 116 of file free_list.hh.
Referenced by addReg(), and UnifiedFreeList().