gem5  v20.1.0.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
RubyPrefetcher Class Reference

#include <RubyPrefetcher.hh>

Inheritance diagram for RubyPrefetcher:
SimObject EventManager Serializable Drainable Stats::Group

Public Types

typedef RubyPrefetcherParams Params
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

 RubyPrefetcher (const Params *p)
 
 ~RubyPrefetcher ()
 
void issueNextPrefetch (Addr address, PrefetchEntry *stream)
 
void observePfHit (Addr address)
 Implement the prefetch hit(miss) callback interface. More...
 
void observePfMiss (Addr address)
 
void observeMiss (Addr address, const RubyRequestType &type)
 Observe a memory miss from the cache. More...
 
void print (std::ostream &out) const
 Print out some statistics. More...
 
void setController (AbstractController *_ctrl)
 
void regStats ()
 Callback to set stat parameters. More...
 
- Public Member Functions inherited from SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual PortgetPort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a port with a given name and index. More...
 
virtual void startup ()
 startup() is the final initialization call before simulation. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from EventManager
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick) -1)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More...
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue. More...
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 
- Public Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from Stats::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group. More...
 
virtual ~Group ()
 
virtual void resetStats ()
 Callback to reset stats. More...
 
virtual void preDumpStats ()
 Callback before stats are dumped. More...
 
void addStat (Stats::Info *info)
 Register a stat with this group. More...
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object. More...
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object. More...
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block. More...
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 

Private Member Functions

uint32_t getLRUindex (void)
 Returns an unused stream buffer (or if all are used, returns the least recently used (accessed) stream buffer). More...
 
void clearNonunitEntry (uint32_t index)
 clear a non-unit stride prefetcher entry More...
 
void initializeStream (Addr address, int stride, uint32_t index, const RubyRequestType &type)
 allocate a new stream buffer at a specific index More...
 
PrefetchEntrygetPrefetchEntry (Addr address, uint32_t &index)
 get pointer to the matching stream entry, returns NULL if not found index holds the multiple of the stride this address is. More...
 
bool accessUnitFilter (std::vector< Addr > &filter_table, uint32_t *hit_table, uint32_t &index, Addr address, int stride, bool &alloc)
 access a unit stride filter to determine if there is a hit More...
 
bool accessNonunitFilter (Addr address, int *stride, bool &alloc)
 access a unit stride filter to determine if there is a hit More...
 
Addr pageAddress (Addr addr) const
 determine the page aligned address More...
 

Private Attributes

uint32_t m_num_streams
 number of prefetch streams available More...
 
std::vector< PrefetchEntrym_array
 an array of the active prefetch streams More...
 
uint32_t m_train_misses
 number of misses I must see before allocating a stream More...
 
uint32_t m_num_startup_pfs
 number of initial prefetches to startup a stream More...
 
uint32_t m_num_unit_filters
 number of stride filters More...
 
uint32_t m_num_nonunit_filters
 number of non-stride filters More...
 
std::vector< Addrm_unit_filter
 a unit stride filter array: helps reduce BW requirement of prefetching More...
 
uint32_t m_unit_filter_index
 a round robin pointer into the unit filter group More...
 
uint32_t * m_unit_filter_hit
 An array used to count the of times particular filter entries have been hit. More...
 
std::vector< Addrm_negative_filter
 a negative unit stride filter array: helps reduce BW requirement of prefetching More...
 
uint32_t m_negative_filter_index
 a round robin pointer into the negative filter group More...
 
uint32_t * m_negative_filter_hit
 An array used to count the of times particular filter entries have been hit. More...
 
std::vector< Addrm_nonunit_filter
 a non-unit stride filter array: helps reduce BW requirement of prefetching More...
 
