summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2019-12-12 15:49:36 +0000
committerNikos Nikoleris <nikos.nikoleris@arm.com>2020-01-07 09:42:01 +0000
commit2430be2edb0862a7598d0f8f3c8b4a5f77001df8 (patch)
tree0027a7ef52e6afcfe970e0f74ebee69bec22446d /src
parent96e8f2ed3c3e1cfa32677dcc32f2d0c263dd6be6 (diff)
downloadgem5-2430be2edb0862a7598d0f8f3c8b4a5f77001df8.tar.xz
mem-cache: Forward snoops when the cache is not responding
When the MSHR is handling a request that will make the block dirty the current cache commits respond. When that's not the case the cache should forward any snoops. This CL fixes MSHR::handleSnoop() to implement this behavior. Change-Id: I207e3ca4968fd9528fd4cdbfb3eb95f470b4744d Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23668 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Diffstat (limited to 'src')
-rw-r--r--src/mem/cache/mshr.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc
index 1b21546aa..00dbe900b 100644
--- a/src/mem/cache/mshr.cc
+++ b/src/mem/cache/mshr.cc
@@ -465,6 +465,10 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
return true;
}
+ // Start by determining if we will eventually respond or not,
+ // matching the conditions checked in Cache::handleSnoop
+ const bool will_respond = isPendingModified() && pkt->needsResponse() &&
+ !pkt->isClean();
if (isPendingModified() || pkt->isInvalidate()) {
// We need to save and replay the packet in two cases:
// 1. We're awaiting a writable copy (Modified or Exclusive),
@@ -474,11 +478,6 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
// to forward the snoop up the hierarchy after the current
// transaction completes.
- // Start by determining if we will eventually respond or not,
- // matching the conditions checked in Cache::handleSnoop
- bool will_respond = isPendingModified() && pkt->needsResponse() &&
- !pkt->isClean();
-
// The packet we are snooping may be deleted by the time we
// actually process the target, and we consequently need to
// save a copy here. Clear flags and also allocate new data as
@@ -535,7 +534,7 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
pkt->setHasSharers();
}
- return true;
+ return will_respond;
}
MSHR::TargetList