45 #ifndef __CPU_O3_RENAME_MAP_HH__ 46 #define __CPU_O3_RENAME_MAP_HH__ 52 #include "arch/types.hh" 53 #include "config/the_isa.hh" 57 #include "enums/VecRegRenameMode.hh" 129 assert(arch_reg.
flatIndex() <= map.size());
141 assert(arch_reg.
flatIndex() <= map.size());
233 return intMap.
rename(arch_reg);
235 return floatMap.
rename(arch_reg);
237 assert(vecMode == Enums::Full);
238 return vecMap.
rename(arch_reg);
240 assert(vecMode == Enums::Elem);
241 return vecElemMap.
rename(arch_reg);
243 return predMap.
rename(arch_reg);
245 return ccMap.
rename(arch_reg);
256 panic(
"rename rename(): unknown reg class %s\n",
272 return intMap.
lookup(arch_reg);
275 return floatMap.
lookup(arch_reg);
278 assert(vecMode == Enums::Full);
279 return vecMap.
lookup(arch_reg);
282 assert(vecMode == Enums::Elem);
283 return vecElemMap.
lookup(arch_reg);
286 return predMap.
lookup(arch_reg);
289 return ccMap.
lookup(arch_reg);
297 panic(
"rename lookup(): unknown reg class %s\n",
315 return intMap.
setEntry(arch_reg, phys_reg);
319 return floatMap.
setEntry(arch_reg, phys_reg);
323 assert(vecMode == Enums::Full);
324 return vecMap.
setEntry(arch_reg, phys_reg);
328 assert(vecMode == Enums::Elem);
329 return vecElemMap.
setEntry(arch_reg, phys_reg);
333 return predMap.
setEntry(arch_reg, phys_reg);
337 return ccMap.
setEntry(arch_reg, phys_reg);
344 assert(phys_reg ==
lookup(arch_reg));
348 panic(
"rename setEntry(): unknown reg class %s\n",
361 return std::min(std::min(
372 return vecMode == Enums::Full
382 bool canRename(uint32_t intRegs, uint32_t floatRegs, uint32_t vectorRegs,
383 uint32_t vecElemRegs, uint32_t vecPredRegs,
384 uint32_t ccRegs)
const 399 void switchMode(
VecMode newVecMode);
409 #endif //__CPU_O3_RENAME_MAP_HH__ #define panic(...)
This implements a cprintf based panic() function.
Arch2PhysMap::const_iterator const_iterator
unsigned numFreeEntries() const
Return the minimum number of free entries across all of the register classes.
unsigned numFreeFloatEntries() const
Arch2PhysMap map
The acutal arch-to-phys register map.
iterator end()
Forward end/cend to the map.
bool isCCPhysReg() const
true if it is a condition-code physical register.
iterator begin()
Forward begin/cbegin to the map.
bool canRename(uint32_t intRegs, uint32_t floatRegs, uint32_t vectorRegs, uint32_t vecElemRegs, uint32_t vecPredRegs, uint32_t ccRegs) const
Return whether there are enough registers to serve the request.
Simple physical register file class.
bool isVectorPhysReg() const
true if it is a vector physical register.
unsigned numFreeCCEntries() const
unsigned numFreePredEntries() const
SimpleRenameMap ccMap
The condition-code register rename map.
SimpleRenameMap predMap
The predicate register rename map.
Enums::VecRegRenameMode VecMode
::DummyVecPredReg VecPredReg
TheISA::VecPredReg VecPredReg
RegId zeroReg
The architectural index of the zero register.
SimpleRenameMap floatMap
The floating-point register rename map.
const_iterator cend() const
Free list for a single class of registers (e.g., integer or floating point).
bool isVecPredPhysReg() const
PhysRegIdPtr getMiscRegId(RegIndex reg_idx)
Gets a misc register PhysRegIdPtr.
unsigned numFreeVecEntries() const
Vector Register Native Elem lane.
unsigned numFreeIntEntries() const
Arch2PhysMap::iterator iterator
UnifiedRenameMap()
Default constructor.
SimpleRenameMap intMap
The integer register rename map.
Unified register rename map for all classes of registers.
PhysRegFile * regFile
The register file object is used only to get PhysRegIdPtr on MiscRegs, as they are stored in it...
void setEntry(const RegId &arch_reg, PhysRegIdPtr phys_reg)
Update rename map with a specific mapping.
SimpleFreeList * freeList
Pointer to the free list from which new physical registers should be allocated in rename() ...
void init(unsigned size, SimpleFreeList *_freeList, RegIndex _zeroReg)
Because we have an array of rename maps (one per thread) in the CPU, it's awkward to initialize this ...
void setEntry(const RegId &arch_reg, PhysRegIdPtr phys_reg)
Update rename map with a specific mapping.
RenameInfo rename(const RegId &arch_reg)
Tell rename map to get a new free physical register to remap the specified architectural register...
unsigned numFreeRegs() const
Return the number of free registers on the list.
const_iterator end() const
bool isFloatPhysReg() const
FreeList class that simply holds the list of free integer and floating point registers.
~UnifiedRenameMap()
Destructor.
bool isIntPhysReg() const
std::pair< PhysRegIdPtr, PhysRegIdPtr > RenameInfo
Pair of a physical register and a physical register.
const RegClass & classValue() const
Class accessor.
unsigned numFreeEntries() const
Return the number of free entries on the associated free list.
SimpleRenameMap vecMap
The vector register rename map.
RegIndex flatIndex() const
Index flattening.
RenameInfo rename(const RegId &arch_reg)
Tell rename map to get a new free physical register to remap the specified architectural register...
Register ID: describe an architectural register with its class and index.
const_iterator begin() const
SimpleRenameMap::RenameInfo RenameInfo
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
constexpr unsigned NumVecElemPerVecReg
bool isVectorPhysElem() const
true if it is a vector element physical register.
const_iterator cbegin() const
const char * className() const
Return a const char* with the register class name.
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
Register rename map for a single class of registers (e.g., integer or floating point).
SimpleRenameMap vecElemMap
The vector element register rename map.