gem5
v21.1.0.0
|
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, 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< RegVal > | intRegFile |
Integer register file. More... | |
std::vector< PhysRegId > | intRegIds |
RegId | zeroReg |
std::vector< RegVal > | floatRegFile |
Floating point register file. More... | |
std::vector< PhysRegId > | floatRegIds |
std::vector< TheISA::VecRegContainer > | vectorRegFile |
Vector register file. More... | |
std::vector< PhysRegId > | vecRegIds |
std::vector< PhysRegId > | vecElemIds |
std::vector< TheISA::VecPredRegContainer > | vecPredRegFile |
Predicate register file. More... | |
std::vector< PhysRegId > | vecPredRegIds |
std::vector< RegVal > | ccRegFile |
Condition-code register file. More... | |
std::vector< PhysRegId > | ccRegIds |
std::vector< PhysRegId > | miscRegIds |
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... | |
Simple physical register file class.
Definition at line 66 of file regfile.hh.
using gem5::o3::PhysRegFile::IdRange = std::pair<PhysIds::iterator, PhysIds::iterator> |
Definition at line 74 of file regfile.hh.
|
private |
Definition at line 70 of file regfile.hh.
|
private |
Definition at line 71 of file regfile.hh.
gem5::o3::PhysRegFile::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.
Definition at line 54 of file regfile.cc.
References gem5::CCRegClass, ccRegIds, gem5::FloatRegClass, floatRegIds, gem5::IntRegClass, intRegIds, gem5::MiscRegClass, miscRegIds, numPhysicalCCRegs, numPhysicalFloatRegs, numPhysicalIntRegs, numPhysicalVecPredRegs, numPhysicalVecRegs, gem5::ArmISA::NumVecElemPerVecReg, gem5::VecElemClass, vecElemIds, gem5::VecPredRegClass, vecPredRegIds, gem5::VecRegClass, vecRegIds, vectorRegFile, and zeroReg.
|
inline |
Destructor to free resources.
Definition at line 154 of file regfile.hh.
|
inline |
Gets a misc register PhysRegIdPtr.
Definition at line 179 of file regfile.hh.
References miscRegIds.
Referenced by gem5::o3::UnifiedRenameMap::lookup().
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().
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().
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().
|
inline |
Definition at line 256 of file regfile.hh.
References readVecPredReg().
Referenced by gem5::o3::CPU::getWritableVecPredReg().
|
inline |
Reads a vector register for modification.
Definition at line 222 of file regfile.hh.
References readVecReg().
Referenced by gem5::o3::CPU::getWritableVecReg().
void gem5::o3::PhysRegFile::initFreeList | ( | UnifiedFreeList * | freeList | ) |
Initialize the free list.
Definition at line 135 of file regfile.cc.
References gem5::o3::UnifiedFreeList::addRegs(), ccRegIds, floatRegIds, gem5::MipsISA::index, intRegIds, numPhysicalCCRegs, numPhysicalFloatRegs, numPhysicalIntRegs, numPhysicalVecPredRegs, numPhysicalVecRegs, gem5::ArmISA::NumVecElemPerVecReg, vecElemIds, vecMode, vecPredRegIds, and vecRegIds.
Referenced by gem5::o3::UnifiedFreeList::UnifiedFreeList().
|
inline |
Definition at line 173 of file regfile.hh.
References numPhysicalCCRegs.
|
inline |
Definition at line 163 of file regfile.hh.
References numPhysicalFloatRegs.
|
inline |
Definition at line 160 of file regfile.hh.
References numPhysicalIntRegs.
|
inline |
Definition at line 167 of file regfile.hh.
References numPhysicalVecPredRegs.
|
inline |
Definition at line 170 of file regfile.hh.
References numPhysicalVecElemRegs.
Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().
|
inline |
Definition at line 165 of file regfile.hh.
References numPhysicalVecRegs.
Referenced by gem5::o3::UnifiedRenameMap::switchFreeList().
|
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().
|
inline |
Definition at line 195 of file regfile.hh.
References DPRINTF, gem5::FloatRegClass, floatRegFile, gem5::PhysRegId::index(), and gem5::PhysRegId::is().
Referenced by gem5::o3::CPU::readArchFloatReg(), and gem5::o3::CPU::readFloatReg().
|
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().
|
inline |
Reads a vector element.
Definition at line 230 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::readVecElem(), and gem5::o3::UnifiedRenameMap::switchMode().
|
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().
|
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().
|
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().
|
inline |
Definition at line 290 of file regfile.hh.
References DPRINTF, gem5::FloatRegClass, floatRegFile, gem5::PhysRegId::index(), gem5::PhysRegId::is(), and gem5::X86ISA::val.
Referenced by gem5::o3::CPU::setArchFloatReg(), and gem5::o3::CPU::setFloatReg().
|
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().
|
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().
|
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().
|
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().
|
inline |
Definition at line 176 of file regfile.hh.
References totalNumRegs.
|
private |
Condition-code register file.
Definition at line 95 of file regfile.hh.
Referenced by readCCReg(), and setCCReg().
|
private |
Definition at line 96 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Floating point register file.
Definition at line 82 of file regfile.hh.
Referenced by readFloatReg(), and setFloatReg().
|
private |
Definition at line 83 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Integer register file.
Definition at line 77 of file regfile.hh.
Referenced by readIntReg(), and setIntReg().
|
private |
Definition at line 78 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Misc Reg Ids.
Definition at line 99 of file regfile.hh.
Referenced by getMiscRegId(), getRegIds(), and PhysRegFile().
|
private |
Number of physical CC registers.
Definition at line 129 of file regfile.hh.
Referenced by initFreeList(), numCCPhysRegs(), and PhysRegFile().
|
private |
Number of physical floating point registers.
Definition at line 109 of file regfile.hh.
Referenced by initFreeList(), numFloatPhysRegs(), and PhysRegFile().
|
private |
Number of physical general purpose registers.
Definition at line 104 of file regfile.hh.
Referenced by initFreeList(), numIntPhysRegs(), and PhysRegFile().
|
private |
Number of physical vector element registers.
Definition at line 119 of file regfile.hh.
Referenced by numVecElemPhysRegs().
|
private |
Number of physical predicate registers.
Definition at line 124 of file regfile.hh.
Referenced by initFreeList(), numPredPhysRegs(), and PhysRegFile().
|
private |
Number of physical vector registers.
Definition at line 114 of file regfile.hh.
Referenced by initFreeList(), numVecPhysRegs(), and PhysRegFile().
|
private |
Total number of physical registers.
Definition at line 132 of file regfile.hh.
Referenced by totalNumPhysRegs().
|
private |
Definition at line 88 of file regfile.hh.
Referenced by getRegElemIds(), getRegIds(), getTrueId(), initFreeList(), and PhysRegFile().
|
private |
Mode in which vector registers are addressed.
Definition at line 135 of file regfile.hh.
Referenced by initFreeList().
|
private |
Predicate register file.
Definition at line 91 of file regfile.hh.
Referenced by readVecPredReg(), and setVecPredReg().
|
private |
Definition at line 92 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Definition at line 87 of file regfile.hh.
Referenced by getRegIds(), getTrueId(), initFreeList(), and PhysRegFile().
|
private |
Vector register file.
Definition at line 86 of file regfile.hh.
Referenced by PhysRegFile(), readVecElem(), readVecReg(), setVecElem(), and setVecReg().
|
private |
Definition at line 79 of file regfile.hh.
Referenced by PhysRegFile(), and setIntReg().