gem5  v20.1.0.0
Public Member Functions | Private Attributes | Friends | List of all members
UnifiedFreeList Class Reference

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...
 
SimpleFreeListgetCCList ()
 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...
 
PhysRegFileregFile
 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
 

Detailed Description

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".

Todo:
: Give a better name to the base FP dependency.

Definition at line 115 of file free_list.hh.

Constructor & Destructor Documentation

◆ UnifiedFreeList()

UnifiedFreeList::UnifiedFreeList ( const std::string &  _my_name,
PhysRegFile _regFile 
)

Constructs a free list.

Parameters
_numPhysicalIntRegsNumber of physical integer registers.
reservedIntRegsNumber of integer registers already used by initial mappings.
_numPhysicalFloatRegsNumber of physical fp registers.
reservedFloatRegsNumber of fp registers already used by initial mappings.

Definition at line 37 of file free_list.cc.

References DPRINTF, PhysRegFile::initFreeList(), and regFile.

Member Function Documentation

◆ addCCReg()

void UnifiedFreeList::addCCReg ( PhysRegIdPtr  freed_reg)
inline

Adds a cc register back to the free list.

Definition at line 217 of file free_list.hh.

References SimpleFreeList::addReg(), and ccList.

◆ addFloatReg()

void UnifiedFreeList::addFloatReg ( PhysRegIdPtr  freed_reg)
inline

Adds a fp register back to the free list.

Definition at line 203 of file free_list.hh.

References SimpleFreeList::addReg(), and floatList.

◆ addIntReg()

void UnifiedFreeList::addIntReg ( PhysRegIdPtr  freed_reg)
inline

Adds an integer register back to the free list.

Definition at line 200 of file free_list.hh.

References SimpleFreeList::addReg(), and intList.

◆ addReg()

void UnifiedFreeList::addReg ( PhysRegIdPtr  freed_reg)
inline

◆ addRegs()

template<class InputIt >
void UnifiedFreeList::addRegs ( InputIt  first,
InputIt  last 
)
inline

◆ addVecElem()

void UnifiedFreeList::addVecElem ( PhysRegIdPtr  freed_reg)
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.

◆ addVecPredReg()

void UnifiedFreeList::addVecPredReg ( PhysRegIdPtr  freed_reg)
inline

Adds a predicate register back to the free list.

Definition at line 214 of file free_list.hh.

References SimpleFreeList::addReg(), and predList.

◆ addVecReg()

void UnifiedFreeList::addVecReg ( PhysRegIdPtr  freed_reg)
inline

Adds a vector register back to the free list.

Definition at line 206 of file free_list.hh.

References SimpleFreeList::addReg(), and vecList.

◆ getCCList()

SimpleFreeList* UnifiedFreeList::getCCList ( )
inline

Returns a pointer to the condition-code free list.

Definition at line 172 of file free_list.hh.

References ccList.

◆ getCCReg()

PhysRegIdPtr UnifiedFreeList::getCCReg ( )
inline

Gets a free cc register.

Definition at line 190 of file free_list.hh.

References ccList, and SimpleFreeList::getReg().

◆ getFloatReg()

PhysRegIdPtr UnifiedFreeList::getFloatReg ( )
inline

Gets a free fp register.

Definition at line 178 of file free_list.hh.

References floatList, and SimpleFreeList::getReg().

◆ getIntReg()

PhysRegIdPtr UnifiedFreeList::getIntReg ( )
inline

Gets a free integer register.

Definition at line 175 of file free_list.hh.

References SimpleFreeList::getReg(), and intList.

◆ getVecElem()

PhysRegIdPtr UnifiedFreeList::getVecElem ( )
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().

◆ getVecPredReg()

PhysRegIdPtr UnifiedFreeList::getVecPredReg ( )
inline

Gets a free predicate register.

Definition at line 187 of file free_list.hh.

References SimpleFreeList::getReg(), and predList.

