Go to the documentation of this file.
53 #include "params/BasePrefetcher.hh"
59 : address(
addr),
pc(pkt->req->hasPC() ? pkt->req->getPC() : 0),
60 requestorId(pkt->req->requestorId()), validPC(pkt->req->hasPC()),
61 secure(pkt->
isSecure()), size(pkt->req->getSize()), write(pkt->isWrite()),
62 paddress(pkt->req->getPaddr()), cacheMiss(miss)
64 unsigned int req_size = pkt->
req->getSize();
68 data =
new uint8_t[req_size];
76 validPC(pfi.validPC), secure(pfi.secure), size(pfi.size),
77 write(pfi.write), paddress(pfi.paddress), cacheMiss(pfi.cacheMiss),
86 parent.notifyFill(pkt);
88 parent.probeNotify(pkt, miss);
116 :
Stats::Group(parent),
117 ADD_STAT(pfIssued,
"number of hwpf issued")
125 bool fetch = pkt->
req->isInstFetch();
126 bool read = pkt->
isRead();
129 if (pkt->
req->isUncacheable())
return false;
130 if (fetch && !
onInst)
return false;
131 if (!fetch && !
onData)
return false;
132 if (!fetch && read && !
onRead)
return false;
133 if (!fetch && !read && !
onWrite)
return false;
134 if (!fetch && !read &&
inv)
return false;
204 if (pkt->
req->isCacheMaintenance())
return;
206 if (!pkt->
req->hasPaddr()) {
207 panic(
"Request must have a physical address");
257 fatal_if(
tlb !=
nullptr,
"Only one TLB can be registered");
const bool onData
Consult prefetcher on data accesses?
BaseCache * cache
Pointr to the parent cache.
T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
PrefetchInfo(PacketPtr pkt, Addr addr, bool miss)
Constructs a PrefetchInfo using a PacketPtr.
bool isSWPrefetch() const
const bool useVirtualAddresses
Use Virtual Addresses for prefetching.
StatGroup(Stats::Group *parent)
unsigned blkSize
The block size of the parent cache.
Addr pageAddress(Addr a) const
Determine the address of the page in which a lays.
const bool onWrite
Consult prefetcher on reads?
bool hasBeenPrefetched(Addr addr, bool is_secure) const
bool isInvalidate() const
RequestPtr req
A pointer to the original request.
bool inCache(Addr addr, bool is_secure) const
Determine if address is in cache.
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
uint64_t usefulPrefetches
Total prefetches that has been useful.
const bool onInst
Consult prefetcher on instruction accesses?
const bool onMiss
Only consult prefetcher on cache misses?
bool coalesce() const
Checks if the cache is coalescing writes.
bool hasBeenPrefetched(Addr addr, bool is_secure) const
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Prefetcher::Base::StatGroup prefetchStats
BaseTLB * tlb
Registered tlb for address translations.
bool observeAccess(const PacketPtr &pkt, bool miss) const
Determine if this access should be observed.
uint8_t * data
Pointer to the associated request data.
virtual void notify(const PacketPtr &pkt, const PrefetchInfo &pfi)=0
Notify prefetcher of cache access (may be any access or just misses, depending on cache parameters....
Base(const BasePrefetcherParams *p)
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
const bool onRead
Consult prefetcher on reads?
unsigned lBlkSize
log_2(block size of the parent cache).
virtual void setCache(BaseCache *_cache)
bool inMissQueue(Addr addr, bool is_secure) const
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
std::vector< PrefetchListener * > listeners
unsigned getBlockSize() const
Query block size of a cache.
void notify(const PacketPtr &pkt) override
Addr pageOffset(Addr a) const
Determine the page-offset of a
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void addTLB(BaseTLB *tlb)
Add a BaseTLB object to be used whenever a translation is needed.
ProbeManager * getProbeManager()
Get the probe manager for this object.
virtual const std::string name() const
Addr blockIndex(Addr a) const
Determine the address of a at block granularity.
MemCmd cmd
The command field of the packet.
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
uint64_t issuedPrefetches
Total prefetches issued.
const RequestorID requestorId
Request id for prefetches.
const bool prefetchOnAccess
Prefetch on every access, not just misses.
void regProbeListeners() override
Register probe points for this object.
void addEventProbe(SimObject *obj, const char *name)
Add a SimObject and a probe name to listen events from.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Class containing the information needed by the prefetch to train and generate new prefetch requests.
bool write
Whether this event comes from a write request.
Addr blockAddress(Addr a) const
Determine the address of the block in which a lays.
bool inMissQueue(Addr addr, bool is_secure) const
Determine if address is in cache miss queue.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
bool samePage(Addr a, Addr b) const
Determine if addresses are on the same page.
bool inCache(Addr addr, bool is_secure) const
void probeNotify(const PacketPtr &pkt, bool miss)
Process a notification event from the ProbeListener.
const T * getConstPtr() const
Addr pageIthBlockAddress(Addr page, uint32_t i) const
Build the address of the i-th block inside the page.
bool isSecure(ThreadContext *tc)
#define panic(...)
This implements a cprintf based panic() function.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17