gem5 v24.0.0.0
Loading...
Searching...
No Matches
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.
 

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.
 
RenameInfo rename (const RegId &arch_reg)
 Tell rename map to get a new free physical register to remap the specified architectural register.
 
PhysRegIdPtr lookup (const RegId &arch_reg) const
 Look up the physical register mapped to an architectural register.
 
void setEntry (const RegId &arch_reg, PhysRegIdPtr phys_reg)
 Update rename map with a specific mapping.
 
unsigned numFreeEntries () const
 Return the number of free entries on the associated free list.
 
size_t numArchRegs () const
 
iterator begin ()
 Forward begin/cbegin to the map.
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 Forward end/cend to the map.
 
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.
 
SimpleFreeListfreeList
 Pointer to the free list from which new physical registers should be allocated in rename()
 

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

◆ 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.

◆ begin() [2/2]

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

Definition at line 149 of file rename_map.hh.

◆ cbegin()

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

Definition at line 150 of file rename_map.hh.

◆ cend()

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

Definition at line 157 of file rename_map.hh.

◆ end() [1/2]

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

Forward end/cend to the map.

Definition at line 155 of file rename_map.hh.

◆ end() [2/2]

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

Definition at line 156 of file rename_map.hh.

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

◆ numArchRegs()

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

Definition at line 144 of file rename_map.hh.

◆ 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::PhysRegId::getNumPinnedWrites(), gem5::RegId::getNumPinnedWrites(), gem5::o3::SimpleFreeList::getReg(), gem5::RegId::index(), gem5::InvalidRegClass, gem5::PhysRegId::is(), gem5::RegId::is(), 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().

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.


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

Generated on Tue Jun 18 2024 16:24:20 for gem5 by doxygen 1.11.0