gem5
|
Register rename map for a single class of registers (e.g., integer or floating point). More...
#include <rename_map.hh>
Public Types | |
typedef TheISA::RegIndex | RegIndex |
typedef std::pair < PhysRegIndex, PhysRegIndex > | 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 (RegIndex arch_reg) |
Tell rename map to get a new free physical register to remap the specified architectural register. More... | |
PhysRegIndex | lookup (RegIndex arch_reg) const |
Look up the physical register mapped to an architectural register. More... | |
void | setEntry (RegIndex arch_reg, PhysRegIndex 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... | |
Private Attributes | |
std::vector< PhysRegIndex > | 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... | |
RegIndex | 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 69 of file rename_map.hh.
typedef TheISA::RegIndex SimpleRenameMap::RegIndex |
Definition at line 73 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 114 of file rename_map.hh.
SimpleRenameMap::SimpleRenameMap | ( | ) |
Definition at line 42 of file rename_map.cc.
|
inline |
Definition at line 99 of file rename_map.hh.
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 49 of file rename_map.cc.
References freeList, 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 130 of file rename_map.hh.
References map.
Referenced by UnifiedRenameMap::lookupCC(), UnifiedRenameMap::lookupFloat(), and UnifiedRenameMap::lookupInt().
|
inline |
Return the number of free entries on the associated free list.
Definition at line 148 of file rename_map.hh.
References freeList, and SimpleFreeList::numFreeRegs().
Referenced by UnifiedRenameMap::canRename(), and UnifiedRenameMap::numFreeEntries().
SimpleRenameMap::RenameInfo SimpleRenameMap::rename | ( | RegIndex | 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 61 of file rename_map.cc.
References DPRINTF, freeList, SimpleFreeList::getReg(), map, and zeroReg.
Referenced by UnifiedRenameMap::renameCC(), UnifiedRenameMap::renameFloat(), and UnifiedRenameMap::renameInt().
|
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 142 of file rename_map.hh.
References map.
Referenced by UnifiedRenameMap::setCCEntry(), UnifiedRenameMap::setFloatEntry(), and UnifiedRenameMap::setIntEntry().
|
private |
Pointer to the free list from which new physical registers should be allocated in rename()
Definition at line 84 of file rename_map.hh.
Referenced by init(), numFreeEntries(), and rename().
|
private |
The acutal arch-to-phys register map.
Definition at line 78 of file rename_map.hh.
Referenced by 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 93 of file rename_map.hh.