gem5 v24.0.0.0
|
Unified register rename map for all classes of registers. More...
#include <rename_map.hh>
Public Types | |
typedef SimpleRenameMap::RenameInfo | RenameInfo |
typedef std::array< UnifiedRenameMap, MaxThreads > | PerThreadUnifiedRenameMap |
Public Member Functions | |
UnifiedRenameMap () | |
Default constructor. | |
~UnifiedRenameMap () | |
Destructor. | |
void | init (const BaseISA::RegClasses ®Classes, PhysRegFile *_regFile, UnifiedFreeList *freeList) |
Initializes rename map with given parameters. | |
RenameInfo | rename (const RegId &arch_reg) |
Tell rename map to get a new free physical register to remap the specified architectural register. | |
PhysRegIdPtr | lookup (const RegId &arch_reg) const |
Look up the physical register mapped to an architectural register. | |
void | setEntry (const RegId &arch_reg, PhysRegIdPtr phys_reg) |
Update rename map with a specific mapping. | |
unsigned | minFreeEntries () const |
Return the minimum number of free entries across all of the register classes. | |
unsigned | numFreeEntries (RegClassType type) const |
bool | canRename (DynInstPtr inst) const |
Return whether there are enough registers to serve the request. | |
Private Attributes | |
std::array< SimpleRenameMap, CCRegClass+1 > | renameMaps |
PhysRegFile * | regFile |
The register file object is used only to get PhysRegIdPtr on MiscRegs, as they are stored in it. | |
Static Private Attributes | |
static PhysRegId | invalidPhysRegId {} |
Unified register rename map for all classes of registers.
Wraps a set of class-specific rename maps. Methods that do not specify a register class (e.g., rename()) take register ids, while methods that do specify a register class (e.g., renameInt()) take register indices.
Definition at line 168 of file rename_map.hh.
typedef std::array<UnifiedRenameMap, MaxThreads> gem5::o3::UnifiedRenameMap::PerThreadUnifiedRenameMap |
Definition at line 185 of file rename_map.hh.
Definition at line 183 of file rename_map.hh.
|
inline |
Default constructor.
init() must be called prior to use.
Definition at line 188 of file rename_map.hh.
|
inline |
Destructor.
Definition at line 191 of file rename_map.hh.
bool gem5::o3::UnifiedRenameMap::canRename | ( | DynInstPtr | inst | ) | const |
Return whether there are enough registers to serve the request.
Definition at line 120 of file rename_map.cc.
References gem5::ArmISA::i, and renameMaps.
void gem5::o3::UnifiedRenameMap::init | ( | const BaseISA::RegClasses & | regClasses, |
PhysRegFile * | _regFile, | ||
UnifiedFreeList * | freeList ) |
Initializes rename map with given parameters.
Definition at line 110 of file rename_map.cc.
References gem5::o3::UnifiedFreeList::freeLists, gem5::ArmISA::i, gem5::statistics::init, regFile, and renameMaps.
|
inline |
Look up the physical register mapped to an architectural register.
This version takes a flattened architectural register id and calls the appropriate class-specific rename table.
arch_reg | The architectural register to look up. |
Definition at line 227 of file rename_map.hh.
References gem5::RegId::classValue(), gem5::o3::PhysRegFile::getMiscRegId(), gem5::RegId::index(), invalidPhysRegId, gem5::InvalidRegClass, gem5::MiscRegClass, regFile, and renameMaps.
Referenced by rename(), and setEntry().
|
inline |
Return the minimum number of free entries across all of the register classes.
The minimum is used so we guarantee that this number of entries is available regardless of which class of registers is requested.
Definition at line 271 of file rename_map.hh.
References renameMaps.
|
inline |
Definition at line 283 of file rename_map.hh.
References renameMaps, and gem5::X86ISA::type.
|
inline |
Tell rename map to get a new free physical register to remap the specified architectural register.
This version takes a RegId and reads the appropriate class-specific rename table.
arch_reg | The architectural register id to remap. |
Definition at line 206 of file rename_map.hh.
References gem5::RegId::classValue(), gem5::RegId::isRenameable(), lookup(), and renameMaps.
|
inline |
Update rename map with a specific mapping.
Generally used to roll back to old mappings on a squash. This version takes a flattened architectural register id and calls the appropriate class-specific rename table.
arch_reg | The architectural register to remap. |
phys_reg | The physical register to remap it to. |
Definition at line 249 of file rename_map.hh.
References gem5::RegId::classValue(), gem5::PhysRegId::is(), gem5::RegId::isRenameable(), lookup(), and renameMaps.
Referenced by gem5::o3::Commit::commitHead(), and gem5::o3::Rename::doSquash().
|
inlinestaticprivate |
Definition at line 173 of file rename_map.hh.
Referenced by lookup().
|
private |
The register file object is used only to get PhysRegIdPtr on MiscRegs, as they are stored in it.
Definition at line 179 of file rename_map.hh.
|
private |
Definition at line 171 of file rename_map.hh.
Referenced by canRename(), init(), lookup(), minFreeEntries(), numFreeEntries(), rename(), and setEntry().