gem5  v21.1.0.2
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 &regClasses, VecMode vmode)
 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 numIntPhysRegs () const
 
unsigned numFloatPhysRegs () const
 
unsigned numVecPhysRegs () const
 
unsigned numPredPhysRegs () const
 
unsigned numVecElemPhysRegs () const
 
unsigned numCCPhysRegs () const
 
unsigned totalNumPhysRegs () const
 
PhysRegIdPtr getMiscRegId (RegIndex reg_idx)
 Gets a misc register PhysRegIdPtr. More...
 
RegVal readIntReg (PhysRegIdPtr phys_reg) const
 Reads an integer register. More...
 
RegVal readFloatReg (PhysRegIdPtr phys_reg) const
 
const TheISA::VecRegContainer & readVecReg (PhysRegIdPtr phys_reg) const
 Reads a vector register. More...
 
TheISA::VecRegContainer & getWritableVecReg (PhysRegIdPtr phys_reg)
 Reads a vector register for modification. More...
 
const TheISA::VecElem & readVecElem (PhysRegIdPtr phys_reg) const
 Reads a vector element. More...
 
const TheISA::VecPredRegContainer & readVecPredReg (PhysRegIdPtr phys_reg) const
 Reads a predicate register. More...
 
TheISA::VecPredRegContainer & getWritableVecPredReg (PhysRegIdPtr phys_reg)
 
RegVal readCCReg (PhysRegIdPtr phys_reg)
 Reads a condition-code register. More...
 
void setIntReg (PhysRegIdPtr phys_reg, RegVal val)
 Sets an integer register to the given value. More...
 
void setFloatReg (PhysRegIdPtr phys_reg, RegVal val)
 
void setVecReg (PhysRegIdPtr phys_reg, const TheISA::VecRegContainer &val)
 Sets a vector register to the given value. More...
 
void setVecElem (PhysRegIdPtr phys_reg, const TheISA::VecElem val)
 Sets a vector register to the given value. More...
 
void setVecPredReg (PhysRegIdPtr phys_reg, const TheISA::VecPredRegContainer &val)
 Sets a predicate register to the given value. More...
 
void setCCReg (PhysRegIdPtr phys_reg, RegVal val)
 Sets a condition-code register to the given value. More...
 
IdRange getRegElemIds (PhysRegIdPtr reg)
 Get the PhysRegIds of the elems of a vector register. More...
 
IdRange getRegIds (RegClass 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 >
 
using VecMode = enums::VecRegRenameMode
 

Private Attributes

std::vector< RegValintRegFile
 Integer register file. More...
 
std::vector< PhysRegIdintRegIds
 
RegId zeroReg
 
std::vector< RegValfloatRegFile
 Floating point register file. More...
 
std::vector< PhysRegIdfloatRegIds
 
std::vector< TheISA::VecRegContainer > vectorRegFile
 Vector register file. More...
 
std::vector< PhysRegIdvecRegIds
 
std::vector< PhysRegIdvecElemIds
 
std::vector< TheISA::VecPredRegContainer > vecPredRegFile
 Predicate register file. More...
 
std::vector< PhysRegIdvecPredRegIds
 
std::vector< RegValccRegFile
 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...
 
VecMode vecMode
 Mode in which vector registers are addressed. More...
 

Detailed Description

Simple physical register file class.

Definition at line 66 of file regfile.hh.

Member Typedef Documentation

◆ IdRange

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

Definition at line 74 of file regfile.hh.

◆ PhysIds

Definition at line 70 of file regfile.hh.

◆ VecMode

using gem5::o3::PhysRegFile::VecMode = enums::VecRegRenameMode
private

Definition at line 71 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 regClasses,
VecMode  vmode 
)

◆ ~PhysRegFile()

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

Destructor to free resources.

Definition at line 154 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 179 of file regfile.hh.

References miscRegIds.

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

◆ getRegElemIds()

PhysRegFile::IdRange gem5::o3::PhysRegFile::getRegElemIds ( PhysRegIdPtr  reg)

Get the PhysRegIds of the elems of a vector register.

Auxiliary function to transition from Full vector mode to Elem mode.

Definition at line 189 of file regfile.cc.

