gem5  v21.1.0.2
Public Member Functions | Private Attributes | Friends | List of all members
gem5::o3::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 122 of file free_list.hh.

Constructor & Destructor Documentation

◆ UnifiedFreeList()

gem5::o3::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 41 of file free_list.cc.

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

Member Function Documentation

◆ addCCReg()

void gem5::o3::UnifiedFreeList::addCCReg ( PhysRegIdPtr  freed_reg)
inline

Adds a cc register back to the free list.

Definition at line 224 of file free_list.hh.

References gem5::o3::SimpleFreeList::addReg(), and ccList.

◆ addFloatReg()

void gem5::o3::UnifiedFreeList::addFloatReg ( PhysRegIdPtr  freed_reg)
inline

Adds a fp register back to the free list.

Definition at line 210 of file free_list.hh.

References gem5::o3::SimpleFreeList::addReg(), and floatList.

◆ addIntReg()

void gem5::o3::UnifiedFreeList::addIntReg ( PhysRegIdPtr  freed_reg)
inline

Adds an integer register back to the free list.

Definition at line 207 of file free_list.hh.

References gem5::o3::SimpleFreeList::addReg(), and intList.

◆ addReg()

void gem5::o3::UnifiedFreeList::addReg ( PhysRegIdPtr  freed_reg)
inline

◆ addRegs()

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

◆ addVecElem()

void gem5::o3::UnifiedFreeList::addVecElem ( PhysRegIdPtr  freed_reg)
inline

Adds a vector element register back to the free list.

Definition at line 216 of file free_list.hh.

References gem5::o3::SimpleFreeList::addReg(), and vecElemList.

◆ addVecPredReg()

void gem5::o3::UnifiedFreeList::addVecPredReg ( PhysRegIdPtr  freed_reg)
inline

Adds a predicate register back to the free list.

Definition at line 221 of file free_list.hh.

References gem5::o3::SimpleFreeList::addReg(), and predList.

◆ addVecReg()

void gem5::o3::UnifiedFreeList::addVecReg ( PhysRegIdPtr  freed_reg)
inline

Adds a vector register back to the free list.

Definition at line 213 of file free_list.hh.

References gem5::o3::SimpleFreeList::addReg(), and vecList.

◆ getCCList()

SimpleFreeList* gem5::o3::UnifiedFreeList::getCCList ( )
inline

Returns a pointer to the condition-code free list.

Definition at line 179 of file free_list.hh.

References ccList.

◆ getCCReg()

PhysRegIdPtr gem5::o3::UnifiedFreeList::getCCReg ( )
inline

Gets a free cc register.

Definition at line 197 of file free_list.hh.

References ccList, and gem5::o3::SimpleFreeList::getReg().

Referenced by gem5::o3::CPU::insertThread().

◆ getFloatReg()

PhysRegIdPtr gem5::o3::UnifiedFreeList::getFloatReg ( )
inline

Gets a free fp register.

Definition at line 185 of file free_list.hh.

References floatList, and gem5::o3::SimpleFreeList::getReg().

Referenced by gem5::o3::CPU::insertThread().

◆ getIntReg()

PhysRegIdPtr gem5::o3::UnifiedFreeList::getIntReg ( )
inline

Gets a free integer register.

Definition at line 182 of file free_list.hh.

References gem5::o3::SimpleFreeList::getReg(), and intList.

Referenced by gem5::o3::CPU::insertThread().

◆ getVecElem()

PhysRegIdPtr gem5::o3::UnifiedFreeList::getVecElem ( )
inline

Gets a free vector elemenet register.

Definition at line 191 of file free_list.hh.

References gem5::o3::SimpleFreeList::getReg(), and vecElemList.

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().

◆ getVecPredReg()

PhysRegIdPtr gem5::o3::UnifiedFreeList::getVecPredReg ( )
inline

Gets a free predicate register.

Definition at line 194 of file free_list.hh.

References gem5::o3::SimpleFreeList::getReg(), and predList.

◆ getVecReg()

PhysRegIdPtr gem5::o3::UnifiedFreeList::getVecReg ( )
inline

Gets a free vector register.

Definition at line 188 of file free_list.hh.

References gem5::o3::SimpleFreeList::getReg(), and vecList.

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().

◆ hasFreeCCRegs()

bool gem5::o3::UnifiedFreeList::hasFreeCCRegs ( ) const
inline

Checks if there are any free cc registers.

Definition at line 242 of file free_list.hh.

References ccList, and gem5::o3::SimpleFreeList::hasFreeRegs().

◆ hasFreeFloatRegs()

bool gem5::o3::UnifiedFreeList::hasFreeFloatRegs ( ) const
inline

Checks if there are any free fp registers.

Definition at line 230 of file free_list.hh.

References floatList, and gem5::o3::SimpleFreeList::hasFreeRegs().

◆ hasFreeIntRegs()

bool gem5::o3::UnifiedFreeList::hasFreeIntRegs ( ) const
inline

Checks if there are any free integer registers.

Definition at line 227 of file free_list.hh.

References gem5::o3::SimpleFreeList::hasFreeRegs(), and intList.

◆ hasFreeVecElems()

bool gem5::o3::UnifiedFreeList::hasFreeVecElems ( ) const
inline

Checks if there are any free vector registers.

Definition at line 236 of file free_list.hh.

References gem5::o3::SimpleFreeList::hasFreeRegs(), and vecElemList.

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().

