gem5 v24.0.0.0
|
#include <RubyPrefetcher.hh>
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 Params & | params () 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. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual Port & | getPort (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 | |
EventQueue * | eventQueue () 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 Info * | resolveStat (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 | |
Group & | operator= (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 | |
PrefetchEntry * | getPrefetchEntry (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< PrefetchEntry > | m_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< UnitFilterEntry > | unitFilter |
A unit stride filter array: helps reduce BW requirement of prefetching. | |
CircularQueue< UnitFilterEntry > | negativeFilter |
A negative unit stride filter array: helps reduce BW requirement of prefetching. | |
CircularQueue< NonUnitFilterEntry > | nonUnitFilter |
A non-unit stride filter array: helps reduce BW requirement of prefetching. | |
bool | m_prefetch_cross_pages |
Used for allowing prefetches across pages. | |
AbstractController * | m_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 SimObject * | find (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 SimObjectResolver * | getSimObjectResolver () |
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 | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
Definition at line 100 of file RubyPrefetcher.hh.
typedef RubyPrefetcherParams gem5::ruby::RubyPrefetcher::Params |
Definition at line 103 of file RubyPrefetcher.hh.
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.
|
default |
|
private |
Access a non-unit stride filter to determine if there is a hit, and update it otherwise.
line_addr | Address being accessed, block aligned. |
type | Type of the request that generated the access. |
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().
|
private |
Access a unit stride filter to determine if there is a hit, and update it otherwise.
filter | Unit filter being accessed. |
line_addr | Address being accessed, block aligned. |
stride | The stride value. |
type | Type of the request that generated the access. |
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().
|
private |
Returns an unused stream buffer (or if all are used, returns the least recently used (accessed) 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().
|
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().
|
private |
allocate a new stream buffer at a specific index
Definition at line 210 of file RubyPrefetcher.cc.
References gem5::Clocked::curCycle(), DPRINTF, gem5::ruby::AbstractController::enqueuePrefetch(), gem5::MipsISA::index, gem5::MipsISA::k, gem5::ruby::PrefetchEntry::m_address, m_array, m_controller, gem5::ruby::PrefetchEntry::m_is_valid, m_num_startup_pfs, m_prefetch_cross_pages, gem5::ruby::PrefetchEntry::m_stride, gem5::ruby::PrefetchEntry::m_type, gem5::ruby::PrefetchEntry::m_use_time, gem5::ruby::makeLineAddress(), gem5::ruby::makeNextStrideAddress(), gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numAllocatedStreams, gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numPagesCrossed, gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numPrefetchRequested, pageAddress(), rubyPrefetcherStats, gem5::ArmISA::stride, and gem5::X86ISA::type.
Referenced by accessNonunitFilter(), and accessUnitFilter().
void gem5::ruby::RubyPrefetcher::issueNextPrefetch | ( | Addr | address, |
PrefetchEntry * | stream ) |
Definition at line 152 of file RubyPrefetcher.cc.
References gem5::Clocked::curCycle(), DPRINTF, gem5::ruby::AbstractController::enqueuePrefetch(), getPrefetchEntry(), gem5::MipsISA::index, gem5::ruby::PrefetchEntry::m_address, m_controller, gem5::ruby::PrefetchEntry::m_is_valid, m_prefetch_cross_pages, gem5::ruby::PrefetchEntry::m_stride, gem5::ruby::PrefetchEntry::m_type, gem5::ruby::PrefetchEntry::m_use_time, gem5::ruby::makeNextStrideAddress(), gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numPagesCrossed, gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numPrefetchRequested, pageAddress(), and rubyPrefetcherStats.
Referenced by observePfHit(), and observePfMiss().
void gem5::ruby::RubyPrefetcher::observeMiss | ( | Addr | address, |
const RubyRequestType & | type ) |
Observe a memory miss from the cache.
address | The physical address that missed out of the cache. |
Definition at line 90 of file RubyPrefetcher.cc.
References accessNonunitFilter(), accessUnitFilter(), DPRINTF, getPrefetchEntry(), gem5::MipsISA::index, gem5::ruby::makeLineAddress(), negativeFilter, gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numMissedPrefetchedBlocks, gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numMissObserved, gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numPartialHits, observePfMiss(), gem5::ruby::PrefetchEntry::requestCompleted, gem5::ruby::PrefetchEntry::requestIssued, rubyPrefetcherStats, gem5::X86ISA::type, and unitFilter.
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.
void gem5::ruby::RubyPrefetcher::observePfMiss | ( | Addr | address | ) |
Definition at line 136 of file RubyPrefetcher.cc.
References DPRINTF, issueNextPrefetch(), gem5::ruby::RubyPrefetcher::RubyPrefetcherStats::numPartialHits, and rubyPrefetcherStats.
Referenced by observeMiss().
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().
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.
|
inline |
Definition at line 128 of file RubyPrefetcher.hh.
References m_controller.
|
private |
an array of the active prefetch streams
Definition at line 210 of file RubyPrefetcher.hh.
Referenced by getLRUindex(), getPrefetchEntry(), initializeStream(), and print().
|
private |
Definition at line 238 of file RubyPrefetcher.hh.
Referenced by initializeStream(), issueNextPrefetch(), and setController().
|
private |
number of initial prefetches to startup a stream
Definition at line 215 of file RubyPrefetcher.hh.
Referenced by getPrefetchEntry(), initializeStream(), and RubyPrefetcher().
|
private |
number of prefetch streams available
Definition at line 208 of file RubyPrefetcher.hh.
Referenced by getLRUindex(), getPrefetchEntry(), print(), and RubyPrefetcher().
|
private |
Used for allowing prefetches across pages.
Definition at line 236 of file RubyPrefetcher.hh.
Referenced by initializeStream(), and issueNextPrefetch().
|
private |
number of misses I must see before allocating a stream
Definition at line 213 of file RubyPrefetcher.hh.
Referenced by accessNonunitFilter(), and accessUnitFilter().
|
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().
|
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().
|
private |
Definition at line 240 of file RubyPrefetcher.hh.
Referenced by pageAddress().
|
private |
Referenced by initializeStream(), issueNextPrefetch(), observeMiss(), observePfHit(), and observePfMiss().
|
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().