45 #ifndef __CPU_O3_REGFILE_HH__ 46 #define __CPU_O3_REGFILE_HH__ 50 #include "arch/isa_traits.hh" 51 #include "arch/types.hh" 53 #include "config/the_isa.hh" 55 #include "debug/IEW.hh" 56 #include "enums/VecRegRenameMode.hh" 144 unsigned _numPhysicalFloatRegs,
145 unsigned _numPhysicalVecRegs,
146 unsigned _numPhysicalVecPredRegs,
147 unsigned _numPhysicalCCRegs,
180 return &miscRegIds[reg_idx];
189 DPRINTF(IEW,
"RegFile: Access to int register %i, has data " 190 "%#x\n", phys_reg->
index(), intRegFile[phys_reg->
index()]);
191 return intRegFile[phys_reg->
index()];
199 RegVal floatRegBits = floatRegFile[phys_reg->
index()];
201 DPRINTF(IEW,
"RegFile: Access to float register %i as int, " 202 "has data %#x\n", phys_reg->
index(), floatRegBits);
213 DPRINTF(IEW,
"RegFile: Access to vector register %i, has " 214 "data %s\n",
int(phys_reg->
index()),
215 vectorRegFile[phys_reg->
index()].print());
217 return vectorRegFile[phys_reg->
index()];
229 template <
typename VecElem,
int LaneIdx>
237 template <
typename VecElem>
245 template <
typename LD>
251 DPRINTF(IEW,
"RegFile: Setting vector register %i[%d] to %lx\n",
254 vectorRegFile[phys_reg->
index()].laneView<
typename LD::UnderlyingType>(
263 auto ret = vectorRegFile[phys_reg->
index()].as<
VecElem>();
265 DPRINTF(IEW,
"RegFile: Access to element %d of vector register %i," 266 " has data %#x\n", phys_reg->
elemIndex(),
267 int(phys_reg->
index()), val);
277 DPRINTF(IEW,
"RegFile: Access to predicate register %i, has " 278 "data %s\n",
int(phys_reg->
index()),
279 vecPredRegFile[phys_reg->
index()].print());
281 return vecPredRegFile[phys_reg->
index()];
296 DPRINTF(IEW,
"RegFile: Access to cc register %i, has " 297 "data %#x\n", phys_reg->
index(),
298 ccRegFile[phys_reg->
index()]);
300 return ccRegFile[phys_reg->
index()];
309 DPRINTF(IEW,
"RegFile: Setting int register %i to %#x\n",
313 intRegFile[phys_reg->
index()] =
val;
321 DPRINTF(IEW,
"RegFile: Setting float register %i to %#x\n",
322 phys_reg->
index(), (uint64_t)val);
325 floatRegFile[phys_reg->
index()] =
val;
334 DPRINTF(IEW,
"RegFile: Setting vector register %i to %s\n",
337 vectorRegFile[phys_reg->
index()] =
val;
346 DPRINTF(IEW,
"RegFile: Setting element %d of vector register %i to" 358 DPRINTF(IEW,
"RegFile: Setting predicate register %i to %s\n",
361 vecPredRegFile[phys_reg->
index()] =
val;
370 DPRINTF(IEW,
"RegFile: Setting cc register %i to %#x\n",
371 phys_reg->
index(), (uint64_t)val);
397 #endif //__CPU_O3_REGFILE_HH__
std::vector< VecPredRegContainer > vecPredRegFile
Predicate register file.
void setVecLane(PhysRegIdPtr phys_reg, const LD &val)
Get a vector register lane for modification.
bool isCCPhysReg() const
true if it is a condition-code physical register.
VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr phys_reg)
Vector Register Abstraction This generic class is the model in a particularization of MVC...
Simple physical register file class.
bool isVectorPhysReg() const
true if it is a vector physical register.
std::vector< PhysRegId > floatRegIds
const VecElem & readVecElem(PhysRegIdPtr phys_reg) const
Reads a vector element.
std::vector< PhysRegId > vecPredRegIds
RegClass
Enumerate the classes of registers.
VecLaneT< VecElem, true > readVecLane(PhysRegIdPtr phys_reg) const
Reads a vector register lane.
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
Sets a condition-code register to the given value.
unsigned totalNumRegs
Total number of physical registers.
unsigned numIntPhysRegs() const
VecLaneT< VecElem, true > readVecLane(PhysRegIdPtr phys_reg) const
Reads a vector register lane.
std::vector< RegVal > ccRegFile
Condition-code register file.
std::vector< VecRegContainer > vectorRegFile
Vector register file.
RegVal readIntReg(PhysRegIdPtr phys_reg) const
Reads an integer register.
std::vector< PhysRegId > ccRegIds
unsigned numCCPhysRegs() const
const RegIndex & elemIndex() const
Elem accessor.
bool isVecPredPhysReg() const
std::vector< PhysRegId > intRegIds
PhysRegIdPtr getMiscRegId(RegIndex reg_idx)
Gets a misc register PhysRegIdPtr.
void initFreeList(UnifiedFreeList *freeList)
Initialize the free list.
VecRegContainer & getWritableVecReg(PhysRegIdPtr phys_reg)
Reads a vector register for modification.
PhysRegFile(unsigned _numPhysicalIntRegs, unsigned _numPhysicalFloatRegs, unsigned _numPhysicalVecRegs, unsigned _numPhysicalVecPredRegs, unsigned _numPhysicalCCRegs, VecMode vmode)
Constructs a physical register file with the specified amount of integer and floating point registers...
Enums::VecRegRenameMode VecMode
void setVecPredReg(PhysRegIdPtr phys_reg, const VecPredRegContainer &val)
Sets a predicate register to the given value.
::DummyVecPredRegContainer VecPredRegContainer
unsigned numPhysicalCCRegs
Number of physical CC registers.
VecMode vecMode
Mode in which vector registers are addressed.
IdRange getRegIds(RegClass cls)
Get the PhysRegIds of the elems of all vector registers.
unsigned numPhysicalVecElemRegs
Number of physical vector element registers.
::DummyVecRegContainer VecRegContainer
static constexpr auto NumVecElemPerVecReg
RegVal readCCReg(PhysRegIdPtr phys_reg)
Reads a condition-code register.
std::vector< PhysRegId > vecRegIds
~PhysRegFile()
Destructor to free resources.
void setVecElem(PhysRegIdPtr phys_reg, const VecElem val)
Sets a vector register to the given value.
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
void setVecReg(PhysRegIdPtr phys_reg, const VecRegContainer &val)
Sets a vector register to the given value.
unsigned numVecPhysRegs() const
unsigned numPhysicalVecPredRegs
Number of physical predicate registers.
unsigned numPredPhysRegs() const
PhysRegIdPtr getTrueId(PhysRegIdPtr reg)
Get the true physical register id.
bool isFloatPhysReg() const
unsigned numPhysicalVecRegs
Number of physical vector registers.
FreeList class that simply holds the list of free integer and floating point registers.
const VecPredRegContainer & readVecPredReg(PhysRegIdPtr phys_reg) const
Reads a predicate register.
unsigned numFloatPhysRegs() const
bool isIntPhysReg() const
const std::string print() const
Returns a string representation of the register content.
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
Sets an integer register to the given value.
std::vector< RegVal > intRegFile
Integer register file.
unsigned numPhysicalFloatRegs
Number of physical floating point registers.
Generic predicate register container.
const VecRegContainer & readVecReg(PhysRegIdPtr phys_reg) const
Reads a vector register.
const RegIndex & index() const
Index accessors.
unsigned totalNumPhysRegs() const
std::vector< PhysRegId > vecElemIds
std::vector< PhysRegId > miscRegIds
Misc Reg Ids.
VecLaneT< VecElem, false > laneView()
View as the Nth lane of type VecElem.
RegVal readFloatReg(PhysRegIdPtr phys_reg) const
unsigned numPhysicalIntRegs
Number of physical general purpose registers.
std::vector< RegVal > floatRegFile
Floating point register file.
unsigned numVecElemPhysRegs() const
IdRange getRegElemIds(PhysRegIdPtr reg)
Get the PhysRegIds of the elems of a vector register.
Vector Lane abstraction Another view of a container.
constexpr unsigned NumVecElemPerVecReg
bool isVectorPhysElem() const
true if it is a vector element physical register.
bool isZeroReg() const
Check if this is the zero register.
const std::string print() const