◆ getVecReg()

PhysRegIdPtr UnifiedFreeList::getVecReg ( )
inline

Gets a free vector register.

Definition at line 181 of file free_list.hh.

References SimpleFreeList::getReg(), and vecList.

Referenced by UnifiedRenameMap::switchFreeList().

◆ hasFreeCCRegs()

bool UnifiedFreeList::hasFreeCCRegs ( ) const
inline

Checks if there are any free cc registers.

Definition at line 235 of file free_list.hh.

References ccList, and SimpleFreeList::hasFreeRegs().

◆ hasFreeFloatRegs()

bool UnifiedFreeList::hasFreeFloatRegs ( ) const
inline

Checks if there are any free fp registers.

Definition at line 223 of file free_list.hh.

References floatList, and SimpleFreeList::hasFreeRegs().

◆ hasFreeIntRegs()

bool UnifiedFreeList::hasFreeIntRegs ( ) const
inline

Checks if there are any free integer registers.

Definition at line 220 of file free_list.hh.

References SimpleFreeList::hasFreeRegs(), and intList.

◆ hasFreeVecElems()

bool UnifiedFreeList::hasFreeVecElems ( ) const
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().

◆ hasFreeVecPredRegs()

bool UnifiedFreeList::hasFreeVecPredRegs ( ) const
inline

Checks if there are any free predicate registers.

Definition at line 232 of file free_list.hh.

References SimpleFreeList::hasFreeRegs(), and predList.

◆ hasFreeVecRegs()

bool UnifiedFreeList::hasFreeVecRegs ( ) const
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().

◆ name()

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

Gives the name of the freelist.

Definition at line 169 of file free_list.hh.

References _name.

◆ numFreeCCRegs()

unsigned UnifiedFreeList::numFreeCCRegs ( ) const
inline

Returns the number of free cc registers.

Definition at line 253 of file free_list.hh.

References ccList, and SimpleFreeList::numFreeRegs().

◆ numFreeFloatRegs()

unsigned UnifiedFreeList::numFreeFloatRegs ( ) const
inline

Returns the number of free fp registers.

Definition at line 241 of file free_list.hh.

References floatList, and SimpleFreeList::numFreeRegs().

◆ numFreeIntRegs()

unsigned UnifiedFreeList::numFreeIntRegs ( ) const
inline

Returns the number of free integer registers.

Definition at line 238 of file free_list.hh.

References intList, and SimpleFreeList::numFreeRegs().

◆ numFreeVecElems()

unsigned UnifiedFreeList::numFreeVecElems ( ) const
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().

◆ numFreeVecPredRegs()

unsigned UnifiedFreeList::numFreeVecPredRegs ( ) const
inline

Returns the number of free predicate registers.

Definition at line 250 of file free_list.hh.

References SimpleFreeList::numFreeRegs(), and predList.

◆ numFreeVecRegs()

unsigned UnifiedFreeList::numFreeVecRegs ( ) const
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().

Friends And Related Function Documentation

◆ UnifiedRenameMap

friend class UnifiedRenameMap
friend

Definition at line 155 of file free_list.hh.

Member Data Documentation

◆ _name

const std::string UnifiedFreeList::_name
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().

◆ ccList

SimpleFreeList UnifiedFreeList::ccList
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().

◆ floatList

SimpleFreeList UnifiedFreeList::floatList
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().

◆ intList

SimpleFreeList UnifiedFreeList::intList
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().

◆ predList

SimpleFreeList UnifiedFreeList::predList
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().

◆ regFile

PhysRegFile* UnifiedFreeList::regFile
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().

◆ vecElemList

SimpleFreeList UnifiedFreeList::vecElemList
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().

◆ vecList

SimpleFreeList UnifiedFreeList::vecList
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().


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

Generated on Wed Sep 30 2020 14:02:33 for gem5 by doxygen 1.8.17