mem-cache: add option to send pf on hit on pf
From the point of view of the prefetchers, a hit on a prefetched block should be considered the same as a miss: a new prefetch should be generated. Change-Id: If865324502b81cfd3ae8c009666d3f498092b90f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47201 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
2
src/mem/cache/Cache.py
vendored
2
src/mem/cache/Cache.py
vendored
@@ -99,6 +99,8 @@ class BaseCache(ClockedObject):
|
||||
prefetcher = Param.BasePrefetcher(NULL,"Prefetcher attached to cache")
|
||||
prefetch_on_access = Param.Bool(False,
|
||||
"Notify the hardware prefetcher on every access (not just misses)")
|
||||
prefetch_on_pf_hit = Param.Bool(False,
|
||||
"Notify the hardware prefetcher on hit on prefetched lines")
|
||||
|
||||
tags = Param.BaseTags(BaseSetAssoc(), "Tag store")
|
||||
replacement_policy = Param.BaseReplacementPolicy(LRURP(),
|
||||
|
||||
2
src/mem/cache/prefetch/Prefetcher.py
vendored
2
src/mem/cache/prefetch/Prefetcher.py
vendored
@@ -77,6 +77,8 @@ class BasePrefetcher(ClockedObject):
|
||||
on_inst = Param.Bool(True, "Notify prefetcher on instruction accesses")
|
||||
prefetch_on_access = Param.Bool(Parent.prefetch_on_access,
|
||||
"Notify the hardware prefetcher on every access (not just misses)")
|
||||
prefetch_on_pf_hit = Param.Bool(Parent.prefetch_on_pf_hit,
|
||||
"Notify the hardware prefetcher on hit on prefetched lines")
|
||||
use_virtual_addresses = Param.Bool(False,
|
||||
"Use virtual addresses for prefetching")
|
||||
|
||||
|
||||
8
src/mem/cache/prefetch/base.cc
vendored
8
src/mem/cache/prefetch/base.cc
vendored
@@ -100,6 +100,7 @@ Base::Base(const BasePrefetcherParams &p)
|
||||
requestorId(p.sys->getRequestorId(this)),
|
||||
pageBytes(p.sys->getPageBytes()),
|
||||
prefetchOnAccess(p.prefetch_on_access),
|
||||
prefetchOnPfHit(p.prefetch_on_pf_hit),
|
||||
useVirtualAddresses(p.use_virtual_addresses),
|
||||
prefetchStats(this), issuedPrefetches(0),
|
||||
usefulPrefetches(0), tlb(nullptr)
|
||||
@@ -153,7 +154,12 @@ Base::observeAccess(const PacketPtr &pkt, bool miss) const
|
||||
bool read = pkt->isRead();
|
||||
bool inv = pkt->isInvalidate();
|
||||
|
||||
if (!miss && !prefetchOnAccess) return false;
|
||||
if (!miss) {
|
||||
if (prefetchOnPfHit)
|
||||
return hasBeenPrefetched(pkt->getAddr(), pkt->isSecure());
|
||||
if (!prefetchOnAccess)
|
||||
return false;
|
||||
}
|
||||
if (pkt->req->isUncacheable()) return false;
|
||||
if (fetch && !onInst) return false;
|
||||
if (!fetch && !onData) return false;
|
||||
|
||||
3
src/mem/cache/prefetch/base.hh
vendored
3
src/mem/cache/prefetch/base.hh
vendored
@@ -295,6 +295,9 @@ class Base : public ClockedObject
|
||||
/** Prefetch on every access, not just misses */
|
||||
const bool prefetchOnAccess;
|
||||
|
||||
/** Prefetch on hit on prefetched lines */
|
||||
const bool prefetchOnPfHit;
|
||||
|
||||
/** Use Virtual Addresses for prefetching */
|
||||
const bool useVirtualAddresses;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user