◆ hasFreeVecPredRegs()

bool gem5::o3::UnifiedFreeList::hasFreeVecPredRegs ( ) const
inline

Checks if there are any free predicate registers.

Definition at line 239 of file free_list.hh.

References gem5::o3::SimpleFreeList::hasFreeRegs(), and predList.

◆ hasFreeVecRegs()

bool gem5::o3::UnifiedFreeList::hasFreeVecRegs ( ) const
inline

Checks if there are any free vector registers.

Definition at line 233 of file free_list.hh.

References gem5::o3::SimpleFreeList::hasFreeRegs(), and vecList.

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().

◆ name()

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

Gives the name of the freelist.

Definition at line 176 of file free_list.hh.

References _name.

◆ numFreeCCRegs()

unsigned gem5::o3::UnifiedFreeList::numFreeCCRegs ( ) const
inline

Returns the number of free cc registers.

Definition at line 260 of file free_list.hh.

References ccList, and gem5::o3::SimpleFreeList::numFreeRegs().

◆ numFreeFloatRegs()

unsigned gem5::o3::UnifiedFreeList::numFreeFloatRegs ( ) const
inline

Returns the number of free fp registers.

Definition at line 248 of file free_list.hh.

References floatList, and gem5::o3::SimpleFreeList::numFreeRegs().

◆ numFreeIntRegs()

unsigned gem5::o3::UnifiedFreeList::numFreeIntRegs ( ) const
inline

Returns the number of free integer registers.

Definition at line 245 of file free_list.hh.

References intList, and gem5::o3::SimpleFreeList::numFreeRegs().

◆ numFreeVecElems()

unsigned gem5::o3::UnifiedFreeList::numFreeVecElems ( ) const
inline

Returns the number of free vector registers.

Definition at line 254 of file free_list.hh.

References gem5::o3::SimpleFreeList::numFreeRegs(), and vecElemList.

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().

◆ numFreeVecPredRegs()

unsigned gem5::o3::UnifiedFreeList::numFreeVecPredRegs ( ) const
inline

Returns the number of free predicate registers.

Definition at line 257 of file free_list.hh.

References gem5::o3::SimpleFreeList::numFreeRegs(), and predList.

◆ numFreeVecRegs()

unsigned gem5::o3::UnifiedFreeList::numFreeVecRegs ( ) const
inline

Returns the number of free vector registers.

Definition at line 251 of file free_list.hh.

References gem5::o3::SimpleFreeList::numFreeRegs(), and vecList.

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().

Friends And Related Function Documentation

◆ UnifiedRenameMap

friend class UnifiedRenameMap
friend

Definition at line 162 of file free_list.hh.

Member Data Documentation

◆ _name

const std::string gem5::o3::UnifiedFreeList::_name
private

The object name, for DPRINTF.

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

Definition at line 128 of file free_list.hh.

Referenced by name().

◆ ccList

SimpleFreeList gem5::o3::UnifiedFreeList::ccList
private

The list of free condition-code registers.

Definition at line 149 of file free_list.hh.

Referenced by addCCReg(), addReg(), addRegs(), getCCList(), getCCReg(), hasFreeCCRegs(), gem5::o3::UnifiedRenameMap::init(), and numFreeCCRegs().

◆ floatList

SimpleFreeList gem5::o3::UnifiedFreeList::floatList
private

The list of free floating point registers.

Definition at line 134 of file free_list.hh.

Referenced by addFloatReg(), addReg(), addRegs(), getFloatReg(), hasFreeFloatRegs(), gem5::o3::UnifiedRenameMap::init(), and numFreeFloatRegs().

◆ intList

SimpleFreeList gem5::o3::UnifiedFreeList::intList
private

The list of free integer registers.

Definition at line 131 of file free_list.hh.

Referenced by addIntReg(), addReg(), addRegs(), getIntReg(), hasFreeIntRegs(), gem5::o3::UnifiedRenameMap::init(), and numFreeIntRegs().

◆ predList

SimpleFreeList gem5::o3::UnifiedFreeList::predList
private

The list of free predicate registers.

Definition at line 146 of file free_list.hh.

Referenced by addReg(), addRegs(), addVecPredReg(), getVecPredReg(), hasFreeVecPredRegs(), gem5::o3::UnifiedRenameMap::init(), and numFreeVecPredRegs().

◆ regFile

PhysRegFile* gem5::o3::UnifiedFreeList::regFile
private

The register file object is used only to distinguish integer from floating-point physical register indices.

Definition at line 155 of file free_list.hh.

Referenced by UnifiedFreeList().

◆ vecElemList

SimpleFreeList gem5::o3::UnifiedFreeList::vecElemList
private

The list of free vector element registers.

Definition at line 142 of file free_list.hh.

Referenced by addReg(), addRegs(), addVecElem(), getVecElem(), hasFreeVecElems(), gem5::o3::UnifiedRenameMap::init(), and numFreeVecElems().

◆ vecList

SimpleFreeList gem5::o3::UnifiedFreeList::vecList
private

The following two are exclusive interfaces.

The list of free vector registers.

Definition at line 139 of file free_list.hh.

Referenced by addReg(), addRegs(), addVecReg(), getVecReg(), hasFreeVecRegs(), gem5::o3::UnifiedRenameMap::init(), and numFreeVecRegs().


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

Generated on Tue Sep 21 2021 12:31:47 for gem5 by doxygen 1.8.17