changeset 3b30e9d30e10 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=3b30e9d30e10
description:
mem: Filter cache snoops based on address ranges
This patch adds a filter to the cache to drop snoop requests that are
not for a range covered by the cache. This fixes an issue observed
when multiple caches are placed in parallel, covering different
address ranges. Without this patch, all the caches will forward the
snoop upwards, when only one should do so.
diffstat:
src/mem/cache/cache_impl.hh | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diffs (28 lines):
diff -r 06a33d872798 -r 3b30e9d30e10 src/mem/cache/cache_impl.hh
--- a/src/mem/cache/cache_impl.hh Tue Feb 18 05:50:53 2014 -0500
+++ b/src/mem/cache/cache_impl.hh Tue Feb 18 05:50:58 2014 -0500
@@ -1475,10 +1475,23 @@
// Snoops shouldn't happen when bypassing caches
assert(!system->bypassCaches());
+ // check if the packet is for an address range covered by this
+ // cache, partly to not waste time looking for it, but also to
+ // ensure that we only forward the snoop upwards if it is within
+ // our address ranges
+ bool in_range = false;
+ for (AddrRangeList::const_iterator r = addrRanges.begin();
+ r != addrRanges.end(); ++r) {
+ if (r->contains(pkt->getAddr())) {
+ in_range = true;
+ break;
+ }
+ }
+
// Note that some deferred snoops don't have requests, since the
// original access may have already completed
if ((pkt->req && pkt->req->isUncacheable()) ||
- pkt->cmd == MemCmd::Writeback) {
+ pkt->cmd == MemCmd::Writeback || !in_range) {
//Can't get a hit on an uncacheable address
//Revisit this for multi level coherence
return;
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev