gem5  v22.1.0.0
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
gem5::o3::PhysRegFile Class Reference

Simple physical register file class. More...

#include <regfile.hh>

Public Types

using IdRange = std::pair< PhysIds::iterator, PhysIds::iterator >
 

Public Member Functions

 PhysRegFile (unsigned _numPhysicalIntRegs, unsigned _numPhysicalFloatRegs, unsigned _numPhysicalVecRegs, unsigned _numPhysicalVecPredRegs, unsigned _numPhysicalCCRegs, const BaseISA::RegClasses &classes)
 Constructs a physical register file with the specified amount of integer and floating point registers. More...
 
 ~PhysRegFile ()
 Destructor to free resources. More...
 
void initFreeList (UnifiedFreeList *freeList)
 Initialize the free list. More...
 
unsigned totalNumPhysRegs () const
 
PhysRegIdPtr getMiscRegId (RegIndex reg_idx)
 Gets a misc register PhysRegIdPtr. More...
 
RegVal getReg (PhysRegIdPtr phys_reg) const
 
void getReg (PhysRegIdPtr phys_reg, void *val) const
 
void * getWritableReg (PhysRegIdPtr phys_reg)
 
void setReg (PhysRegIdPtr phys_reg, RegVal val)
 
void setReg (PhysRegIdPtr phys_reg, const void *val)
 
IdRange getRegIds (RegClassType cls)
 Get the PhysRegIds of the elems of all vector registers. More...
 
PhysRegIdPtr getTrueId (PhysRegIdPtr reg)
 Get the true physical register id. More...
 

Private Types

using PhysIds = std::vector< PhysRegId >
 

Private Attributes

RegFile intRegFile
 Integer register file. More...
 
std::vector< PhysRegIdintRegIds
 
RegFile floatRegFile
 Floating point register file. More...
 
std::vector< PhysRegIdfloatRegIds
 
RegFile vectorRegFile
 Vector register file. More...
 
std::vector< PhysRegIdvecRegIds
 
RegFile vectorElemRegFile
 Vector element register file. More...
 
std::vector< PhysRegIdvecElemIds
 
RegFile vecPredRegFile
 Predicate register file. More...
 
std::vector< PhysRegIdvecPredRegIds
 
RegFile ccRegFile
 Condition-code register file. More...
 
std::vector< PhysRegIdccRegIds
 
std::vector< PhysRegIdmiscRegIds
 Misc Reg Ids. More...
 
unsigned numPhysicalIntRegs
 Number of physical general purpose registers. More...
 
unsigned numPhysicalFloatRegs
 Number of physical floating point registers. More...
 
unsigned numPhysicalVecRegs
 Number of physical vector registers. More...
 
unsigned numPhysicalVecElemRegs
 Number of physical vector element registers. More...
 
unsigned numPhysicalVecPredRegs
 Number of physical predicate registers. More...
 
unsigned numPhysicalCCRegs
 Number of physical CC registers. More...
 
unsigned totalNumRegs
 Total number of physical registers. More...
 

Detailed Description

Simple physical register file class.

Definition at line 65 of file regfile.hh.

Member Typedef Documentation

◆ IdRange

using gem5::o3::PhysRegFile::IdRange = std::pair<PhysIds::iterator, PhysIds::iterator>

Definition at line 71 of file regfile.hh.

◆ PhysIds

Definition at line 69 of file regfile.hh.

Constructor & Destructor Documentation

◆ PhysRegFile()

gem5::o3::PhysRegFile::PhysRegFile ( unsigned  _numPhysicalIntRegs,
unsigned  _numPhysicalFloatRegs,
unsigned  _numPhysicalVecRegs,
unsigned  _numPhysicalVecPredRegs,
unsigned  _numPhysicalCCRegs,
const BaseISA::RegClasses classes 
)

◆ ~PhysRegFile()

gem5::o3::PhysRegFile::~PhysRegFile ( )
inline

Destructor to free resources.

Definition at line 149 of file regfile.hh.

Member Function Documentation

◆ getMiscRegId()

PhysRegIdPtr gem5::o3::PhysRegFile::getMiscRegId ( RegIndex  reg_idx)
inline

Gets a misc register PhysRegIdPtr.

Definition at line 158 of file regfile.hh.

References miscRegIds.

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

◆ getReg() [1/2]

RegVal gem5::o3::PhysRegFile::getReg ( PhysRegIdPtr  phys_reg) const
inline

◆ getReg() [2/2]

void gem5::o3::PhysRegFile::getReg ( PhysRegIdPtr  phys_reg,
void *  val 
) const
inline

◆ getRegIds()

PhysRegFile::IdRange gem5::o3::PhysRegFile::getRegIds ( RegClassType  cls)

Get the PhysRegIds of the elems of all vector registers.

Auxiliary function to transition from Full vector mode to Elem mode and to initialise the rename map.

Definition at line 179 of file regfile.cc.

References gem5::CCRegClass, ccRegIds, gem5::FloatRegClass, floatRegIds, gem5::IntRegClass, intRegIds, gem5::InvalidRegClass, gem5::MiscRegClass, miscRegIds, panic, gem5::VecElemClass, vecElemIds, gem5::VecPredRegClass, vecPredRegIds, gem5::VecRegClass, and vecRegIds.

◆ getTrueId()

PhysRegIdPtr gem5::o3::PhysRegFile::getTrueId ( PhysRegIdPtr  reg)

Get the true physical register id.

As many parts work with PhysRegIdPtr, we need to be able to produce the pointer out of just class and register idx.

Definition at line 206 of file regfile.cc.

References panic_if, gem5::X86ISA::reg, gem5::VecElemClass, vecElemIds, gem5::VecRegClass, and vecRegIds.

◆ getWritableReg()

void* gem5::o3::PhysRegFile::getWritableReg ( PhysRegIdPtr  phys_reg)
inline

◆ initFreeList()

void gem5::o3::PhysRegFile::initFreeList ( UnifiedFreeList freeList)

◆ setReg() [1/2]

void gem5::o3::PhysRegFile::setReg ( PhysRegIdPtr  phys_reg,
const void *  val 
)
inline

◆ setReg() [2/2]

void gem5::o3::PhysRegFile::setReg ( PhysRegIdPtr  phys_reg,
RegVal  val 
)
inline

◆ totalNumPhysRegs()

unsigned gem5::o3::PhysRegFile::totalNumPhysRegs ( ) const
inline
Returns
the total number of physical registers.

Definition at line 155 of file regfile.hh.

References totalNumRegs.

Member Data Documentation

◆ ccRegFile

RegFile gem5::o3::PhysRegFile::ccRegFile
private

Condition-code register file.

Definition at line 95 of file regfile.hh.

Referenced by getReg(), and setReg().

◆ ccRegIds

std::vector<PhysRegId> gem5::o3::PhysRegFile::ccRegIds
private

Definition at line 96 of file regfile.hh.

Referenced by getRegIds(), initFreeList(), and PhysRegFile().

◆ floatRegFile

RegFile gem5::o3::PhysRegFile::floatRegFile
private

Floating point register file.

Definition at line 79 of file regfile.hh.

Referenced by getReg(), and setReg().

◆ floatRegIds

std::vector<PhysRegId> gem5::o3::PhysRegFile::floatRegIds
private

Definition at line 80 of file regfile.hh.

Referenced by getRegIds(), initFreeList(), and PhysRegFile().

◆ intRegFile

RegFile gem5::o3::PhysRegFile::intRegFile
private

Integer register file.

Definition at line 75 of file regfile.hh.

Referenced by getReg(), and setReg().

◆ intRegIds

std::vector<PhysRegId> gem5::o3::PhysRegFile::intRegIds
private

Definition at line 76 of file regfile.hh.

Referenced by getRegIds(), initFreeList(), and PhysRegFile().

◆ miscRegIds

std::vector<PhysRegId> gem5::o3::PhysRegFile::miscRegIds
private

Misc Reg Ids.

Definition at line 99 of file regfile.hh.

Referenced by getMiscRegId(), getRegIds(), and PhysRegFile().

◆ numPhysicalCCRegs

unsigned gem5::o3::PhysRegFile::numPhysicalCCRegs
private

Number of physical CC registers.

Definition at line 129 of file regfile.hh.

Referenced by initFreeList(), and PhysRegFile().

◆ numPhysicalFloatRegs

unsigned gem5::o3::PhysRegFile::numPhysicalFloatRegs
private

Number of physical floating point registers.

Definition at line 109 of file regfile.hh.

Referenced by initFreeList(), and PhysRegFile().

◆ numPhysicalIntRegs

unsigned gem5::o3::PhysRegFile::numPhysicalIntRegs
private

Number of physical general purpose registers.

Definition at line 104 of file regfile.hh.

Referenced by initFreeList(), and PhysRegFile().

◆ numPhysicalVecElemRegs

unsigned gem5::o3::PhysRegFile::numPhysicalVecElemRegs
private

Number of physical vector element registers.

Definition at line 119 of file regfile.hh.

Referenced by initFreeList(), and PhysRegFile().

◆ numPhysicalVecPredRegs

unsigned gem5::o3::PhysRegFile::numPhysicalVecPredRegs
private

Number of physical predicate registers.

Definition at line 124 of file regfile.hh.

Referenced by initFreeList(), and PhysRegFile().

◆ numPhysicalVecRegs

unsigned gem5::o3::PhysRegFile::numPhysicalVecRegs
private

Number of physical vector registers.

Definition at line 114 of file regfile.hh.

Referenced by initFreeList(), and PhysRegFile().

◆ totalNumRegs

unsigned gem5::o3::PhysRegFile::totalNumRegs
private

Total number of physical registers.

Definition at line 132 of file regfile.hh.

Referenced by totalNumPhysRegs().

◆ vecElemIds

std::vector<PhysRegId> gem5::o3::PhysRegFile::vecElemIds
private

Definition at line 88 of file regfile.hh.

Referenced by getRegIds(), getTrueId(), initFreeList(), and PhysRegFile().

◆ vecPredRegFile

RegFile gem5::o3::PhysRegFile::vecPredRegFile
private

Predicate register file.

Definition at line 91 of file regfile.hh.

Referenced by getReg(), getWritableReg(), and setReg().

◆ vecPredRegIds

std::vector<PhysRegId> gem5::o3::PhysRegFile::vecPredRegIds
private

Definition at line 92 of file regfile.hh.

Referenced by getRegIds(), initFreeList(), and PhysRegFile().

◆ vecRegIds

std::vector<PhysRegId> gem5::o3::PhysRegFile::vecRegIds
private

Definition at line 84 of file regfile.hh.

Referenced by getRegIds(), getTrueId(), initFreeList(), and PhysRegFile().

◆ vectorElemRegFile

RegFile gem5::o3::PhysRegFile::vectorElemRegFile
private

Vector element register file.

Definition at line 87 of file regfile.hh.

Referenced by getReg(), and setReg().

◆ vectorRegFile

RegFile gem5::o3::PhysRegFile::vectorRegFile
private

Vector register file.

Definition at line 83 of file regfile.hh.

Referenced by getReg(), getWritableReg(), and setReg().


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