gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
UnifiedRenameMap Class Reference

Unified register rename map for all classes of registers. More...

#include <rename_map.hh>

Public Types

typedef SimpleRenameMap::RenameInfo RenameInfo
 

Public Member Functions

 UnifiedRenameMap ()
 Default constructor. More...
 
 ~UnifiedRenameMap ()
 Destructor. More...
 
void init (PhysRegFile *_regFile, RegIndex _intZeroReg, RegIndex _floatZeroReg, UnifiedFreeList *freeList, VecMode _mode)
 Initializes rename map with given parameters. 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 minimum number of free entries across all of the register classes. More...
 
unsigned numFreeIntEntries () const
 
unsigned numFreeFloatEntries () const
 
unsigned numFreeVecEntries () const
 
unsigned numFreePredEntries () const
 
unsigned numFreeCCEntries () const
 
bool canRename (uint32_t intRegs, uint32_t floatRegs, uint32_t vectorRegs, uint32_t vecElemRegs, uint32_t vecPredRegs, uint32_t ccRegs) const
 Return whether there are enough registers to serve the request. More...
 
void switchMode (VecMode newVecMode)
 Set vector mode to Full or Elem. More...
 
void switchFreeList (UnifiedFreeList *freeList)
 Switch freeList of registers from Full to Elem or vicevers depending on vecMode (vector renaming mode). More...
 

Private Types

using VecReg = TheISA::VecReg
 
using VecPredReg = TheISA::VecPredReg
 
using VecMode = Enums::VecRegRenameMode
 

Private Attributes

SimpleRenameMap intMap
 The integer register rename map. More...
 
SimpleRenameMap floatMap
 The floating-point register rename map. More...
 
SimpleRenameMap ccMap
 The condition-code register rename map. More...
 
SimpleRenameMap vecMap
 The vector register rename map. More...
 
SimpleRenameMap vecElemMap
 The vector element register rename map. More...
 
SimpleRenameMap predMap
 The predicate register rename map. More...
 
VecMode vecMode
 
PhysRegFileregFile
 The register file object is used only to get PhysRegIdPtr on MiscRegs, as they are stored in it. More...
 

Static Private Attributes

static constexpr uint32_t NVecElems = TheISA::NumVecElemPerVecReg
 

Detailed Description

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 170 of file rename_map.hh.

Member Typedef Documentation

◆ RenameInfo

Definition at line 206 of file rename_map.hh.

◆ VecMode

using UnifiedRenameMap::VecMode = Enums::VecRegRenameMode
private

Definition at line 195 of file rename_map.hh.

◆ VecPredReg

using UnifiedRenameMap::VecPredReg = TheISA::VecPredReg
private

Definition at line 175 of file rename_map.hh.

◆ VecReg

using UnifiedRenameMap::VecReg = TheISA::VecReg
private

Definition at line 174 of file rename_map.hh.

Constructor & Destructor Documentation

◆ UnifiedRenameMap()

UnifiedRenameMap::UnifiedRenameMap ( )
inline

Default constructor.

init() must be called prior to use.

Definition at line 209 of file rename_map.hh.

◆ ~UnifiedRenameMap()

UnifiedRenameMap::~UnifiedRenameMap ( )
inline

Destructor.

Definition at line 212 of file rename_map.hh.

References SimpleRenameMap::freeList, and SimpleRenameMap::init().

Member Function Documentation

◆ canRename()

bool UnifiedRenameMap::canRename ( uint32_t  intRegs,
uint32_t  floatRegs,
uint32_t  vectorRegs,
uint32_t  vecElemRegs,
uint32_t  vecPredRegs,
uint32_t  ccRegs 
) const
inline

Return whether there are enough registers to serve the request.

Definition at line 382 of file rename_map.hh.

References SimpleRenameMap::numFreeEntries().

◆ init()

void UnifiedRenameMap::init ( PhysRegFile _regFile,
RegIndex  _intZeroReg,
RegIndex  _floatZeroReg,
UnifiedFreeList freeList,
VecMode  _mode 
)

◆ lookup()

PhysRegIdPtr UnifiedRenameMap::lookup ( const RegId arch_reg) const
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.

Parameters
arch_regThe architectural register to look up.
Returns
The physical register it is currently mapped to.

Definition at line 268 of file rename_map.hh.

References CCRegClass, RegId::className(), RegId::classValue(), RegId::flatIndex(), FloatRegClass, PhysRegFile::getMiscRegId(), IntRegClass, SimpleRenameMap::lookup(), MiscRegClass, panic, VecElemClass, VecPredRegClass, and VecRegClass.

◆ numFreeCCEntries()

unsigned UnifiedRenameMap::numFreeCCEntries ( ) const
inline

