gem5  v22.1.0.0
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
gem5::o3::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

using iterator = Arch2PhysMap::iterator
 
using const_iterator = Arch2PhysMap::const_iterator
 
typedef std::pair< PhysRegIdPtr, PhysRegIdPtrRenameInfo
 Pair of a physical register and a physical register. More...
 

Public Member Functions

 SimpleRenameMap ()
 
void init (const RegClass &reg_class, SimpleFreeList *_freeList)
 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...
 
size_t numArchRegs () const
 
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...
 
SimpleFreeListfreeList
 Pointer to the free list from which new physical registers should be allocated in rename() 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 71 of file rename_map.hh.

Member Typedef Documentation

◆ Arch2PhysMap

Definition at line 74 of file rename_map.hh.

◆ const_iterator

using gem5::o3::SimpleRenameMap::const_iterator = Arch2PhysMap::const_iterator

Definition at line 79 of file rename_map.hh.

◆ iterator

using gem5::o3::SimpleRenameMap::iterator = Arch2PhysMap::iterator

Definition at line 78 of file rename_map.hh.

◆ RenameInfo

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

Constructor & Destructor Documentation

◆ SimpleRenameMap()

gem5::o3::SimpleRenameMap::SimpleRenameMap ( )

Definition at line 56 of file rename_map.cc.

Member Function Documentation

◆ begin() [1/2]

iterator gem5::o3::SimpleRenameMap::begin ( )
inline

Forward begin/cbegin to the map.

Definition at line 148 of file rename_map.hh.

References map.

◆ begin() [2/2]

const_iterator gem5::o3::SimpleRenameMap::begin ( ) const
inline

Definition at line 149 of file rename_map.hh.

References map.

◆ cbegin()

const_iterator gem5::o3::SimpleRenameMap::cbegin ( ) const
inline

Definition at line 150 of file rename_map.hh.

References map.

◆ cend()

const_iterator gem5::o3::SimpleRenameMap::cend ( ) const
inline

Definition at line 157 of file rename_map.hh.

References map.

◆ end() [1/2]

iterator gem5::o3::SimpleRenameMap::end ( )
inline

Forward end/cend to the map.

Definition at line 155 of file rename_map.hh.

References map.

◆ end() [2/2]

const_iterator gem5::o3::SimpleRenameMap::end ( ) const
inline

Definition at line 156 of file rename_map.hh.

References map.

◆ init()

void gem5::o3::SimpleRenameMap::init ( const RegClass reg_class,
SimpleFreeList _freeList 
)

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 62 of file rename_map.cc.

References freeList, map, and gem5::RegClass::numRegs().

◆ lookup()

PhysRegIdPtr gem5::o3::SimpleRenameMap::lookup ( const RegId 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 122 of file rename_map.hh.

References gem5::RegId::index(), and map.

◆ numArchRegs()

size_t gem5::o3::SimpleRenameMap::numArchRegs ( ) const
inline

Definition at line 144 of file rename_map.hh.

References map.

◆ numFreeEntries()

unsigned gem5::o3::SimpleRenameMap::numFreeEntries ( ) const
inline

Return the number of free entries on the associated free list.

Definition at line 142 of file rename_map.hh.

References freeList, and gem5::o3::SimpleFreeList::numFreeRegs().

◆ rename()

SimpleRenameMap::RenameInfo gem5::o3::SimpleRenameMap::rename ( const RegId 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 72 of file rename_map.cc.

References gem5::PhysRegId::decrNumPinnedWrites(), DPRINTF, gem5::PhysRegId::flatIndex(), freeList, gem5::RegId::getNumPinnedWrites(), gem5::PhysRegId::getNumPinnedWrites(), gem5::o3::SimpleFreeList::getReg(), gem5::RegId::index(), gem5::InvalidRegClass, gem5::RegId::is(), gem5::PhysRegId::is(), map, gem5::PhysRegId::setNumPinnedWrites(), and gem5::PhysRegId::setNumPinnedWritesToComplete().

◆ setEntry()

void gem5::o3::SimpleRenameMap::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.

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

Definition at line 135 of file rename_map.hh.

References gem5::RegId::index(), and map.

Member Data Documentation

◆ freeList

SimpleFreeList* gem5::o3::SimpleRenameMap::freeList
private

Pointer to the free list from which new physical registers should be allocated in rename()

Definition at line 86 of file rename_map.hh.

Referenced by init(), numFreeEntries(), and rename().

◆ map

Arch2PhysMap gem5::o3::SimpleRenameMap::map
private

The acutal arch-to-phys register map.

Definition at line 76 of file rename_map.hh.

Referenced by begin(), cbegin(), cend(), end(), init(), lookup(), numArchRegs(), rename(), and setEntry().


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

Generated on Wed Dec 21 2022 10:24:18 for gem5 by doxygen 1.9.1