summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorJavier Bueno <javier.bueno@metempsy.com>2018-11-29 16:35:16 +0100
committerJavier Bueno Hedo <javier.bueno@metempsy.com>2019-01-16 16:03:04 +0000
commitafa039d0c06874dda8ccbfc6b5eb2df9c87157a2 (patch)
treea401d0f8e4814910c2d721c6039ebe4990018bce /src/mem/cache
parent38f87dab68c809edf4cd95650c833fe82e4b800b (diff)
downloadgem5-afa039d0c06874dda8ccbfc6b5eb2df9c87157a2.tar.xz
mem-cache: allow prefetchers to emit page crossing references
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>
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/prefetch/queued.cc18
-rw-r--r--src/mem/cache/prefetch/stride.cc10
-rw-r--r--src/mem/cache/prefetch/tagged.cc8
3 files changed, 14 insertions, 22 deletions
diff --git a/src/mem/cache/prefetch/queued.cc b/src/mem/cache/prefetch/queued.cc
index f48ea185d..bce6fbb97 100644
--- a/src/mem/cache/prefetch/queued.cc
+++ b/src/mem/cache/prefetch/queued.cc
@@ -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");
+ }
}
}
diff --git a/src/mem/cache/prefetch/stride.cc b/src/mem/cache/prefetch/stride.cc
index 5d009014e..caddc7528 100644
--- a/src/mem/cache/prefetch/stride.cc
+++ b/src/mem/cache/prefetch/stride.cc
@@ -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
diff --git a/src/mem/cache/prefetch/tagged.cc b/src/mem/cache/prefetch/tagged.cc
index a360cc639..1623817c2 100644
--- a/src/mem/cache/prefetch/tagged.cc
+++ b/src/mem/cache/prefetch/tagged.cc
@@ -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));
}
}