gem5
v21.2.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) | |
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... | |
RegVal | 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, RegVal 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 | 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 | |
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< RegVal > | vectorElemRegFile |
Vector element register file. More... | |
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... | |
Simple physical register file class.
Definition at line 65 of file regfile.hh.
using gem5::o3::PhysRegFile::IdRange = std::pair<PhysIds::iterator, PhysIds::iterator> |
Definition at line 72 of file regfile.hh.
|
private |
Definition at line 69 of file regfile.hh.
gem5::o3::PhysRegFile::PhysRegFile | ( | unsigned | _numPhysicalIntRegs, |
unsigned | _numPhysicalFloatRegs, | ||
unsigned | _numPhysicalVecRegs, | ||
unsigned | _numPhysicalVecPredRegs, | ||
unsigned | _numPhysicalCCRegs, | ||
const BaseISA::RegClasses & | regClasses | ||
) |
Constructs a physical register file with the specified amount of integer and floating point registers.
Definition at line 52 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 150 of file regfile.hh.
|
inline |
Gets a misc register PhysRegIdPtr.
Definition at line 175 of file regfile.hh.
References miscRegIds.
Referenced by gem5::o3::UnifiedRenameMap::lookup().
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 181 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.
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 gem5::ArmISA::NumVecElemPerVecReg, panic_if, gem5::X86ISA::reg, gem5::VecElemClass, vecElemIds, gem5::VecRegClass, and vecRegIds.
|
inline |
Definition at line 253 of file regfile.hh.
References readVecPredReg().
Referenced by gem5::o3::CPU::getWritableArchVecPredReg(), and gem5::o3::CPU::getWritableVecPredReg().
|
inline |
Reads a vector register for modification.
Definition at line 218 of file regfile.hh.
References readVecReg().
Referenced by gem5::o3::CPU::getWritableArchVecReg(), and gem5::o3::CPU::getWritableVecReg().
void gem5::o3::PhysRegFile::initFreeList | ( | UnifiedFreeList * | freeList | ) |
Initialize the free list.
Definition at line 132 of file regfile.cc.
References gem5::o3::UnifiedFreeList::addRegs(), ccRegIds, floatRegIds, gem5::MipsISA::index, intRegIds, numPhysicalCCRegs, numPhysicalFloatRegs, numPhysicalIntRegs, numPhysicalVecPredRegs, numPhysicalVecRegs, gem5::ArmISA::NumVecElemPerVecReg, vecElemIds, vecPredRegIds, and vecRegIds.
Referenced by gem5::o3::UnifiedFreeList::UnifiedFreeList().
|
inline |
Definition at line 169 of file regfile.hh.
References numPhysicalCCRegs.
|
inline |
Definition at line 159 of file regfile.hh.
References numPhysicalFloatRegs.
|
inline |
Definition at line 156 of file regfile.hh.
References numPhysicalIntRegs.
|
inline |
Definition at line 163 of file regfile.hh.
References numPhysicalVecPredRegs.
|
inline |
Definition at line 166 of file regfile.hh.
References numPhysicalVecElemRegs.
|
inline |
Definition at line 161 of file regfile.hh.
References numPhysicalVecRegs.
|
inline |
Reads a condition-code register.
Definition at line 262 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 191 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 181 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 226 of file regfile.hh.
References DPRINTF, gem5::PhysRegId::elemIndex(), gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::ArmISA::NumVecElemPerVecReg, gem5::X86ISA::val, gem5::VecElemClass, and vectorElemRegFile.
Referenced by gem5::o3::CPU::readArchVecElem(), and gem5::o3::CPU::readVecElem().
|
inline |
Reads a predicate register.
Definition at line 241 of file regfile.hh.
References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::VecPredRegClass, and vecPredRegFile.
Referenced by getWritableVecPredReg(), gem5::o3::CPU::readArchVecPredReg(), and gem5::o3::CPU::readVecPredReg().
|
inline |
Reads a vector register.
Definition at line 205 of file regfile.hh.
References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::VecRegClass, and vectorRegFile.
Referenced by getWritableVecReg(), gem5::o3::CPU::readArchVecReg(), and gem5::o3::CPU::readVecReg().
|
inline |
Sets a condition-code register to the given value.
Definition at line 337 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 287 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 275 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 311 of file regfile.hh.
References DPRINTF, gem5::PhysRegId::elemIndex(), gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::ArmISA::NumVecElemPerVecReg, gem5::X86ISA::val, gem5::VecElemClass, and vectorElemRegFile.
Referenced by gem5::o3::CPU::setArchVecElem(), and gem5::o3::CPU::setVecElem().
|
inline |
Sets a predicate register to the given value.
Definition at line 324 of file regfile.hh.
References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::X86ISA::val, gem5::VecPredRegClass, and vecPredRegFile.
Referenced by gem5::o3::CPU::setArchVecPredReg(), and gem5::o3::CPU::setVecPredReg().
|
inline |
Sets a vector register to the given value.
Definition at line 299 of file regfile.hh.
References DPRINTF, gem5::PhysRegId::index(), gem5::PhysRegId::is(), gem5::X86ISA::val, gem5::VecRegClass, and vectorRegFile.
Referenced by gem5::o3::CPU::setArchVecReg(), and gem5::o3::CPU::setVecReg().
|
inline |
Definition at line 172 of file regfile.hh.
References totalNumRegs.
|
private |
Condition-code register file.
Definition at line 96 of file regfile.hh.
Referenced by readCCReg(), and setCCReg().
|
private |
Definition at line 97 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Floating point register file.
Definition at line 80 of file regfile.hh.
Referenced by readFloatReg(), and setFloatReg().
|
private |
Definition at line 81 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Integer register file.
Definition at line 75 of file regfile.hh.
Referenced by readIntReg(), and setIntReg().
|
private |
Definition at line 76 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Misc Reg Ids.
Definition at line 100 of file regfile.hh.
Referenced by getMiscRegId(), getRegIds(), and PhysRegFile().
|
private |
Number of physical CC registers.
Definition at line 130 of file regfile.hh.
Referenced by initFreeList(), numCCPhysRegs(), and PhysRegFile().
|
private |
Number of physical floating point registers.
Definition at line 110 of file regfile.hh.
Referenced by initFreeList(), numFloatPhysRegs(), and PhysRegFile().
|
private |
Number of physical general purpose registers.
Definition at line 105 of file regfile.hh.
Referenced by initFreeList(), numIntPhysRegs(), and PhysRegFile().
|
private |
Number of physical vector element registers.
Definition at line 120 of file regfile.hh.
Referenced by numVecElemPhysRegs().
|
private |
Number of physical predicate registers.
Definition at line 125 of file regfile.hh.
Referenced by initFreeList(), numPredPhysRegs(), and PhysRegFile().
|
private |
Number of physical vector registers.
Definition at line 115 of file regfile.hh.
Referenced by initFreeList(), numVecPhysRegs(), and PhysRegFile().
|
private |
Total number of physical registers.
Definition at line 133 of file regfile.hh.
Referenced by totalNumPhysRegs().
|
private |
Definition at line 89 of file regfile.hh.
Referenced by getRegIds(), getTrueId(), initFreeList(), and PhysRegFile().
|
private |
Predicate register file.
Definition at line 92 of file regfile.hh.
Referenced by readVecPredReg(), and setVecPredReg().
|
private |
Definition at line 93 of file regfile.hh.
Referenced by getRegIds(), initFreeList(), and PhysRegFile().
|
private |
Definition at line 85 of file regfile.hh.
Referenced by getRegIds(), getTrueId(), initFreeList(), and PhysRegFile().
|
private |
Vector element register file.
Definition at line 88 of file regfile.hh.
Referenced by readVecElem(), and setVecElem().
|
private |
Vector register file.
Definition at line 84 of file regfile.hh.
Referenced by PhysRegFile(), readVecReg(), and setVecReg().
|
private |
Definition at line 77 of file regfile.hh.
Referenced by PhysRegFile(), and setIntReg().