int * m_nonunit_stride
 An array of strides (in # of cache lines) for the filter entries. More...
 
uint32_t * m_nonunit_hit
 An array used to count the of times particular filter entries have been hit. More...
 
uint32_t m_nonunit_index
 a round robin pointer into the unit filter group More...
 
bool m_prefetch_cross_pages
 Used for allowing prefetches across pages. More...
 
AbstractControllerm_controller
 
const Addr m_page_shift
 
Stats::Scalar numMissObserved
 Count of accesses to the prefetcher. More...
 
Stats::Scalar numAllocatedStreams
 Count of prefetch streams allocated. More...
 
Stats::Scalar numPrefetchRequested
 Count of prefetch requests made. More...
 
Stats::Scalar numHits
 Count of successful prefetches. More...
 
Stats::Scalar numPartialHits
 Count of partial successful prefetches. More...
 
Stats::Scalar numPagesCrossed
 Count of pages crossed. More...
 
Stats::Scalar numMissedPrefetchedBlocks
 Count of misses incurred for blocks that were prefetched. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 Serializes all the SimObjects. More...
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 93 of file RubyPrefetcher.hh.

Member Typedef Documentation

◆ Params

typedef RubyPrefetcherParams RubyPrefetcher::Params

Definition at line 96 of file RubyPrefetcher.hh.

Constructor & Destructor Documentation

◆ RubyPrefetcher()

RubyPrefetcher::RubyPrefetcher ( const Params p)

◆ ~RubyPrefetcher()

RubyPrefetcher::~RubyPrefetcher ( )

Member Function Documentation

◆ accessNonunitFilter()

bool RubyPrefetcher::accessNonunitFilter ( Addr  address,
int *  stride,
bool &  alloc 
)
private

access a unit stride filter to determine if there is a hit

look for non-unit strides based on a (user-defined) page size

Definition at line 384 of file RubyPrefetcher.cc.

References clearNonunitEntry(), RubySystem::getBlockSizeBytes(), ArmISA::i, m_nonunit_filter, m_nonunit_hit, m_nonunit_index, m_nonunit_stride, m_num_nonunit_filters, m_train_misses, makeLineAddress(), pageAddress(), and ArmISA::stride.

Referenced by observeMiss().

◆ accessUnitFilter()

bool RubyPrefetcher::accessUnitFilter ( std::vector< Addr > &  filter_table,
uint32_t *  hit_table,
uint32_t &  index,
Addr  address,
int  stride,
bool &  alloc 
)
private

access a unit stride filter to determine if there is a hit

Definition at line 351 of file RubyPrefetcher.cc.

References ArmISA::i, MipsISA::index, m_num_unit_filters, m_train_misses, makeLineAddress(), makeNextStrideAddress(), and ArmISA::stride.

Referenced by observeMiss().

◆ clearNonunitEntry()

void RubyPrefetcher::clearNonunitEntry ( uint32_t  index)
private

clear a non-unit stride prefetcher entry

Definition at line 284 of file RubyPrefetcher.cc.

References MipsISA::index, m_nonunit_filter, m_nonunit_hit, and m_nonunit_stride.

Referenced by accessNonunitFilter().

◆ getLRUindex()

uint32_t RubyPrefetcher::getLRUindex ( void  )
private

Returns an unused stream buffer (or if all are used, returns the least recently used (accessed) stream buffer).

Returns
The index of the least recently used stream buffer.

Definition at line 265 of file RubyPrefetcher.cc.

References ArmISA::i, m_array, and m_num_streams.

Referenced by observeMiss().

◆ getPrefetchEntry()

PrefetchEntry * RubyPrefetcher::getPrefetchEntry ( Addr  address,
uint32_t &  index 
)
private

get pointer to the matching stream entry, returns NULL if not found index holds the multiple of the stride this address is.

Definition at line 333 of file RubyPrefetcher.cc.

References ArmISA::i, ArmISA::j, m_array, m_num_startup_pfs, m_num_streams, and makeNextStrideAddress().

Referenced by issueNextPrefetch(), and observeMiss().

◆ initializeStream()

void RubyPrefetcher::initializeStream ( Addr  address,
int  stride,
uint32_t  index,
const RubyRequestType &  type 
)
private

◆ issueNextPrefetch()

void RubyPrefetcher::issueNextPrefetch ( Addr  address,
PrefetchEntry stream 
)

◆ observeMiss()

void RubyPrefetcher::observeMiss ( Addr  address,
const RubyRequestType &  type 
)

◆ observePfHit()

void RubyPrefetcher::observePfHit ( Addr  address)

Implement the prefetch hit(miss) callback interface.

These functions are called by the cache when it hits(misses) on a line with the line's prefetch bit set. If this address hits in m_array we will continue prefetching the stream.

Definition at line 218 of file RubyPrefetcher.cc.

References DPRINTF, issueNextPrefetch(), and numHits.

◆ observePfMiss()

void RubyPrefetcher::observePfMiss ( Addr  address)

Definition at line 210 of file RubyPrefetcher.cc.

References DPRINTF, issueNextPrefetch(), and numPartialHits.

Referenced by observeMiss().

◆ pageAddress()

Addr RubyPrefetcher::pageAddress ( Addr  addr) const
private

determine the page aligned address

Definition at line 480 of file RubyPrefetcher.cc.

References addr, and m_page_shift.

Referenced by accessNonunitFilter(), initializeStream(), and issueNextPrefetch().

◆ print()

void RubyPrefetcher::print ( std::ostream &  out) const

◆ regStats()

void RubyPrefetcher::regStats ( )
virtual

Callback to set stat parameters.

This callback is typically used for complex stats (e.g., distributions) that need parameters in addition to a name and a description. Stat names and descriptions should typically be set from the constructor usingo from the constructor using the ADD_STAT macro.

Reimplemented from Stats::Group.

Definition at line 101 of file RubyPrefetcher.cc.

References Stats::DataWrap< Derived, InfoProxyType >::desc(), SimObject::name(), Stats::DataWrap< Derived, InfoProxyType >::name(), numAllocatedStreams, numHits, numMissedPrefetchedBlocks, numMissObserved, numPagesCrossed, numPartialHits, numPrefetchRequested, and Stats::Group::regStats().

◆ setController()

void RubyPrefetcher::setController ( AbstractController _ctrl)
inline

Definition at line 121 of file RubyPrefetcher.hh.

References m_controller.

Member Data Documentation

◆ m_array

std::vector<PrefetchEntry> RubyPrefetcher::m_array
private

an array of the active prefetch streams

Definition at line 161 of file RubyPrefetcher.hh.

Referenced by getLRUindex(), getPrefetchEntry(), initializeStream(), and print().

◆ m_controller

AbstractController* RubyPrefetcher::m_controller
private

Definition at line 204 of file RubyPrefetcher.hh.

Referenced by initializeStream(), issueNextPrefetch(), and setController().

◆ m_negative_filter

std::vector<Addr> RubyPrefetcher::m_negative_filter
private

a negative unit stride filter array: helps reduce BW requirement of prefetching

Definition at line 183 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and print().

◆ m_negative_filter_hit

uint32_t* RubyPrefetcher::m_negative_filter_hit
private

An array used to count the of times particular filter entries have been hit.

Definition at line 188 of file RubyPrefetcher.hh.

Referenced by observeMiss(), RubyPrefetcher(), and ~RubyPrefetcher().

◆ m_negative_filter_index

uint32_t RubyPrefetcher::m_negative_filter_index
private

a round robin pointer into the negative filter group

Definition at line 185 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and RubyPrefetcher().

◆ m_nonunit_filter

std::vector<Addr> RubyPrefetcher::m_nonunit_filter
private

a non-unit stride filter array: helps reduce BW requirement of prefetching

Definition at line 192 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), clearNonunitEntry(), and print().

