Add invalidation function to StrideEntry so that every
entry can be invalidated appropriately.
Change-Id: I38c42b7d7c93d839f797d116f1d2c88572123c0e
Signed-off-by: Daniel <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/14359
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
#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),
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;
}
}
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;