gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | 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 TheISA::RegIndex RegIndex
 
typedef SimpleRenameMap::RenameInfo RenameInfo
 

Public Member Functions

 UnifiedRenameMap ()
 Default constructor. More...
 
 ~UnifiedRenameMap ()
 Destructor. More...
 
void init (PhysRegFile *_regFile, RegIndex _intZeroReg, RegIndex _floatZeroReg, UnifiedFreeList *freeList)
 Initializes rename map with given parameters. More...
 
RenameInfo rename (RegIndex arch_reg)
 Tell rename map to get a new free physical register to remap the specified architectural register. More...
 
RenameInfo renameInt (RegIndex rel_arch_reg)
 Perform rename() on an integer register, given a relative integer register index. More...
 
RenameInfo renameFloat (RegIndex rel_arch_reg)
 Perform rename() on a floating-point register, given a relative floating-point register index. More...
 
RenameInfo renameCC (RegIndex rel_arch_reg)
 Perform rename() on a condition-code register, given a relative condition-code register index. More...
 
RenameInfo renameMisc (RegIndex rel_arch_reg)
 Perform rename() on a misc register, given a relative misc register index. More...
 
PhysRegIndex lookup (RegIndex arch_reg) const
 Look up the physical register mapped to an architectural register. More...
 
PhysRegIndex lookupInt (RegIndex rel_arch_reg) const
 Perform lookup() on an integer register, given a relative integer register index. More...
 
PhysRegIndex lookupFloat (RegIndex rel_arch_reg) const
 Perform lookup() on a floating-point register, given a relative floating-point register index. More...
 
PhysRegIndex lookupCC (RegIndex rel_arch_reg) const
 Perform lookup() on a condition-code register, given a relative condition-code register index. More...
 
PhysRegIndex lookupMisc (RegIndex rel_arch_reg) const
 Perform lookup() on a misc register, given a relative misc register index. More...
 
void setEntry (RegIndex arch_reg, PhysRegIndex phys_reg)
 Update rename map with a specific mapping. More...
 
void setIntEntry (RegIndex arch_reg, PhysRegIndex phys_reg)
 Perform setEntry() on an integer register, given a relative integer register index. More...
 
void setFloatEntry (RegIndex arch_reg, PhysRegIndex phys_reg)
 Perform setEntry() on a floating-point register, given a relative floating-point register index. More...
 
void setCCEntry (RegIndex arch_reg, PhysRegIndex phys_reg)
 Perform setEntry() on a condition-code register, given a relative condition-code register index. More...
 
unsigned numFreeEntries () const
 Return the minimum number of free entries across all of the register classes. More...
 
bool canRename (uint32_t intRegs, uint32_t floatRegs, uint32_t ccRegs) const
 Return whether there are enough registers to serve the request. More...
 

Private Attributes

SimpleRenameMap intMap
 The integer register rename map. More...
 
SimpleRenameMap floatMap
 The floating-point register rename map. More...
 
PhysRegFileregFile
 The register file object is used only to distinguish integer from floating-point physical register indices, which in turn is used only for assert statements that make sure the physical register indices that get passed in and handed out are of the proper class. More...
 
SimpleRenameMap ccMap
 The condition-code register rename map. More...
 

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 unified register indices, while methods that do specify a register class (e.g., renameInt()) take relative register indices. See http://gem5.org/Register_Indexing.

Definition at line 159 of file rename_map.hh.

Member Typedef Documentation

typedef TheISA::RegIndex UnifiedRenameMap::RegIndex

Definition at line 182 of file rename_map.hh.

Definition at line 184 of file rename_map.hh.

Constructor & Destructor Documentation

UnifiedRenameMap::UnifiedRenameMap ( )
inline

Default constructor.

init() must be called prior to use.

Definition at line 187 of file rename_map.hh.

UnifiedRenameMap::~UnifiedRenameMap ( )
inline

Destructor.

Definition at line 190 of file rename_map.hh.

Member Function Documentation

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

Return whether there are enough registers to serve the request.

Definition at line 365 of file rename_map.hh.

References ccMap, floatMap, intMap, and SimpleRenameMap::numFreeEntries().

void UnifiedRenameMap::init ( PhysRegFile _regFile,
RegIndex  _intZeroReg,
RegIndex  _floatZeroReg,
UnifiedFreeList freeList 
)
PhysRegIndex UnifiedRenameMap::lookup ( RegIndex  arch_reg) const

Look up the physical register mapped to an architectural register.

This version takes a unified flattened architectural register index and calls the appropriate class-specific rename table.

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

Definition at line 132 of file rename_map.cc.

References CCRegClass, FloatRegClass, IntRegClass, lookupCC(), lookupFloat(), lookupInt(), lookupMisc(), MiscRegClass, panic, RegClassStrings, and regIdxToClass().

PhysRegIndex UnifiedRenameMap::lookupCC ( RegIndex  rel_arch_reg) const
inline

Perform lookup() on a condition-code register, given a relative condition-code register index.

Definition at line 292 of file rename_map.hh.

References ccMap, PhysRegFile::isCCPhysReg(), SimpleRenameMap::lookup(), and regFile.

Referenced by lookup().

PhysRegIndex UnifiedRenameMap::lookupFloat ( RegIndex  rel_arch_reg) const
inline

Perform lookup() on a floating-point register, given a relative floating-point register index.

Definition at line 281 of file rename_map.hh.

References floatMap, PhysRegFile::isFloatPhysReg(), SimpleRenameMap::lookup(), and regFile.

Referenced by lookup().

