gem5
v20.1.0.0
|
Register rename map for a single class of registers (e.g., integer or floating point). More...
#include <rename_map.hh>
Public Types | |
using | iterator = Arch2PhysMap::iterator |
using | const_iterator = Arch2PhysMap::const_iterator |
typedef std::pair< PhysRegIdPtr, PhysRegIdPtr > | RenameInfo |
Pair of a physical register and a physical register. More... | |
Public Member Functions | |
SimpleRenameMap () | |
~SimpleRenameMap () | |
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 object via the constructor. More... | |
RenameInfo | rename (const RegId &arch_reg) |
Tell rename map to get a new free physical register to remap the specified architectural register. More... | |
PhysRegIdPtr | lookup (const RegId &arch_reg) const |
Look up the physical register mapped to an architectural register. More... | |
void | setEntry (const RegId &arch_reg, PhysRegIdPtr phys_reg) |
Update rename map with a specific mapping. More... | |
unsigned | numFreeEntries () const |
Return the number of free entries on the associated free list. More... | |
iterator | begin () |
Forward begin/cbegin to the map. More... | |
const_iterator | begin () const |
const_iterator | cbegin () const |
iterator | end () |
Forward end/cend to the map. More... | |
const_iterator | end () const |
const_iterator | cend () const |
Private Types | |
using | Arch2PhysMap = std::vector< PhysRegIdPtr > |
Private Attributes | |
Arch2PhysMap | map |
The acutal arch-to-phys register map. More... | |
SimpleFreeList * | freeList |
Pointer to the free list from which new physical registers should be allocated in rename() More... | |
RegId | zeroReg |
The architectural index of the zero register. More... | |
Register rename map for a single class of registers (e.g., integer or floating point).
Because the register class is implicitly determined by the rename map instance being accessed, all architectural register index parameters and values in this class are relative (e.g., fp2 is just index 2).
Definition at line 63 of file rename_map.hh.
|
private |
Definition at line 66 of file rename_map.hh.
using SimpleRenameMap::const_iterator = Arch2PhysMap::const_iterator |
Definition at line 71 of file rename_map.hh.
using SimpleRenameMap::iterator = Arch2PhysMap::iterator |
Definition at line 70 of file rename_map.hh.
Pair of a physical register and a physical register.
Used to return the physical register that a logical register has been renamed to, and the previous physical register that the same logical register was previously mapped to.
Definition at line 108 of file rename_map.hh.
SimpleRenameMap::SimpleRenameMap | ( | ) |
Definition at line 53 of file rename_map.cc.
|
inline |
Definition at line 93 of file rename_map.hh.
|
inline |
|
inline |
Definition at line 150 of file rename_map.hh.
References map.
|
inline |
Definition at line 151 of file rename_map.hh.
References map.
|
inline |
Definition at line 158 of file rename_map.hh.
References map.
|
inline |
|
inline |
Definition at line 157 of file rename_map.hh.
References map.
void SimpleRenameMap::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 object via the constructor.
Instead, this method is used for initialization.
Definition at line 60 of file rename_map.cc.
References freeList, IntRegClass, map, and zeroReg.
Referenced by UnifiedRenameMap::init().
|
inline |
Look up the physical register mapped to an architectural register.
arch_reg | The architectural register to look up. |
Definition at line 125 of file rename_map.hh.
References RegId::flatIndex(), and map.
Referenced by UnifiedRenameMap::lookup(), and UnifiedRenameMap::switchMode().
|
inline |
Return the number of free entries on the associated free list.
Definition at line 145 of file rename_map.hh.
References freeList, and SimpleFreeList::numFreeRegs().
Referenced by UnifiedRenameMap::canRename(), UnifiedRenameMap::numFreeCCEntries(), UnifiedRenameMap::numFreeEntries(), UnifiedRenameMap::numFreeFloatEntries(), UnifiedRenameMap::numFreeIntEntries(), UnifiedRenameMap::numFreePredEntries(), and UnifiedRenameMap::numFreeVecEntries().
SimpleRenameMap::RenameInfo SimpleRenameMap::rename | ( | const RegId & | arch_reg | ) |
Tell rename map to get a new free physical register to remap the specified architectural register.
arch_reg | The architectural register to remap. |
Definition at line 72 of file rename_map.cc.
References PhysRegId::decrNumPinnedWrites(), DPRINTF, RegId::flatIndex(), PhysRegId::flatIndex(), freeList, RegId::getNumPinnedWrites(), PhysRegId::getNumPinnedWrites(), SimpleFreeList::getReg(), PhysRegId::isZeroReg(), map, PhysRegId::setNumPinnedWrites(), PhysRegId::setNumPinnedWritesToComplete(), and zeroReg.
Referenced by UnifiedRenameMap::rename().
|
inline |
Update rename map with a specific mapping.
Generally used to roll back to old mappings on a squash.
arch_reg | The architectural register to remap. |
phys_reg | The physical register to remap it to. |
Definition at line 138 of file rename_map.hh.
References RegId::flatIndex(), and map.
Referenced by UnifiedRenameMap::setEntry().
|
private |
Pointer to the free list from which new physical registers should be allocated in rename()
Definition at line 78 of file rename_map.hh.
Referenced by init(), numFreeEntries(), and rename().
|
private |
The acutal arch-to-phys register map.
Definition at line 68 of file rename_map.hh.
Referenced by begin(), cbegin(), cend(), end(), init(), lookup(), rename(), and setEntry().
|
private |
The architectural index of the zero register.
This register is mapped but read-only, so we ignore attempts to rename it via the rename() method. If there is no such register for this map table, it should be set to an invalid index so that it never matches.
Definition at line 87 of file rename_map.hh.