gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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...
 
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...
 
PhysRegFileregFile
 The register file object is used only to distinguish integer from floating-point physical register indices. 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 95 of file free_list.hh.

Constructor & Destructor Documentation

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 39 of file free_list.cc.

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

Member Function Documentation

void UnifiedFreeList::addCCReg ( PhysRegIndex  freed_reg)
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().

void UnifiedFreeList::addFloatReg ( PhysRegIndex  freed_reg)
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().

void UnifiedFreeList::addIntReg ( PhysRegIndex  freed_reg)
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().

void UnifiedFreeList::addReg ( PhysRegIndex  freed_reg)
inline
SimpleFreeList* UnifiedFreeList::getCCList ( )
inline

Returns a pointer to the condition-code free list.

Definition at line 140 of file free_list.hh.

References ccList.

PhysRegIndex UnifiedFreeList::getCCReg ( )
inline

Gets a free cc register.

Definition at line 149 of file free_list.hh.

References ccList, and SimpleFreeList::getReg().

PhysRegIndex UnifiedFreeList::getFloatReg ( )
inline

Gets a free fp register.

Definition at line 146 of file free_list.hh.

References floatList, and SimpleFreeList::getReg().

PhysRegIndex UnifiedFreeList::getIntReg ( )
inline

Gets a free integer register.

Definition at line 143 of file free_list.hh.

References SimpleFreeList::getReg(), and intList.

bool UnifiedFreeList::hasFreeCCRegs ( ) const
inline

Checks if there are any free cc registers.

Definition at line 170 of file free_list.hh.

References ccList, and SimpleFreeList::hasFreeRegs().

bool UnifiedFreeList::hasFreeFloatRegs ( ) const
inline

Checks if there are any free fp registers.

Definition at line 167 of file free_list.hh.

References floatList, and SimpleFreeList::hasFreeRegs().

bool UnifiedFreeList::hasFreeIntRegs ( ) const
inline

Checks if there are any free integer registers.

Definition at line 164 of file free_list.hh.

References SimpleFreeList::hasFreeRegs(), and intList.

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

Gives the name of the freelist.

Definition at line 137 of file free_list.hh.

References _name.

unsigned UnifiedFreeList::numFreeCCRegs ( ) const
inline

Returns the number of free cc registers.

Definition at line 179 of file free_list.hh.

References ccList, and SimpleFreeList::numFreeRegs().

unsigned UnifiedFreeList::numFreeFloatRegs ( ) const
inline

Returns the number of free fp registers.

Definition at line 176 of file free_list.hh.

References floatList, and SimpleFreeList::numFreeRegs().

unsigned UnifiedFreeList::numFreeIntRegs ( ) const
inline

Returns the number of free integer registers.

Definition at line 173 of file free_list.hh.

References intList, and SimpleFreeList::numFreeRegs().

Friends And Related Function Documentation

friend class UnifiedRenameMap
friend

Definition at line 123 of file free_list.hh.

Member Data Documentation

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 101 of file free_list.hh.

Referenced by name().

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

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

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

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


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

Generated on Fri Jun 9 2017 13:04:22 for gem5 by doxygen 1.8.6