gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Types | Private Attributes | List of all members
PhysRegFile Class Reference

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< IntRegintRegFile
 Integer register file. More...
 
std::vector< PhysFloatRegfloatRegFile
 Floating point register file. More...
 
std::vector< CCRegccRegFile
 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...
 

Detailed Description

Simple physical register file class.

Definition at line 51 of file regfile.hh.

Member Typedef Documentation

typedef TheISA::CCReg PhysRegFile::CCReg
private

Definition at line 58 of file regfile.hh.

typedef TheISA::FloatReg PhysRegFile::FloatReg
private

Definition at line 56 of file regfile.hh.

typedef TheISA::FloatRegBits PhysRegFile::FloatRegBits
private

Definition at line 57 of file regfile.hh.

typedef TheISA::IntReg PhysRegFile::IntReg
private

Definition at line 55 of file regfile.hh.

Constructor & Destructor Documentation

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.

PhysRegFile::~PhysRegFile ( )
inline

Destructor to free resources.

Definition at line 111 of file regfile.hh.

Member Function Documentation

void PhysRegFile::initFreeList ( UnifiedFreeList freeList)
bool PhysRegFile::isCCPhysReg ( PhysRegIndex  reg_idx)
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().

bool PhysRegFile::isFloatPhysReg ( PhysRegIndex  reg_idx) const
inline
Returns
true if the specified physical register index corresponds to a floating-point physical register.

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().

bool PhysRegFile::isIntPhysReg ( PhysRegIndex  reg_idx) const
inline
Returns
true if the specified physical register index corresponds to an integer physical register.

Definition at line 134 of file regfile.hh.

References baseFloatRegIndex.

Referenced by UnifiedFreeList::addReg(), UnifiedRenameMap::lookupInt(), readIntReg(), UnifiedRenameMap::renameInt(), UnifiedRenameMap::setIntEntry(), and setIntReg().

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

Definition at line 124 of file regfile.hh.

References baseCCRegIndex, and totalNumRegs.

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

Definition at line 120 of file regfile.hh.

References baseCCRegIndex, and baseFloatRegIndex.

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

Definition at line 117 of file regfile.hh.

References baseFloatRegIndex.

CCReg PhysRegFile::readCCReg ( PhysRegIndex  reg_idx)
inline

Reads a condition-code register.

Definition at line 197 of file regfile.hh.

References baseCCRegIndex, ccRegFile, DPRINTF, and isCCPhysReg().

FloatReg PhysRegFile::readFloatReg ( PhysRegIndex  reg_idx) const
inline

Reads a floating point register (double precision).

Definition at line 168 of file regfile.hh.

References baseFloatRegIndex, DPRINTF, floatRegFile, isFloatPhysReg(), and ArmISA::q.

FloatRegBits PhysRegFile::readFloatRegBits ( PhysRegIndex  reg_idx) const
inline

Definition at line 181 of file regfile.hh.

References baseFloatRegIndex, DPRINTF, floatRegFile, and isFloatPhysReg().

uint64_t PhysRegFile::readIntReg ( PhysRegIndex  reg_idx) const
inline

Reads an integer register.

Definition at line 158 of file regfile.hh.

References DPRINTF, intRegFile, and isIntPhysReg().

void PhysRegFile::setCCReg ( PhysRegIndex  reg_idx,
CCReg  val 
)
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.

void PhysRegFile::setFloatReg ( PhysRegIndex  reg_idx,
FloatReg  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.

void PhysRegFile::setFloatRegBits ( PhysRegIndex  reg_idx,
FloatRegBits  val 
)
inline

Definition at line 239 of file regfile.hh.

References baseFloatRegIndex, DPRINTF, floatRegFile, isFloatPhysReg(), and X86ISA::val.

void PhysRegFile::setIntReg ( PhysRegIndex  reg_idx,
uint64_t  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.

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

Definition at line 128 of file regfile.hh.

References totalNumRegs.

Referenced by UnifiedRenameMap::lookupMisc().

Member Data Documentation

unsigned PhysRegFile::baseCCRegIndex
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().

unsigned PhysRegFile::baseFloatRegIndex
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().

std::vector<CCReg> PhysRegFile::ccRegFile
private

Condition-code register file.

Definition at line 72 of file regfile.hh.

Referenced by readCCReg(), and setCCReg().

std::vector<PhysFloatReg> PhysRegFile::floatRegFile
private

Floating point register file.

Definition at line 69 of file regfile.hh.

Referenced by readFloatReg(), readFloatRegBits(), setFloatReg(), and setFloatRegBits().

std::vector<IntReg> PhysRegFile::intRegFile
private

Integer register file.

Definition at line 66 of file regfile.hh.

Referenced by readIntReg(), and setIntReg().

unsigned PhysRegFile::totalNumRegs
private

Total number of physical registers.

Definition at line 97 of file regfile.hh.

Referenced by initFreeList(), isCCPhysReg(), numCCPhysRegs(), and totalNumPhysRegs().


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

Generated on Fri Jun 9 2017 13:04:16 for gem5 by doxygen 1.8.6