gem5
|
Simple physical register file class. More...
#include <regfile.hh>
Classes | |
union | PhysFloatReg |
Public Member Functions | |
PhysRegFile (unsigned _numPhysicalIntRegs, unsigned _numPhysicalFloatRegs, unsigned _numPhysicalCCRegs) | |
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 | numCCPhysRegs () const |
unsigned | totalNumPhysRegs () const |
bool | isIntPhysReg (PhysRegIndex reg_idx) const |
bool | isFloatPhysReg (PhysRegIndex reg_idx) const |
bool | isCCPhysReg (PhysRegIndex reg_idx) |
Return true if the specified physical register index corresponds to a condition-code physical register. More... | |
uint64_t | readIntReg (PhysRegIndex reg_idx) const |
Reads an integer register. More... | |
FloatReg | readFloatReg (PhysRegIndex reg_idx) const |
Reads a floating point register (double precision). More... | |
FloatRegBits | readFloatRegBits (PhysRegIndex reg_idx) const |
CCReg | readCCReg (PhysRegIndex reg_idx) |
Reads a condition-code register. More... | |
void | setIntReg (PhysRegIndex reg_idx, uint64_t val) |
Sets an integer register to the given value. More... | |
void | setFloatReg (PhysRegIndex reg_idx, FloatReg val) |
Sets a double precision floating point register to the given value. More... | |
void | setFloatRegBits (PhysRegIndex reg_idx, FloatRegBits val) |
void | setCCReg (PhysRegIndex reg_idx, CCReg val) |
Sets a condition-code register to the given value. More... | |
Private Types | |
typedef TheISA::IntReg | IntReg |
typedef TheISA::FloatReg | FloatReg |
typedef TheISA::FloatRegBits | FloatRegBits |
typedef TheISA::CCReg | CCReg |
Private Attributes | |
std::vector< IntReg > | intRegFile |
Integer register file. More... | |
std::vector< PhysFloatReg > | floatRegFile |
Floating point register file. More... | |
std::vector< CCReg > | ccRegFile |
Condition-code register file. More... | |
unsigned | baseFloatRegIndex |
The first floating-point physical register index. More... | |
unsigned | baseCCRegIndex |
The first condition-code physical register index. More... | |
unsigned | totalNumRegs |
Total number of physical registers. More... | |
Simple physical register file class.
Definition at line 51 of file regfile.hh.
|
private |
Definition at line 58 of file regfile.hh.
|
private |
Definition at line 56 of file regfile.hh.
|
private |
Definition at line 57 of file regfile.hh.
|
private |
Definition at line 55 of file regfile.hh.
PhysRegFile::PhysRegFile | ( | unsigned | _numPhysicalIntRegs, |
unsigned | _numPhysicalFloatRegs, | ||
unsigned | _numPhysicalCCRegs | ||
) |
Constructs a physical register file with the specified amount of integer and floating point registers.
Definition at line 38 of file regfile.cc.
References AlphaISA::NumCCRegs, and warn.
|
inline |
Destructor to free resources.
Definition at line 111 of file regfile.hh.
void PhysRegFile::initFreeList | ( | UnifiedFreeList * | freeList | ) |
Initialize the free list.
Definition at line 60 of file regfile.cc.
References UnifiedFreeList::addCCReg(), UnifiedFreeList::addFloatReg(), UnifiedFreeList::addIntReg(), baseCCRegIndex, baseFloatRegIndex, and totalNumRegs.
Referenced by UnifiedFreeList::UnifiedFreeList().
|
inline |
Return true if the specified physical register index corresponds to a condition-code physical register.
Definition at line 152 of file regfile.hh.
References baseCCRegIndex, and totalNumRegs.
Referenced by UnifiedFreeList::addReg(), UnifiedRenameMap::lookupCC(), readCCReg(), UnifiedRenameMap::renameCC(), UnifiedRenameMap::setCCEntry(), and setCCReg().
|
inline |
Definition at line 143 of file regfile.hh.
References baseCCRegIndex, and baseFloatRegIndex.
Referenced by UnifiedFreeList::addReg(), UnifiedRenameMap::lookupFloat(), readFloatReg(), readFloatRegBits(), UnifiedRenameMap::renameFloat(), UnifiedRenameMap::setFloatEntry(), setFloatReg(), and setFloatRegBits().
|
inline |
Definition at line 134 of file regfile.hh.
References baseFloatRegIndex.
Referenced by UnifiedFreeList::addReg(), UnifiedRenameMap::lookupInt(), readIntReg(), UnifiedRenameMap::renameInt(), UnifiedRenameMap::setIntEntry(), and setIntReg().
|
inline |
Definition at line 124 of file regfile.hh.
References baseCCRegIndex, and totalNumRegs.
|
inline |
Definition at line 120 of file regfile.hh.
References baseCCRegIndex, and baseFloatRegIndex.
|
inline |
Definition at line 117 of file regfile.hh.
References baseFloatRegIndex.
|
inline |
Reads a condition-code register.
Definition at line 197 of file regfile.hh.
References baseCCRegIndex, ccRegFile, DPRINTF, and isCCPhysReg().
|
inline |
Reads a floating point register (double precision).
Definition at line 168 of file regfile.hh.
References baseFloatRegIndex, DPRINTF, floatRegFile, isFloatPhysReg(), and ArmISA::q.
|
inline |
Definition at line 181 of file regfile.hh.
References baseFloatRegIndex, DPRINTF, floatRegFile, and isFloatPhysReg().
|
inline |
Reads an integer register.
Definition at line 158 of file regfile.hh.
References DPRINTF, intRegFile, and isIntPhysReg().
|
inline |
Sets a condition-code register to the given value.
Definition at line 253 of file regfile.hh.
References baseCCRegIndex, ccRegFile, DPRINTF, isCCPhysReg(), and X86ISA::val.
|
inline |
Sets a double precision floating point register to the given value.
Definition at line 223 of file regfile.hh.
References baseFloatRegIndex, DPRINTF, floatRegFile, isFloatPhysReg(), X86ISA::val, and AlphaISA::ZeroReg.
|
inline |
Definition at line 239 of file regfile.hh.
References baseFloatRegIndex, DPRINTF, floatRegFile, isFloatPhysReg(), and X86ISA::val.
|
inline |
Sets an integer register to the given value.
Definition at line 211 of file regfile.hh.
References DPRINTF, intRegFile, isIntPhysReg(), X86ISA::val, and AlphaISA::ZeroReg.
|
inline |
Definition at line 128 of file regfile.hh.
References totalNumRegs.
Referenced by UnifiedRenameMap::lookupMisc().
|
private |
The first condition-code physical register index.
The condition-code registers follow the floating-point registers.
Definition at line 94 of file regfile.hh.
Referenced by initFreeList(), isCCPhysReg(), isFloatPhysReg(), numCCPhysRegs(), numFloatPhysRegs(), readCCReg(), and setCCReg().
|
private |
The first floating-point physical register index.
The physical register file has a single continuous index space, with the initial indices mapping to the integer registers, followed immediately by the floating-point registers. Thus the first floating-point index is equal to the number of integer registers.
Note that this internal organizational detail on how physical register file indices are ordered should NOT be exposed outside of this class. Other classes can use the is*PhysReg() methods to map from a physical register index to a class without knowing the internal structure of the index map.
Definition at line 88 of file regfile.hh.
Referenced by initFreeList(), isFloatPhysReg(), isIntPhysReg(), numFloatPhysRegs(), numIntPhysRegs(), readFloatReg(), readFloatRegBits(), setFloatReg(), and setFloatRegBits().
|
private |
Condition-code register file.
Definition at line 72 of file regfile.hh.
Referenced by readCCReg(), and setCCReg().
|
private |
Floating point register file.
Definition at line 69 of file regfile.hh.
Referenced by readFloatReg(), readFloatRegBits(), setFloatReg(), and setFloatRegBits().
|
private |
Integer register file.
Definition at line 66 of file regfile.hh.
Referenced by readIntReg(), and setIntReg().
|
private |
Total number of physical registers.
Definition at line 97 of file regfile.hh.
Referenced by initFreeList(), isCCPhysReg(), numCCPhysRegs(), and totalNumPhysRegs().