Daniel Carvalho has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/14359 )
Change subject: mem-cache: Add invalidation function to StrideEntry
......................................................................
mem-cache: Add invalidation function to StrideEntry
Add invalidation function to StrideEntry so that every
entry can be invalidated appropriately.
Change-Id: I38c42b7d7c93d839f797d116f1d2c88572123c0e
Signed-off-by: Daniel <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/14359
Reviewed-by: Nikos Nikoleris <[email protected]>
Maintainer: Nikos Nikoleris <[email protected]>
---
M src/mem/cache/prefetch/stride.cc
M src/mem/cache/prefetch/stride.hh
2 files changed, 25 insertions(+), 4 deletions(-)
Approvals:
Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
diff --git a/src/mem/cache/prefetch/stride.cc
b/src/mem/cache/prefetch/stride.cc
index c09face..4520f12 100644
--- a/src/mem/cache/prefetch/stride.cc
+++ b/src/mem/cache/prefetch/stride.cc
@@ -57,6 +57,21 @@
#include "debug/HWPrefetch.hh"
#include "params/StridePrefetcher.hh"
+StridePrefetcher::StrideEntry::StrideEntry()
+{
+ invalidate();
+}
+
+void
+StridePrefetcher::StrideEntry::invalidate()
+{
+ instAddr = 0;
+ lastAddr = 0;
+ isSecure = false;
+ stride = 0;
+ confidence = 0;
+}
+
StridePrefetcher::StridePrefetcher(const StridePrefetcherParams *p)
: QueuedPrefetcher(p),
maxConf(p->max_conf),
@@ -182,10 +197,14 @@
is_secure ? "s" : "ns");
StrideEntry* entry = pcTable->findVictim(pc);
+
+ // Invalidate victim
+ entry->invalidate();
+
+ // Insert new entry's data
entry->instAddr = pc;
entry->lastAddr = pkt_addr;
entry->isSecure= is_secure;
- entry->stride = 0;
entry->confidence = startConf;
}
}
diff --git a/src/mem/cache/prefetch/stride.hh
b/src/mem/cache/prefetch/stride.hh
index ec22ca6..772c3a5 100644
--- a/src/mem/cache/prefetch/stride.hh
+++ b/src/mem/cache/prefetch/stride.hh
@@ -75,9 +75,11 @@
struct StrideEntry
{
- StrideEntry() : instAddr(0), lastAddr(0), isSecure(false),
stride(0),
- confidence(0)
- { }
+ /** Default constructor */
+ StrideEntry();
+
+ /** Invalidate the entry */
+ void invalidate();
Addr instAddr;
Addr lastAddr;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/14359
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I38c42b7d7c93d839f797d116f1d2c88572123c0e
Gerrit-Change-Number: 14359
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev