gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::ruby::RubyPrefetcher Class Reference

#include <RubyPrefetcher.hh>

Inheritance diagram for gem5::ruby::RubyPrefetcher:
gem5::SimObject gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named

Classes

struct  NonUnitFilterEntry
 
struct  RubyPrefetcherStats
 
struct  UnitFilterEntry
 

Public Types

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

Public Member Functions

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

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).
 
void initializeStream (Addr address, int stride, uint32_t index, const RubyRequestType &type)
 allocate a new stream buffer at a specific index
 
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.
 
bool accessUnitFilter (CircularQueue< UnitFilterEntry > *const filter, Addr line_addr, int stride, const RubyRequestType &type)
 Access a unit stride filter to determine if there is a hit, and update it otherwise.
 
bool accessNonunitFilter (Addr line_addr, const RubyRequestType &type)
 Access a non-unit stride filter to determine if there is a hit, and update it otherwise.
 
Addr pageAddress (Addr addr) const
 determine the page aligned address
 

Private Attributes

uint32_t m_num_streams
 number of prefetch streams available
 
std::vector< PrefetchEntrym_array
 an array of the active prefetch streams
 
uint32_t m_train_misses
 number of misses I must see before allocating a stream
 
uint32_t m_num_startup_pfs
 number of initial prefetches to startup a stream
 
CircularQueue< UnitFilterEntryunitFilter
 A unit stride filter array: helps reduce BW requirement of prefetching.
 
CircularQueue< UnitFilterEntrynegativeFilter
 A negative unit stride filter array: helps reduce BW requirement of prefetching.
 
CircularQueue< NonUnitFilterEntrynonUnitFilter
 A non-unit stride filter array: helps reduce BW requirement of prefetching.
 
bool m_prefetch_cross_pages
 Used for allowing prefetches across pages.
 
AbstractControllerm_controller
 
const unsigned pageShift
 
gem5::ruby::RubyPrefetcher::RubyPrefetcherStats rubyPrefetcherStats
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing all SimObjects in the system.
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it.
 
static void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section.
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it.
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain.
 
void signalDrainDone () const
 Signal that an object is drained.
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters.
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue.
 

Detailed Description

Definition at line 100 of file RubyPrefetcher.hh.

Member Typedef Documentation

◆ Params

typedef RubyPrefetcherParams gem5::ruby::RubyPrefetcher::Params

Definition at line 103 of file RubyPrefetcher.hh.

Constructor & Destructor Documentation

◆ RubyPrefetcher()

gem5::ruby::RubyPrefetcher::RubyPrefetcher ( const Params & p)

Definition at line 57 of file RubyPrefetcher.cc.

References m_num_startup_pfs, m_num_streams, and MAX_PF_INFLIGHT.

◆ ~RubyPrefetcher()

gem5::ruby::RubyPrefetcher::~RubyPrefetcher ( )
default

Member Function Documentation

◆ accessNonunitFilter()

bool gem5::ruby::RubyPrefetcher::accessNonunitFilter ( Addr line_addr,
const RubyRequestType & type )
private

Access a non-unit stride filter to determine if there is a hit, and update it otherwise.

Parameters
line_addrAddress being accessed, block aligned.
typeType of the request that generated the access.
Returns
True if a corresponding entry was found and its stride is not zero.

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

Definition at line 292 of file RubyPrefetcher.cc.

References gem5::ruby::RubySystem::getBlockSizeBytes(), getLRUindex(), initializeStream(), m_train_misses, nonUnitFilter, pageAddress(), gem5::ArmISA::stride, and gem5::X86ISA::type.

Referenced by observeMiss().

◆ accessUnitFilter()

bool gem5::ruby::RubyPrefetcher::accessUnitFilter ( CircularQueue< UnitFilterEntry > *const filter,
Addr line_addr,
int stride,
const RubyRequestType & type )
private

Access a unit stride filter to determine if there is a hit, and update it otherwise.

Parameters
filterUnit filter being accessed.
line_addrAddress being accessed, block aligned.
strideThe stride value.
typeType of the request that generated the access.
Returns
True if a corresponding entry was found.

Definition at line 269 of file RubyPrefetcher.cc.