References gem5::ArmISA::NumVecElemPerVecReg, panic_if, gem5::X86ISA::reg, vecElemIds, and gem5::VecRegClass.

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList(), and gem5::o3::UnifiedRenameMap::switchMode().

◆ getRegIds()

PhysRegFile::IdRange gem5::o3::PhysRegFile::getRegIds ( RegClass  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 200 of file regfile.cc.

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

Referenced by gem5::o3::UnifiedRenameMap::switchFreeList(), and gem5::o3::UnifiedRenameMap::switchMode().

◆ 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 225 of file regfile.cc.

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

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

◆ getWritableVecPredReg()

TheISA::VecPredRegContainer& gem5::o3::PhysRegFile::getWritableVecPredReg ( PhysRegIdPtr  phys_reg)
inline

Definition at line 256 of file regfile.hh.

References readVecPredReg().

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

◆ getWritableVecReg()

TheISA::VecRegContainer& gem5::o3::PhysRegFile::getWritableVecReg ( PhysRegIdPtr  phys_reg)
inline

Reads a vector register for modification.

Definition at line 222 of file regfile.hh.

References readVecReg().

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

◆ initFreeList()

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

◆ numCCPhysRegs()

unsigned gem5::o3::PhysRegFile::numCCPhysRegs ( ) const
inline
Returns
the number of condition-code physical registers.

Definition at line 173 of file regfile.hh.

References numPhysicalCCRegs.

◆ numFloatPhysRegs()

unsigned gem5::o3::PhysRegFile::numFloatPhysRegs ( ) const
inline
Returns
the number of floating-point physical registers.

Definition at line 163 of file regfile.hh.

References numPhysicalFloatRegs.

◆ numIntPhysRegs()

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

Definition at line 160 of file regfile.hh.

References numPhysicalIntRegs.

◆ numPredPhysRegs()

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

Definition at line 167 of file regfile.hh.

References numPhysicalVecPredRegs.

◆ numVecElemPhysRegs()

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

Definition at line 170 of file regfile.hh.

References numPhysicalVecElemRegs.

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

◆ numVecPhysRegs()

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

Definition at line 165 of file regfile.hh.

References numPhysicalVecRegs.

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

◆ readCCReg()

RegVal gem5::o3::PhysRegFile::readCCReg ( PhysRegIdPtr  phys_reg)
inline

Reads a condition-code register.

Definition at line 265 of file regfile.hh.

References gem5::CCRegClass, ccRegFile, DPRINTF, gem5::PhysRegId::index(), and gem5::PhysRegId::is().

Referenced by gem5::o3::CPU::readArchCCReg(), and gem5::o3::CPU::readCCReg().

◆ readFloatReg()

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

◆ readIntReg()

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

Reads an integer register.

Definition at line 185 of file regfile.hh.

References DPRINTF, gem5::PhysRegId::index(), gem5::IntRegClass, intRegFile, and gem5::PhysRegId::is().

Referenced by gem5::o3::CPU::readArchIntReg(), and gem5::o3::CPU::readIntReg().

◆ readVecElem()

const TheISA::VecElem& gem5::o3::PhysRegFile::readVecElem ( PhysRegIdPtr  phys_reg) const
inline

◆ readVecPredReg()

const TheISA::VecPredRegContainer& gem5::o3::PhysRegFile::readVecPredReg ( PhysRegIdPtr  phys_reg) const
inline

Reads a predicate register.

Definition at line 244 of file regfile.hh.

References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::VecPredRegClass, and vecPredRegFile.

Referenced by getWritableVecPredReg(), and gem5::o3::CPU::readVecPredReg().

◆ readVecReg()

const TheISA::VecRegContainer& gem5::o3::PhysRegFile::readVecReg ( PhysRegIdPtr  phys_reg) const
inline

Reads a vector register.

Definition at line 209 of file regfile.hh.

References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::VecRegClass, and vectorRegFile.

Referenced by getWritableVecReg(), and gem5::o3::CPU::readVecReg().

◆ setCCReg()

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

Sets a condition-code register to the given value.

Definition at line 340 of file regfile.hh.

References gem5::CCRegClass, ccRegFile, DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), and gem5::X86ISA::val.

Referenced by gem5::o3::CPU::setArchCCReg(), and gem5::o3::CPU::setCCReg().