Definition at line 377 of file rename_map.hh.

References SimpleRenameMap::numFreeEntries().

◆ numFreeEntries()

unsigned UnifiedRenameMap::numFreeEntries ( ) const
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 359 of file rename_map.hh.

References SimpleRenameMap::numFreeEntries().

◆ numFreeFloatEntries()

unsigned UnifiedRenameMap::numFreeFloatEntries ( ) const
inline

Definition at line 369 of file rename_map.hh.

References SimpleRenameMap::numFreeEntries().

◆ numFreeIntEntries()

unsigned UnifiedRenameMap::numFreeIntEntries ( ) const
inline

Definition at line 368 of file rename_map.hh.

References SimpleRenameMap::numFreeEntries().

◆ numFreePredEntries()

unsigned UnifiedRenameMap::numFreePredEntries ( ) const
inline

Definition at line 376 of file rename_map.hh.

References SimpleRenameMap::numFreeEntries().

◆ numFreeVecEntries()

unsigned UnifiedRenameMap::numFreeVecEntries ( ) const
inline

Definition at line 370 of file rename_map.hh.

References SimpleRenameMap::numFreeEntries().

◆ rename()

RenameInfo UnifiedRenameMap::rename ( const RegId arch_reg)
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.

Parameters
arch_regThe architectural register id to remap.
Returns
A RenameInfo pair indicating both the new and previous physical registers.

Definition at line 229 of file rename_map.hh.

References CCRegClass, RegId::className(), RegId::classValue(), FloatRegClass, IntRegClass, SimpleRenameMap::lookup(), MiscRegClass, panic, SimpleRenameMap::rename(), VecElemClass, VecPredRegClass, and VecRegClass.

◆ setEntry()

void UnifiedRenameMap::setEntry ( const RegId arch_reg,
PhysRegIdPtr  phys_reg 
)
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.

Parameters
arch_regThe architectural register to remap.
phys_regThe physical register to remap it to.

Definition at line 310 of file rename_map.hh.

References CCRegClass, RegId::className(), RegId::classValue(), FloatRegClass, IntRegClass, PhysRegId::isCCPhysReg(), PhysRegId::isFloatPhysReg(), PhysRegId::isIntPhysReg(), PhysRegId::isVecPredPhysReg(), PhysRegId::isVectorPhysElem(), PhysRegId::isVectorPhysReg(), SimpleRenameMap::lookup(), MiscRegClass, panic, SimpleRenameMap::setEntry(), VecElemClass, VecPredRegClass, and VecRegClass.

◆ switchFreeList()

void UnifiedRenameMap::switchFreeList ( UnifiedFreeList freeList)

◆ switchMode()

void UnifiedRenameMap::switchMode ( VecMode  newVecMode)

Set vector mode to Full or Elem.

Ignore 'silent' modifications.

Parameters
newVecModenew vector renaming mode

Definition at line 175 of file rename_map.cc.

References ArmISA::i, MipsISA::l, AlphaISA::NumVecRegs, SimpleRenameMap::setEntry(), VecElemClass, and VecRegClass.

Member Data Documentation

◆ ccMap

SimpleRenameMap UnifiedRenameMap::ccMap
private

The condition-code register rename map.

Definition at line 184 of file rename_map.hh.

◆ floatMap

SimpleRenameMap UnifiedRenameMap::floatMap
private

The floating-point register rename map.

Definition at line 181 of file rename_map.hh.

◆ intMap

SimpleRenameMap UnifiedRenameMap::intMap
private

The integer register rename map.

Definition at line 178 of file rename_map.hh.

◆ NVecElems

constexpr uint32_t UnifiedRenameMap::NVecElems = TheISA::NumVecElemPerVecReg
staticprivate

Definition at line 173 of file rename_map.hh.

◆ predMap

SimpleRenameMap UnifiedRenameMap::predMap
private

The predicate register rename map.

Definition at line 193 of file rename_map.hh.

◆ regFile

PhysRegFile* UnifiedRenameMap::regFile
private

The register file object is used only to get PhysRegIdPtr on MiscRegs, as they are stored in it.

Definition at line 202 of file rename_map.hh.

◆ vecElemMap

SimpleRenameMap UnifiedRenameMap::vecElemMap
private

The vector element register rename map.

Definition at line 190 of file rename_map.hh.

◆ vecMap

SimpleRenameMap UnifiedRenameMap::vecMap
private

The vector register rename map.

Definition at line 187 of file rename_map.hh.

◆ vecMode

VecMode UnifiedRenameMap::vecMode
private

Definition at line 196 of file rename_map.hh.


The documentation for this class was generated from the following files:

Generated on Fri Feb 28 2020 16:27:17 for gem5 by doxygen 1.8.13