46#ifndef __MEM_CACHE_PREFETCH_BASE_HH__
47#define __MEM_CACHE_PREFETCH_BASE_HH__
65struct BasePrefetcherParams;
78 const std::string &
name,
bool _isFill =
false,
95 const std::string &
name)
222 template <
typename T>
224 get(ByteOrder endian)
const
226 if (
data ==
nullptr) {
227 panic(
"PrefetchInfo::get called with a request with no data.");
233 case ByteOrder::little:
237 panic(
"Illegal byte order in PrefetchInfo::get()\n");
380 Base(
const BasePrefetcherParams &
p);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Information provided to probes on a cache event.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i....
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
Abstract superclass for simulation objects.
PrefetchEvictListener(Base &_parent, ProbeManager *pm, const std::string &name)
void notify(const EvictionInfo &info) override
Class containing the information needed by the prefetch to train and generate new prefetch requests.
bool validPC
Validity bit for the PC of this address.
PrefetchInfo(PacketPtr pkt, Addr addr, bool miss)
Constructs a PrefetchInfo using a PacketPtr.
Addr getPC() const
Returns the program counter that generated this request.
bool isSecure() const
Returns true if the address targets the secure memory space.
unsigned int getSize() const
Gets the size of the request triggering this event.
Addr getPaddr() const
Gets the physical address of the request.
bool write
Whether this event comes from a write request.
bool isWrite() const
Checks if the request that caused this prefetch event was a write request.
bool isCacheMiss() const
Check if this event comes from a cache miss.
RequestorID requestorId
The requestor ID that generated this address.
Addr address
The address used to train and generate prefetches.
Addr getAddr() const
Obtains the address value of this Prefetcher address.
bool cacheMiss
Whether this event comes from a cache miss.
Addr paddress
Physical address, needed because address can be virtual.
T get(ByteOrder endian) const
Gets the associated data of the request triggering the event.
bool hasPC() const
Returns true if the associated program counter is valid.
Addr pc
The program counter that generated this address.
unsigned int size
Size in bytes of the request triggering this event.
uint8_t * data
Pointer to the associated request data.
RequestorID getRequestorId() const
Gets the requestor ID that generated this address.
bool secure
Whether this address targets the secure memory space.
bool sameAddr(PrefetchInfo const &pfi) const
Check for equality.
void notify(const CacheAccessProbeArg &arg) override
PrefetchListener(Base &_parent, ProbeManager *pm, const std::string &name, bool _isFill=false, bool _miss=false)
Base(const BasePrefetcherParams &p)
const bool useVirtualAddresses
Use Virtual Addresses for prefetching.
const bool prefetchOnAccess
Prefetch on every access, not just misses.
const bool onRead
Consult prefetcher on reads?
virtual void notifyFill(const CacheAccessProbeArg &acc)
Notify prefetcher of cache fill.
unsigned blkSize
The block size of the parent cache.
uint64_t issuedPrefetches
Total prefetches issued.
void incrDemandMhsrMisses()
const RequestorID requestorId
Request id for prefetches.
void addMMU(BaseMMU *mmu)
Add a BaseMMU object to be used whenever a translation is needed.
void regProbeListeners() override
Register probe points for this object.
Addr pageAddress(Addr a) const
Determine the address of the page in which a lays.
ProbeManager * probeManager
Pointer to the parent cache's probe manager.
virtual void notifyEvict(const EvictionInfo &info)
Notify prefetcher of cache eviction.
const bool onInst
Consult prefetcher on instruction accesses?
uint64_t usefulPrefetches
Total prefetches that has been useful.
gem5::prefetch::Base::StatGroup prefetchStats
virtual void setParentInfo(System *sys, ProbeManager *pm, unsigned blk_size)
virtual void notify(const CacheAccessProbeArg &acc, const PrefetchInfo &pfi)=0
Notify prefetcher of cache access (may be any access or just misses, depending on cache parameters....
Addr pageIthBlockAddress(Addr page, uint32_t i) const
Build the address of the i-th block inside the page.
Addr pageOffset(Addr a) const
Determine the page-offset of a
std::vector< ProbeListener * > listeners
BaseMMU * mmu
Registered mmu for address translations.
virtual PacketPtr getPacket()=0
const bool onData
Consult prefetcher on data accesses?
const bool prefetchOnPfHit
Prefetch on hit on prefetched lines.
System * system
Pointer to the parent system.
const bool onWrite
Consult prefetcher on reads?
unsigned lBlkSize
log_2(block size of the parent cache).
bool observeAccess(const PacketPtr &pkt, bool miss, bool prefetched) const
Determine if this access should be observed.
Addr blockIndex(Addr a) const
Determine the address of a at block granularity.
Addr blockAddress(Addr a) const
Determine the address of the block in which a lays.
void probeNotify(const CacheAccessProbeArg &acc, bool miss)
Process a notification event from the ProbeListener.
const bool onMiss
Only consult prefetcher on cache misses?
bool samePage(Addr a, Addr b) const
Determine if addresses are on the same page.
virtual Tick nextPrefetchReadyTime() const =0
void addEventProbe(SimObject *obj, const char *name)
Add a SimObject and a probe name to listen events from.
This is a simple scalar statistic, like a counter.
ClockedObject declaration and implementation.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
Declaration of the Packet class.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
Declaration of Statistics objects.
A data contents update is composed of the updated block's address, the old contents,...
statistics::Formula accuracy
statistics::Scalar pfUsefulButMiss
The number of times there is a hit on prefetch but cache block is not in an usable state.
statistics::Scalar pfIssued
statistics::Scalar pfUseful
The number of times a HW-prefetch is useful.
statistics::Scalar pfHitInWB
The number of times a HW-prefetch hits in the Write Buffer (WB).
statistics::Scalar pfHitInMSHR
The number of times a HW-prefetch hits in a MSHR.
statistics::Formula pfLate
The number of times a HW-prefetch is late (hit in cache, MSHR, WB).
statistics::Scalar pfUnused
The number of times a HW-prefetched block is evicted w/o reference.
statistics::Scalar pfHitInCache
The number of times a HW-prefetch hits in cache.
statistics::Scalar demandMshrMisses
StatGroup(statistics::Group *parent)
statistics::Formula coverage