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
SimpleRenameMap Class Reference

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< PhysRegIndexmap
 The acutal arch-to-phys register map. More...
 
SimpleFreeListfreeList
 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...
 

Detailed Description

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.

Member Typedef Documentation

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.

Constructor & Destructor Documentation

SimpleRenameMap::SimpleRenameMap ( )

Definition at line 42 of file rename_map.cc.

SimpleRenameMap::~SimpleRenameMap ( )
inline

Definition at line 99 of file rename_map.hh.

Member Function Documentation

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().

PhysRegIndex SimpleRenameMap::lookup ( RegIndex  arch_reg) const
inline

Look up the physical register mapped to an architectural register.

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

Definition at line 130 of file rename_map.hh.

References map.

Referenced by UnifiedRenameMap::lookupCC(), UnifiedRenameMap::lookupFloat(), and UnifiedRenameMap::lookupInt().

unsigned SimpleRenameMap::numFreeEntries ( ) const
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.

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

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().

void SimpleRenameMap::setEntry ( RegIndex  arch_reg,
PhysRegIndex  phys_reg 
)
inline

Update rename map with a specific mapping.

Generally used to roll back to old mappings on a squash.

Parameters
arch_regThe architectural register to remap.
phys_regThe 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().

Member Data Documentation

SimpleFreeList* SimpleRenameMap::freeList
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().

std::vector<PhysRegIndex> SimpleRenameMap::map
private

The acutal arch-to-phys register map.

Definition at line 78 of file rename_map.hh.

Referenced by init(), lookup(), rename(), and setEntry().

RegIndex SimpleRenameMap::zeroReg
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.

Referenced by init(), and rename().


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

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