mem-cache: allow prefetchers to emit page crossing references
authorJavier Bueno <javier.bueno@metempsy.com>
Thu, 29 Nov 2018 15:35:16 +0000 (16:35 +0100)
committerJavier Bueno Hedo <javier.bueno@metempsy.com>
Wed, 16 Jan 2019 16:03:04 +0000 (16:03 +0000)
QueuedPrefetcher takes the responsability to check for page
crossing references.

Change-Id: I0ae6bf8be465118990d9ea1cac0da8f70e69aeb1
Reviewed-on: https://gem5-review.googlesource.com/c/14735
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/prefetch/queued.cc
src/mem/cache/prefetch/stride.cc
src/mem/cache/prefetch/tagged.cc

index f48ea185d14a217e338499ec70d14fd18a66f7e4..bce6fbb9752493130cdef12714770d2c811dd944 100644 (file)
@@ -93,14 +93,20 @@ QueuedPrefetcher::notify(const PacketPtr &pkt, const PrefetchInfo &pfi)
         // Block align prefetch address
         addr_prio.first = blockAddress(addr_prio.first);
 
-        PrefetchInfo new_pfi(pfi,addr_prio.first);
+        if (samePage(pfi.getAddr(), addr_prio.first)) {
+            PrefetchInfo new_pfi(pfi,addr_prio.first);
 
-        pfIdentified++;
-        DPRINTF(HWPrefetch, "Found a pf candidate addr: %#x, "
-                "inserting into prefetch queue.\n", new_pfi.getAddr());
+            pfIdentified++;
+            DPRINTF(HWPrefetch, "Found a pf candidate addr: %#x, "
+                    "inserting into prefetch queue.\n", new_pfi.getAddr());
 
-        // Create and insert the request
-        insert(pkt, new_pfi, addr_prio.second);
+            // Create and insert the request
+            insert(pkt, new_pfi, addr_prio.second);
+        } else {
+            // Record the number of page crossing prefetches generate
+            pfSpanPage += 1;
+            DPRINTF(HWPrefetch, "Ignoring page crossing prefetch.\n");
+        }
     }
 }
 
index 5d009014e55665bb0bb304d59ba7d930311f6b06..caddc7528baa11b17e396b758b9d414b8aebefdb 100644 (file)
@@ -195,15 +195,7 @@ StridePrefetcher::calculatePrefetch(const PrefetchInfo &pfi,
             }
 
             Addr new_addr = pf_addr + d * prefetch_stride;
-            if (samePage(pf_addr, new_addr)) {
-                DPRINTF(HWPrefetch, "Queuing prefetch to %#x.\n", new_addr);
-                addresses.push_back(AddrPriority(new_addr, 0));
-            } else {
-                // Record the number of page crossing prefetches generated
-                pfSpanPage += degree - d + 1;
-                DPRINTF(HWPrefetch, "Ignoring page crossing prefetch.\n");
-                return;
-            }
+            addresses.push_back(AddrPriority(new_addr, 0));
         }
     } else {
         // Miss in table
index a360cc6397bb093fa4a32c9fc212a93174732d12..1623817c280648cc19b5cb594c18f4193261d992 100644 (file)
@@ -51,13 +51,7 @@ TaggedPrefetcher::calculatePrefetch(const PrefetchInfo &pfi,
 
     for (int d = 1; d <= degree; d++) {
         Addr newAddr = blkAddr + d*(blkSize);
-        if (!samePage(blkAddr, newAddr)) {
-            // Count number of unissued prefetches due to page crossing
-            pfSpanPage += degree - d + 1;
-            return;
-        } else {
-            addresses.push_back(AddrPriority(newAddr,0));
-        }
+        addresses.push_back(AddrPriority(newAddr,0));
     }
 }