49 #ifndef __MEM_CACHE_PREFETCH_BASE_HH__ 50 #define __MEM_CACHE_PREFETCH_BASE_HH__ 54 #include "arch/isa_traits.hh" 65 struct BasePrefetcherParams;
73 const std::string &
name,
bool _isFill =
false,
203 template <
typename T>
207 if (data ==
nullptr) {
208 panic(
"PrefetchInfo::get called with a request with no data.");
212 return betoh(*(T*)data);
215 return letoh(*(T*)data);
218 panic(
"Illegal byte order in PrefetchInfo::get()\n");
229 return this->getAddr() == pfi.
getAddr() &&
387 #endif //__MEM_CACHE_PREFETCH_BASE_HH__ #define panic(...)
This implements a cprintf based panic() function.
BasePrefetcher(const BasePrefetcherParams *p)
const bool onWrite
Consult prefetcher on reads?
bool sameAddr(PrefetchInfo const &pfi) const
Check for equality.
const bool onInst
Consult prefetcher on instruction accesses?
Addr pageIthBlockAddress(Addr page, uint32_t i) const
Build the address of the i-th block inside the page.
Addr blockIndex(Addr a) const
Determine the address of a at block granularity.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
bool inCache(Addr addr, bool is_secure) const
Determine if address is in cache.
std::vector< PrefetchListener * > listeners
bool isCacheMiss() const
Check if this event comes from a cache miss.
BaseCache * cache
Pointr to the parent cache.
uint64_t usefulPrefetches
Total prefetches that has been useful.
const bool onMiss
Only consult prefetcher on cache misses?
bool isSecure() const
Returns true if the address targets the secure memory space.
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
unsigned int getSize() const
Gets the size of the request triggering this event.
const bool prefetchOnAccess
Prefetch on every access, not just misses.
unsigned lBlkSize
log_2(block size of the parent cache).
BaseTLB * tlb
Registered tlb for address translations.
const MasterID masterId
Request id for prefetches.
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
void addTLB(BaseTLB *tlb)
Add a BaseTLB object to be used whenever a translation is needed.
uint64_t issuedPrefetches
Total prefetches issued.
Addr getAddr() const
Obtains the address value of this Prefetcher address.
bool isWrite() const
Checks if the request that caused this prefetch event was a write request.
void addEventProbe(SimObject *obj, const char *name)
Add a SimObject and a probe name to listen events from.
Class containing the information needed by the prefetch to train and generate new prefetch requests...
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i.e the notify method on specific type).
virtual ~BasePrefetcher()
MasterID masterId
The requestor ID that generated this address.
uint64_t Tick
Tick count type.
Addr getPC() const
Returns the program counter that generated this request.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
bool validPC
Validity bit for the PC of this address.
bool cacheMiss
Whether this event comes from a cache miss.
void regStats() override
Register local statistics.
ClockedObject declaration and implementation.
const bool onRead
Consult prefetcher on reads?
void notify(const PacketPtr &pkt) override
bool secure
Whether this address targets the secure memory space.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool write
Whether this event comes from a write request.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
virtual void notifyFill(const PacketPtr &pkt)
Notify prefetcher of cache fill.
Addr pageOffset(Addr a) const
Determine the page-offset of a.
bool observeAccess(const PacketPtr &pkt, bool miss) const
Determine if this access should be observed.
Declaration of the Packet class.
Addr pageAddress(Addr a) const
Determine the address of the page in which a lays.
Addr pc
The program counter that generated this address.
bool inMissQueue(Addr addr, bool is_secure) const
Determine if address is in cache miss queue.
const bool useVirtualAddresses
Use Virtual Addresses for prefetching.
unsigned int size
Size in bytes of the request triggering this event.
Addr address
The address used to train and generate prefetches.
virtual void setCache(BaseCache *_cache)
bool samePage(Addr a, Addr b) const
Determine if addresses are on the same page.
PrefetchListener(BasePrefetcher &_parent, ProbeManager *pm, const std::string &name, bool _isFill=false, bool _miss=false)
Addr blockAddress(Addr a) const
Determine the address of the block in which a lays.
const bool onData
Consult prefetcher on data accesses?
Addr getPaddr() const
Gets the physical address of the request.
unsigned blkSize
The block size of the parent cache.
virtual Tick nextPrefetchReadyTime() const =0
Addr paddress
Physical address, needed because address can be virtual.
void regProbeListeners() override
Register probe points for this object.
uint8_t * data
Pointer to the associated request data.
bool hasBeenPrefetched(Addr addr, bool is_secure) const
virtual PacketPtr getPacket()=0
Abstract superclass for simulation objects.
void probeNotify(const PacketPtr &pkt, bool miss)
Process a notification event from the ProbeListener.
MasterID getMasterId() const
Gets the requestor ID that generated this address.
bool hasPC() const
Returns true if the associated program counter is valid.