From 3b03eaab9ce2914054101745deb888710e9cde9c Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Thu, 3 Dec 2020 12:06:25 +0100 Subject: [PATCH] mem-cache: Fix update of useful prefetches The probe notification must be parsed on every hit, even if the prefetcher is set not to generate prefetches on accesses. This fixes the calculation of useful prefetches. Change-Id: Iff298f7bea11013f411f4ba39dba705fd81a0cd4 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38177 Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/mem/cache/prefetch/base.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mem/cache/prefetch/base.cc b/src/mem/cache/prefetch/base.cc index 28aaa627d..e3479920d 100644 --- a/src/mem/cache/prefetch/base.cc +++ b/src/mem/cache/prefetch/base.cc @@ -125,6 +125,7 @@ Base::observeAccess(const PacketPtr &pkt, bool miss) const bool read = pkt->isRead(); bool inv = pkt->isInvalidate(); + if (!miss && !prefetchOnAccess) return false; if (pkt->req->isUncacheable()) return false; if (fetch && !onInst) return false; if (!fetch && !onData) return false; @@ -236,10 +237,8 @@ Base::regProbeListeners() true)); listeners.push_back(new PrefetchListener(*this, pm, "Fill", true, false)); - if (prefetchOnAccess) { - listeners.push_back(new PrefetchListener(*this, pm, "Hit", false, - false)); - } + listeners.push_back(new PrefetchListener(*this, pm, "Hit", false, + false)); } } -- 2.30.2