◆ m_nonunit_hit

uint32_t* RubyPrefetcher::m_nonunit_hit
private

An array used to count the of times particular filter entries have been hit.

Definition at line 197 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), clearNonunitEntry(), print(), RubyPrefetcher(), and ~RubyPrefetcher().

◆ m_nonunit_index

uint32_t RubyPrefetcher::m_nonunit_index
private

a round robin pointer into the unit filter group

Definition at line 199 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), and RubyPrefetcher().

◆ m_nonunit_stride

int* RubyPrefetcher::m_nonunit_stride
private

An array of strides (in # of cache lines) for the filter entries.

Definition at line 194 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), clearNonunitEntry(), print(), RubyPrefetcher(), and ~RubyPrefetcher().

◆ m_num_nonunit_filters

uint32_t RubyPrefetcher::m_num_nonunit_filters
private

number of non-stride filters

Definition at line 170 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), print(), and RubyPrefetcher().

◆ m_num_startup_pfs

uint32_t RubyPrefetcher::m_num_startup_pfs
private

number of initial prefetches to startup a stream

Definition at line 166 of file RubyPrefetcher.hh.

Referenced by getPrefetchEntry(), initializeStream(), and RubyPrefetcher().

◆ m_num_streams

uint32_t RubyPrefetcher::m_num_streams
private

