summaryrefslogtreecommitdiff
path: root/src/mem/cache/prefetch/indirect_memory.hh
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2020-01-18 16:19:53 +0100
committerDaniel Carvalho <odanrc@yahoo.com.br>2020-01-21 08:07:05 +0000
commit519808c02f2d5d780bf09589d2e29803a5af1ade (patch)
treefd72cd991a2fbedf883fde2ceefc2f8bfc0fe009 /src/mem/cache/prefetch/indirect_memory.hh
parent7ac4607385f8490b2a12acaef73f2f31583160f0 (diff)
downloadgem5-519808c02f2d5d780bf09589d2e29803a5af1ade.tar.xz
mem-cache: Fix invalidation of prefetchers
Add an invalidation function to the AssociativeSet, so that entries can be properly invalidated by also invalidating their replacement data. Both setInvalid and reset have been merged into invalidate to indicate users that they are using an incorrect approach by generating compilation errors, and to match CacheBlk's naming convention. Change-Id: I568076a3b5adda8b1311d9498b086c0dab457a14 Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24529 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/mem/cache/prefetch/indirect_memory.hh')
-rw-r--r--src/mem/cache/prefetch/indirect_memory.hh17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mem/cache/prefetch/indirect_memory.hh b/src/mem/cache/prefetch/indirect_memory.hh
index f177c5c06..07f3cb5ca 100644
--- a/src/mem/cache/prefetch/indirect_memory.hh
+++ b/src/mem/cache/prefetch/indirect_memory.hh
@@ -101,7 +101,10 @@ class IndirectMemoryPrefetcher : public QueuedPrefetcher
increasedIndirectCounter(false)
{}
- void reset() override {
+ void
+ invalidate() override
+ {
+ TaggedEntry::invalidate();
address = 0;
secure = false;
streamCounter = 0;
@@ -136,16 +139,20 @@ class IndirectMemoryPrefetcher : public QueuedPrefetcher
IndirectPatternDetectorEntry(unsigned int num_addresses,
unsigned int num_shifts)
- : idx1(0), idx2(0), secondIndexSet(false), numMisses(0),
+ : TaggedEntry(), idx1(0), idx2(0), secondIndexSet(false),
+ numMisses(0),
baseAddr(num_addresses, std::vector<Addr>(num_shifts))
- {}
+ {
+ }
- void reset() override {
+ void
+ invalidate() override
+ {
+ TaggedEntry::invalidate();
idx1 = 0;
idx2 = 0;
secondIndexSet = false;
numMisses = 0;
- setInvalid();
}
};
/** Indirect Pattern Detector (IPD) table */