mem-cache: AMPM Prefetcher fails when restoring from a checkpoint
authorJavier Bueno <javier.bueno@metempsy.com>
Tue, 2 Apr 2019 21:34:20 +0000 (23:34 +0200)
committerJavier Bueno Hedo <javier.bueno@metempsy.com>
Thu, 4 Apr 2019 12:13:14 +0000 (12:13 +0000)
The preriodic event triggers an assertion due to an incorrect tick value to
schedule when restoring from a checkpoint.

Change-Id: I9454dd0c97d5a098f8a409886e63f7a7e990947c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17732
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/prefetch/access_map_pattern_matching.cc
src/mem/cache/prefetch/access_map_pattern_matching.hh

index df2a9f7ec0f6493e2105b0cb82c51483321d8c79..731d6069cad2801fcbf8b3f652e029f6b27049c5 100644 (file)
@@ -57,9 +57,12 @@ AccessMapPatternMatching::AccessMapPatternMatching(
 {
     fatal_if(!isPowerOf2(hotZoneSize),
         "the hot zone size must be a power of 2");
-    if (!epochEvent.scheduled()) {
-        schedule(epochEvent, clockEdge(epochCycles));
-    }
+}
+
+void
+AccessMapPatternMatching::startup()
+{
+    schedule(epochEvent, clockEdge(epochCycles));
 }
 
 void
@@ -153,6 +156,7 @@ AccessMapPatternMatching::calculatePrefetch(
     std::vector<QueuedPrefetcher::AddrPriority> &addresses)
 {
     assert(addresses.empty());
+
     bool is_secure = pfi.isSecure();
     Addr am_addr = pfi.getAddr() / hotZoneSize;
     Addr current_block = (pfi.getAddr() % hotZoneSize) / blkSize;
index 0968e6475444e383deed1159238cea6ee48e4f78..397bc788a937e05c7e1c77e9ae430c8d1a8f6552 100644 (file)
@@ -180,6 +180,7 @@ class AccessMapPatternMatching : public ClockedObject
     AccessMapPatternMatching(const AccessMapPatternMatchingParams* p);
     ~AccessMapPatternMatching()
     {}
+    void startup() override;
     void calculatePrefetch(const BasePrefetcher::PrefetchInfo &pfi,
         std::vector<QueuedPrefetcher::AddrPriority> &addresses);
 };