number of prefetch streams available

Definition at line 159 of file RubyPrefetcher.hh.

Referenced by getLRUindex(), getPrefetchEntry(), print(), and RubyPrefetcher().

◆ m_num_unit_filters

uint32_t RubyPrefetcher::m_num_unit_filters
private

number of stride filters

Definition at line 168 of file RubyPrefetcher.hh.

Referenced by accessUnitFilter(), print(), and RubyPrefetcher().

◆ m_page_shift

const Addr RubyPrefetcher::m_page_shift
private

Definition at line 206 of file RubyPrefetcher.hh.

Referenced by pageAddress().

◆ m_prefetch_cross_pages

bool RubyPrefetcher::m_prefetch_cross_pages
private

Used for allowing prefetches across pages.

Definition at line 202 of file RubyPrefetcher.hh.

Referenced by initializeStream(), and issueNextPrefetch().

◆ m_train_misses

uint32_t RubyPrefetcher::m_train_misses
private

number of misses I must see before allocating a stream

Definition at line 164 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), and accessUnitFilter().

◆ m_unit_filter

std::vector<Addr> RubyPrefetcher::m_unit_filter
private

a unit stride filter array: helps reduce BW requirement of prefetching

Definition at line 174 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and print().

◆ m_unit_filter_hit

uint32_t* RubyPrefetcher::m_unit_filter_hit
private

An array used to count the of times particular filter entries have been hit.

Definition at line 179 of file RubyPrefetcher.hh.

Referenced by observeMiss(), RubyPrefetcher(), and ~RubyPrefetcher().

◆ m_unit_filter_index

uint32_t RubyPrefetcher::m_unit_filter_index
private

a round robin pointer into the unit filter group

Definition at line 176 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and RubyPrefetcher().

◆ numAllocatedStreams

Stats::Scalar RubyPrefetcher::numAllocatedStreams
private

Count of prefetch streams allocated.

Definition at line 211 of file RubyPrefetcher.hh.

Referenced by initializeStream(), and regStats().

◆ numHits

Stats::Scalar RubyPrefetcher::numHits
private

Count of successful prefetches.

Definition at line 215 of file RubyPrefetcher.hh.

Referenced by observePfHit(), and regStats().

◆ numMissedPrefetchedBlocks

Stats::Scalar RubyPrefetcher::numMissedPrefetchedBlocks
private

Count of misses incurred for blocks that were prefetched.

Definition at line 221 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and regStats().

◆ numMissObserved

Stats::Scalar RubyPrefetcher::numMissObserved
private

Count of accesses to the prefetcher.

Definition at line 209 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and regStats().

◆ numPagesCrossed

Stats::Scalar RubyPrefetcher::numPagesCrossed
private

Count of pages crossed.

Definition at line 219 of file RubyPrefetcher.hh.

Referenced by initializeStream(), issueNextPrefetch(), and regStats().

◆ numPartialHits

Stats::Scalar RubyPrefetcher::numPartialHits
private

Count of partial successful prefetches.

Definition at line 217 of file RubyPrefetcher.hh.

Referenced by observeMiss(), observePfMiss(), and regStats().

◆ numPrefetchRequested

Stats::Scalar RubyPrefetcher::numPrefetchRequested
private

Count of prefetch requests made.

Definition at line 213 of file RubyPrefetcher.hh.

Referenced by initializeStream(), issueNextPrefetch(), and regStats().


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

Generated on Wed Sep 30 2020 14:02:30 for gem5 by doxygen 1.8.17