diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2013-10-15 14:22:44 -0400 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2013-10-15 14:22:44 -0400 |
commit | 552622184752dc798bc81f9b0b395db68aee9511 (patch) | |
tree | f8867449ca560470442878da448118277f561cbd /src/cpu/o3/regfile.hh | |
parent | 219c423f1fb0f9a559bfa87f9812426d5e2c3e29 (diff) | |
download | gem5-552622184752dc798bc81f9b0b395db68aee9511.tar.xz |
cpu/o3: clean up rename map and free list
Restructured rename map and free list to clean up some
extraneous code and separate out common code that can
be reused across different register classes (int and fp
at this point). Both components now consist of a set
of Simple* objects that are stand-alone rename map &
free list for each class, plus a Unified* object that
presents a unified interface across all register
classes and then redirects accesses to the appropriate
Simple* object as needed.
Moved free list initialization to PhysRegFile to better
isolate knowledge of physical register index mappings
to that class (and remove the need to pass a number
of parameters to the free list constructor).
Causes a small change to these stats:
cpu.rename.int_rename_lookups
cpu.rename.fp_rename_lookups
because they are now categorized on a per-operand basis
rather than a per-instruction basis.
That is, an instruction with mixed fp/int/misc operand
types will have each operand categorized independently,
where previously the lookup was categorized based on
the instruction type.
Diffstat (limited to 'src/cpu/o3/regfile.hh')
-rw-r--r-- | src/cpu/o3/regfile.hh | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/cpu/o3/regfile.hh b/src/cpu/o3/regfile.hh index b58f7a2a5..bd3a4f730 100644 --- a/src/cpu/o3/regfile.hh +++ b/src/cpu/o3/regfile.hh @@ -43,6 +43,8 @@ #include "cpu/o3/comm.hh" #include "debug/IEW.hh" +class UnifiedFreeList; + /** * Simple physical register file class. */ @@ -60,10 +62,10 @@ class PhysRegFile } PhysFloatReg; /** Integer register file. */ - IntReg *intRegFile; + std::vector<IntReg> intRegFile; /** Floating point register file. */ - PhysFloatReg *floatRegFile; + std::vector<PhysFloatReg> floatRegFile; /** * The first floating-point physical register index. The physical @@ -72,6 +74,12 @@ class PhysRegFile * 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. */ unsigned baseFloatRegIndex; @@ -89,7 +97,10 @@ class PhysRegFile /** * Destructor to free resources */ - ~PhysRegFile(); + ~PhysRegFile() {} + + /** Initialize the free list */ + void initFreeList(UnifiedFreeList *freeList); /** @return the number of integer physical registers. */ unsigned numIntPhysRegs() const { return baseFloatRegIndex; } @@ -203,25 +214,4 @@ class PhysRegFile }; -inline -PhysRegFile::PhysRegFile(unsigned _numPhysicalIntRegs, - unsigned _numPhysicalFloatRegs) - : baseFloatRegIndex(_numPhysicalIntRegs), - totalNumRegs(_numPhysicalIntRegs + _numPhysicalFloatRegs) -{ - intRegFile = new IntReg[_numPhysicalIntRegs]; - floatRegFile = new PhysFloatReg[_numPhysicalFloatRegs]; - - memset(intRegFile, 0, sizeof(IntReg) * _numPhysicalIntRegs); - memset(floatRegFile, 0, sizeof(PhysFloatReg) * _numPhysicalFloatRegs); -} - - -inline -PhysRegFile::~PhysRegFile() -{ - delete intRegFile; - delete floatRegFile; -} - #endif //__CPU_O3_REGFILE_HH__ |