References getLRUindex(), initializeStream(), m_train_misses, gem5::ruby::makeNextStrideAddress(), gem5::CircularQueue< T >::push_back(), gem5::ArmISA::stride, and gem5::X86ISA::type.

Referenced by observeMiss().

◆ getLRUindex()

uint32_t gem5::ruby::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 191 of file RubyPrefetcher.cc.

References gem5::ArmISA::i, m_array, and m_num_streams.

Referenced by accessNonunitFilter(), and accessUnitFilter().

◆ getPrefetchEntry()

PrefetchEntry * gem5::ruby::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 251 of file RubyPrefetcher.cc.

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

Referenced by issueNextPrefetch(), and observeMiss().

◆ initializeStream()

◆ issueNextPrefetch()

◆ observeMiss()

◆ observePfHit()

void gem5::ruby::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 144 of file RubyPrefetcher.cc.

References DPRINTF, issueNextPrefetch(), gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numHits, and rubyPrefetcherStats.

◆ observePfMiss()

void gem5::ruby::RubyPrefetcher::observePfMiss ( Addr address)

◆ pageAddress()

Addr gem5::ruby::RubyPrefetcher::pageAddress ( Addr addr) const
private

determine the page aligned address

Definition at line 379 of file RubyPrefetcher.cc.

References gem5::X86ISA::addr, gem5::mbits(), and pageShift.

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

◆ print()

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

Print out some statistics.

Definition at line 346 of file RubyPrefetcher.cc.

References gem5::ArmISA::i, m_array, m_num_streams, gem5::Named::name(), negativeFilter, nonUnitFilter, and unitFilter.

◆ setController()

void gem5::ruby::RubyPrefetcher::setController ( AbstractController * _ctrl)
inline

Definition at line 128 of file RubyPrefetcher.hh.

References m_controller.

Member Data Documentation

◆ m_array

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

an array of the active prefetch streams

Definition at line 210 of file RubyPrefetcher.hh.

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

◆ m_controller

AbstractController* gem5::ruby::RubyPrefetcher::m_controller
private

Definition at line 238 of file RubyPrefetcher.hh.

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

◆ m_num_startup_pfs

uint32_t gem5::ruby::RubyPrefetcher::m_num_startup_pfs
private

number of initial prefetches to startup a stream

Definition at line 215 of file RubyPrefetcher.hh.

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

◆ m_num_streams

uint32_t gem5::ruby::RubyPrefetcher::m_num_streams
private

number of prefetch streams available

Definition at line 208 of file RubyPrefetcher.hh.

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

◆ m_prefetch_cross_pages

bool gem5::ruby::RubyPrefetcher::m_prefetch_cross_pages
private

Used for allowing prefetches across pages.

Definition at line 236 of file RubyPrefetcher.hh.

Referenced by initializeStream(), and issueNextPrefetch().

◆ m_train_misses

uint32_t gem5::ruby::RubyPrefetcher::m_train_misses
private

number of misses I must see before allocating a stream

Definition at line 213 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), and accessUnitFilter().

◆ negativeFilter

CircularQueue<UnitFilterEntry> gem5::ruby::RubyPrefetcher::negativeFilter
private

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

Definition at line 227 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and print().

◆ nonUnitFilter

CircularQueue<NonUnitFilterEntry> gem5::ruby::RubyPrefetcher::nonUnitFilter
private

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

Definition at line 233 of file RubyPrefetcher.hh.

Referenced by accessNonunitFilter(), and print().

◆ pageShift

const unsigned gem5::ruby::RubyPrefetcher::pageShift
private

Definition at line 240 of file RubyPrefetcher.hh.

Referenced by pageAddress().

◆ rubyPrefetcherStats

gem5::ruby::RubyPrefetcher::RubyPrefetcherStats gem5::ruby::RubyPrefetcher::rubyPrefetcherStats
private

◆ unitFilter

CircularQueue<UnitFilterEntry> gem5::ruby::RubyPrefetcher::unitFilter
private

A unit stride filter array: helps reduce BW requirement of prefetching.

Definition at line 221 of file RubyPrefetcher.hh.

Referenced by observeMiss(), and print().


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

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