Go to the documentation of this file.
42 #ifndef __CPU_O3_FREE_LIST_HH__
43 #define __CPU_O3_FREE_LIST_HH__
53 #include "debug/FreeList.hh"
77 template<
class InputIt>
80 std::for_each(first, last, [
this](
typename InputIt::value_type&
reg) {
81 this->freeRegs.push(&
reg);
196 template<
class InputIt>
197 void addRegs(InputIt first, InputIt last);
256 template<
class InputIt>
265 first->classValue() != (last-1)->classValue(),
266 "Attempt to add mixed type regs: %s and %s",
268 (last-1)->className());
269 switch (first->classValue()) {
289 panic(
"Unexpected RegClass (%s)",
298 DPRINTF(FreeList,
"Freeing register %i (%s).\n", freed_reg->
index(),
322 panic(
"Unexpected RegClass (%s)",
340 #endif // __CPU_O3_FREE_LIST_HH__
void addVecReg(PhysRegIdPtr freed_reg)
Adds a vector register back to the free list.
Unified register rename map for all classes of registers.
bool hasFreeRegs() const
True iff there are free registers on the list.
bool hasFreeFloatRegs() const
Checks if there are any free fp registers.
PhysRegFile * regFile
The register file object is used only to distinguish integer from floating-point physical register in...
unsigned numFreeVecPredRegs() const
Returns the number of free predicate registers.
UnifiedFreeList(const std::string &_my_name, PhysRegFile *_regFile)
Constructs a free list.
void addIntReg(PhysRegIdPtr freed_reg)
Adds an integer register back to the free list.
@ VecElemClass
Vector Register Native Elem lane.
PhysRegIdPtr getIntReg()
Gets a free integer register.
void addRegs(InputIt first, InputIt last)
Adds a register back to the free list.
const RegClass & classValue() const
Class accessor.
SimpleFreeList ccList
The list of free condition-code registers.
void addCCReg(PhysRegIdPtr freed_reg)
Adds a cc register back to the free list.
bool hasFreeCCRegs() const
Checks if there are any free cc registers.
Simple physical register file class.
SimpleFreeList vecList
The following two are exclusive interfaces.
SimpleFreeList floatList
The list of free floating point registers.
const RegIndex & index() const
Visible RegId methods.
bool hasFreeVecPredRegs() const
Checks if there are any free predicate registers.
@ FloatRegClass
Floating-point register.
void addVecElem(PhysRegIdPtr freed_reg)
Adds a vector element register back to the free list.
unsigned numFreeRegs() const
Return the number of free registers on the list.
void addReg(PhysRegIdPtr reg)
Add a physical register to the free list.
FreeList class that simply holds the list of free integer and floating point registers.
unsigned numFreeVecRegs() const
Returns the number of free vector registers.
std::string name() const
Gives the name of the freelist.
unsigned numFreeVecElems() const
Returns the number of free vector registers.
@ IntRegClass
Integer register.
@ CCRegClass
Condition-code register.
bool hasFreeVecElems() const
Checks if there are any free vector registers.
PhysRegIdPtr getVecPredReg()
Gets a free predicate register.
void addVecPredReg(PhysRegIdPtr freed_reg)
Adds a predicate register back to the free list.
unsigned numFreeIntRegs() const
Returns the number of free integer registers.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
void addRegs(InputIt first, InputIt last)
Add physical registers to the free list.
@ VecRegClass
Vector Register.
const char * className() const
Return a const char* with the register class name.
const std::string _name
The object name, for DPRINTF.
PhysRegIdPtr getCCReg()
Gets a free cc register.
SimpleFreeList predList
The list of free predicate registers.
PhysRegIdPtr getReg()
Get the next available register from the free list.
SimpleFreeList * getCCList()
Returns a pointer to the condition-code free list.
void addFloatReg(PhysRegIdPtr freed_reg)
Adds a fp register back to the free list.
std::queue< PhysRegIdPtr > freeRegs
The actual free list.
bool hasFreeVecRegs() const
Checks if there are any free vector registers.
SimpleFreeList vecElemList
The list of free vector element registers.
bool hasFreeIntRegs() const
Checks if there are any free integer registers.
SimpleFreeList intList
The list of free integer registers.
PhysRegIdPtr getVecElem()
Gets a free vector elemenet register.
unsigned numFreeCCRegs() const
Returns the number of free cc registers.
Free list for a single class of registers (e.g., integer or floating point).
void addReg(PhysRegIdPtr freed_reg)
Adds a register back to the free list.
unsigned numFreeFloatRegs() const
Returns the number of free fp registers.
PhysRegIdPtr getVecReg()
Gets a free vector register.
#define panic(...)
This implements a cprintf based panic() function.
PhysRegIdPtr getFloatReg()
Gets a free fp register.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17