gem5  v19.0.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
StridePrefetcher::PCTable Class Reference

#include <stride.hh>

Public Member Functions

 PCTable (int assoc, int sets, const std::string name, BaseReplacementPolicy *replacementPolicy)
 Default constructor. More...
 
 ~PCTable ()
 Default destructor. More...
 
StrideEntryfindEntry (Addr pc, bool is_secure)
 Search for an entry in the pc table. More...
 
StrideEntryfindVictim (Addr pc)
 Find a replacement victim to make room for given PC. More...
 

Private Member Functions

const std::string name ()
 
Addr pcHash (Addr pc) const
 PC hashing function to index sets in the table. More...
 

Private Attributes

const int pcTableSets
 
const std::string _name
 
std::vector< std::vector< StrideEntry > > entries
 
BaseReplacementPolicyreplacementPolicy
 Replacement policy used by StridePrefetcher. More...
 

Detailed Description

Definition at line 98 of file stride.hh.

Constructor & Destructor Documentation

◆ PCTable()

StridePrefetcher::PCTable::PCTable ( int  assoc,
int  sets,
const std::string  name,
BaseReplacementPolicy replacementPolicy 
)

Default constructor.

Create a table with given parameters.

Parameters
assocAssociativity of the table.
setsNumber of sets in the table.
nameName of the prefetcher.
replacementPolicyReplacement policy used by the table.

Definition at line 118 of file stride.cc.

References entries, and BaseReplacementPolicy::instantiateEntry().

◆ ~PCTable()

StridePrefetcher::PCTable::~PCTable ( )

Default destructor.

Definition at line 136 of file stride.cc.

Member Function Documentation

◆ findEntry()

StridePrefetcher::StrideEntry * StridePrefetcher::PCTable::findEntry ( Addr  pc,
bool  is_secure 
)
inline

Search for an entry in the pc table.

Parameters
pcThe PC to look for.
is_secureTrue if the target memory space is secure.
Returns
Pointer to the entry.

Definition at line 251 of file stride.cc.

References DPRINTF, entries, pcHash(), replacementPolicy, StridePrefetcher::StridePrefetcher(), and BaseReplacementPolicy::touch().

Referenced by StridePrefetcher::calculatePrefetch().

◆ findVictim()

StridePrefetcher::StrideEntry * StridePrefetcher::PCTable::findVictim ( Addr  pc)
inline

Find a replacement victim to make room for given PC.

Parameters
pcThe PC value.
Returns
The victimized entry.

Definition at line 229 of file stride.cc.

References DPRINTF, entries, ReplaceableEntry::getSet(), BaseReplacementPolicy::getVictim(), ReplaceableEntry::getWay(), pcHash(), and replacementPolicy.

Referenced by StridePrefetcher::calculatePrefetch().

◆ name()

const std::string StridePrefetcher::PCTable::name ( )
inlineprivate

Definition at line 135 of file stride.hh.

◆ pcHash()

Addr StridePrefetcher::PCTable::pcHash ( Addr  pc) const
inlineprivate

PC hashing function to index sets in the table.

Parameters
pcThe PC value.
Returns
The set to which this PC maps.

Definition at line 221 of file stride.cc.

References floorLog2(), and pcTableSets.

Referenced by findEntry(), and findVictim().

Member Data Documentation

◆ _name

const std::string StridePrefetcher::PCTable::_name
private

Definition at line 137 of file stride.hh.

◆ entries

std::vector<std::vector<StrideEntry> > StridePrefetcher::PCTable::entries
private

Definition at line 138 of file stride.hh.

Referenced by findEntry(), findVictim(), and PCTable().

◆ pcTableSets

const int StridePrefetcher::PCTable::pcTableSets
private

Definition at line 136 of file stride.hh.

Referenced by pcHash().

◆ replacementPolicy

BaseReplacementPolicy* StridePrefetcher::PCTable::replacementPolicy
private

Replacement policy used by StridePrefetcher.

Definition at line 143 of file stride.hh.

Referenced by StridePrefetcher::calculatePrefetch(), findEntry(), and findVictim().


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

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