PhysRegIndex UnifiedRenameMap::lookupInt ( RegIndex  rel_arch_reg) const
inline

Perform lookup() on an integer register, given a relative integer register index.

Definition at line 270 of file rename_map.hh.

References intMap, PhysRegFile::isIntPhysReg(), SimpleRenameMap::lookup(), and regFile.

Referenced by lookup().

PhysRegIndex UnifiedRenameMap::lookupMisc ( RegIndex  rel_arch_reg) const
inline

Perform lookup() on a misc register, given a relative misc register index.

Definition at line 303 of file rename_map.hh.

References regFile, and PhysRegFile::totalNumPhysRegs().

Referenced by lookup(), renameMisc(), and setEntry().

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

References floatMap, intMap, and SimpleRenameMap::numFreeEntries().

UnifiedRenameMap::RenameInfo UnifiedRenameMap::rename ( RegIndex  arch_reg)

Tell rename map to get a new free physical register to remap the specified architectural register.

This version takes a unified flattened architectural register index and calls the appropriate class-specific rename table.

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

Definition at line 107 of file rename_map.cc.

References CCRegClass, FloatRegClass, IntRegClass, MiscRegClass, panic, RegClassStrings, regIdxToClass(), renameCC(), renameFloat(), renameInt(), and renameMisc().

RenameInfo UnifiedRenameMap::renameCC ( RegIndex  rel_arch_reg)
inline

Perform rename() on a condition-code register, given a relative condition-code register index.

Definition at line 235 of file rename_map.hh.

References ccMap, PhysRegFile::isCCPhysReg(), regFile, and SimpleRenameMap::rename().

Referenced by rename().

RenameInfo UnifiedRenameMap::renameFloat ( RegIndex  rel_arch_reg)
inline

Perform rename() on a floating-point register, given a relative floating-point register index.

Definition at line 224 of file rename_map.hh.

References floatMap, PhysRegFile::isFloatPhysReg(), regFile, and SimpleRenameMap::rename().

Referenced by rename().

RenameInfo UnifiedRenameMap::renameInt ( RegIndex  rel_arch_reg)
inline

Perform rename() on an integer register, given a relative integer register index.

Definition at line 213 of file rename_map.hh.

References intMap, PhysRegFile::isIntPhysReg(), regFile, and SimpleRenameMap::rename().

Referenced by rename().

RenameInfo UnifiedRenameMap::renameMisc ( RegIndex  rel_arch_reg)
inline

Perform rename() on a misc register, given a relative misc register index.

Definition at line 246 of file rename_map.hh.

References lookupMisc().

Referenced by rename().

void UnifiedRenameMap::setCCEntry ( RegIndex  arch_reg,
PhysRegIndex  phys_reg 
)
inline

Perform setEntry() on a condition-code register, given a relative condition-code register index.

Definition at line 345 of file rename_map.hh.

References ccMap, PhysRegFile::isCCPhysReg(), regFile, and SimpleRenameMap::setEntry().

Referenced by setEntry().

void UnifiedRenameMap::setEntry ( RegIndex  arch_reg,
PhysRegIndex  phys_reg 
)

Update rename map with a specific mapping.

Generally used to roll back to old mappings on a squash. This version takes a unified flattened architectural register index and calls the appropriate class-specific rename table.

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

Definition at line 156 of file rename_map.cc.

References CCRegClass, FloatRegClass, IntRegClass, lookupMisc(), MiscRegClass, panic, RegClassStrings, regIdxToClass(), setCCEntry(), setFloatEntry(), and setIntEntry().

void UnifiedRenameMap::setFloatEntry ( RegIndex  arch_reg,
PhysRegIndex  phys_reg 
)
inline

Perform setEntry() on a floating-point register, given a relative floating-point register index.

Definition at line 335 of file rename_map.hh.

References floatMap, PhysRegFile::isFloatPhysReg(), regFile, and SimpleRenameMap::setEntry().

Referenced by setEntry().

void UnifiedRenameMap::setIntEntry ( RegIndex  arch_reg,
PhysRegIndex  phys_reg 
)
inline

Perform setEntry() on an integer register, given a relative integer register index.

Definition at line 325 of file rename_map.hh.

References intMap, PhysRegFile::isIntPhysReg(), regFile, and SimpleRenameMap::setEntry().

Referenced by setEntry().

Member Data Documentation

SimpleRenameMap UnifiedRenameMap::ccMap
private

The condition-code register rename map.

Definition at line 179 of file rename_map.hh.

Referenced by canRename(), init(), lookupCC(), renameCC(), and setCCEntry().

SimpleRenameMap UnifiedRenameMap::floatMap
private

The floating-point register rename map.

Definition at line 167 of file rename_map.hh.

Referenced by canRename(), init(), lookupFloat(), numFreeEntries(), renameFloat(), and setFloatEntry().

SimpleRenameMap UnifiedRenameMap::intMap
private

The integer register rename map.

Definition at line 164 of file rename_map.hh.

Referenced by canRename(), init(), lookupInt(), numFreeEntries(), renameInt(), and setIntEntry().

PhysRegFile* UnifiedRenameMap::regFile
private

The register file object is used only to distinguish integer from floating-point physical register indices, which in turn is used only for assert statements that make sure the physical register indices that get passed in and handed out are of the proper class.

Definition at line 176 of file rename_map.hh.

Referenced by init(), lookupCC(), lookupFloat(), lookupInt(), lookupMisc(), renameCC(), renameFloat(), renameInt(), setCCEntry(), setFloatEntry(), and setIntEntry().


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

Generated on Fri Jun 9 2017 13:04:22 for gem5 by doxygen 1.8.6