◆ setFloatReg()

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

◆ setIntReg()

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

Sets an integer register to the given value.

Definition at line 278 of file regfile.hh.

References DPRINTF, gem5::RegId::index(), gem5::PhysRegId::index(), gem5::IntRegClass, intRegFile, gem5::PhysRegId::is(), gem5::X86ISA::val, and zeroReg.

Referenced by gem5::o3::CPU::setArchIntReg(), and gem5::o3::CPU::setIntReg().

◆ setVecElem()

void gem5::o3::PhysRegFile::setVecElem ( PhysRegIdPtr  phys_reg,
const TheISA::VecElem  val 
)
inline

Sets a vector register to the given value.

Definition at line 314 of file regfile.hh.

References DPRINTF, gem5::PhysRegId::elemIndex(), gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::X86ISA::val, gem5::VecElemClass, and vectorRegFile.

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

◆ setVecPredReg()

void gem5::o3::PhysRegFile::setVecPredReg ( PhysRegIdPtr  phys_reg,
const TheISA::VecPredRegContainer &  val 
)
inline

Sets a predicate register to the given value.

Definition at line 327 of file regfile.hh.

References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::X86ISA::val, gem5::VecPredRegClass, and vecPredRegFile.

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

◆ setVecReg()

void gem5::o3::PhysRegFile::setVecReg ( PhysRegIdPtr  phys_reg,
const TheISA::VecRegContainer &  val 
)
inline

Sets a vector register to the given value.

Definition at line 302 of file regfile.hh.

References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::X86ISA::val, gem5::VecRegClass, and vectorRegFile.

Referenced by gem5::o3::CPU::setVecReg(), and gem5::o3::UnifiedRenameMap::switchMode().

◆ totalNumPhysRegs()

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

Definition at line 176 of file regfile.hh.

References totalNumRegs.

Member Data Documentation

◆ ccRegFile

std::vector<RegVal> gem5::o3::PhysRegFile::ccRegFile
private

Condition-code register file.

Definition at line 95 of file regfile.hh.

Referenced by readCCReg(), and setCCReg().

◆ ccRegIds

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

Definition at line 96 of file regfile.hh.

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

◆ floatRegFile

std::vector<RegVal> gem5::o3::PhysRegFile::floatRegFile
private

Floating point register file.

Definition at line 82 of file regfile.hh.

Referenced by readFloatReg(), and setFloatReg().

◆ floatRegIds

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

Definition at line 83 of file regfile.hh.

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

◆ intRegFile

std::vector<RegVal> gem5::o3::PhysRegFile::intRegFile
private

Integer register file.

Definition at line 77 of file regfile.hh.

Referenced by readIntReg(), and setIntReg().

◆ intRegIds

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

Definition at line 78 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(), numCCPhysRegs(), 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(), numFloatPhysRegs(), 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(), numIntPhysRegs(), 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 numVecElemPhysRegs().

◆ numPhysicalVecPredRegs

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

Number of physical predicate registers.

Definition at line 124 of file regfile.hh.

Referenced by initFreeList(), numPredPhysRegs(), 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(), numVecPhysRegs(), 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 getRegElemIds(), getRegIds(), getTrueId(), initFreeList(), and PhysRegFile().

◆ vecMode

VecMode gem5::o3::PhysRegFile::vecMode
private

Mode in which vector registers are addressed.

Definition at line 135 of file regfile.hh.

Referenced by initFreeList().

◆ vecPredRegFile

std::vector<TheISA::VecPredRegContainer> gem5::o3::PhysRegFile::vecPredRegFile
private

Predicate register file.

Definition at line 91 of file regfile.hh.

Referenced by readVecPredReg(), and setVecPredReg().

◆ 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 87 of file regfile.hh.

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

◆ vectorRegFile

std::vector<TheISA::VecRegContainer> gem5::o3::PhysRegFile::vectorRegFile
private

Vector register file.

Definition at line 86 of file regfile.hh.

Referenced by PhysRegFile(), readVecElem(), readVecReg(), setVecElem(), and setVecReg().

◆ zeroReg

RegId gem5::o3::PhysRegFile::zeroReg
private

Definition at line 79 of file regfile.hh.

Referenced by PhysRegFile(), and setIntReg().


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

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