gem5  v22.1.0.0
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...
 
PhysRegIdPtr getReg (RegClassType type)
 Gets a free register of type type. More...
 
template<class InputIt >
void addRegs (InputIt first, InputIt last)
 Adds a register back to the free list. More...
 
void addReg (PhysRegIdPtr freed_reg)
 Adds a register back to the free list. More...
 
bool hasFreeRegs (RegClassType type) const
 Checks if there are any free registers of type type. More...
 
unsigned numFreeRegs (RegClassType type) const
 Returns the number of free registers of type type. More...
 

Private Attributes

const std::string _name
 The object name, for DPRINTF. More...
 
std::array< SimpleFreeList, CCRegClass+1 > freeLists
 
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 124 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

◆ addReg()

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

Adds a register back to the free list.

Definition at line 174 of file free_list.hh.

References gem5::PhysRegId::classValue(), and freeLists.

Referenced by addRegs(), gem5::o3::Rename::doSquash(), and gem5::o3::Rename::removeFromHistory().

◆ addRegs()

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

Adds a register back to the free list.

Definition at line 167 of file free_list.hh.

References addReg(), and gem5::X86ISA::reg.

Referenced by gem5::o3::PhysRegFile::initFreeList().

◆ getReg()

PhysRegIdPtr gem5::o3::UnifiedFreeList::getReg ( RegClassType  type)
inline

Gets a free register of type type.

Definition at line 162 of file free_list.hh.

References freeLists, and gem5::X86ISA::type.

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

◆ hasFreeRegs()

bool gem5::o3::UnifiedFreeList::hasFreeRegs ( RegClassType  type) const
inline

Checks if there are any free registers of type type.

Definition at line 181 of file free_list.hh.

References freeLists, and gem5::X86ISA::type.

◆ name()

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

Gives the name of the freelist.

Definition at line 159 of file free_list.hh.

References _name.

◆ numFreeRegs()

unsigned gem5::o3::UnifiedFreeList::numFreeRegs ( RegClassType  type) const
inline

Returns the number of free registers of type type.

Definition at line 188 of file free_list.hh.

References freeLists, and gem5::X86ISA::type.

Friends And Related Function Documentation

◆ UnifiedRenameMap

friend class UnifiedRenameMap
friend

Definition at line 145 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 130 of file free_list.hh.

Referenced by name().

◆ freeLists

std::array<SimpleFreeList, CCRegClass + 1> gem5::o3::UnifiedFreeList::freeLists
private

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

Referenced by UnifiedFreeList().


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

Generated on Wed Dec 21 2022 10:24:18 for gem5 by doxygen 1.9.1