changeset a029d2119487 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=a029d2119487
description:
Cache: restructure code that actually isn't a loop
diffstat:
src/mem/cache/cache_impl.hh | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (39 lines):
diff -r 2f3a286392a6 -r a029d2119487 src/mem/cache/cache_impl.hh
--- a/src/mem/cache/cache_impl.hh Thu May 10 18:04:27 2012 -0500
+++ b/src/mem/cache/cache_impl.hh Thu May 10 18:04:27 2012 -0500
@@ -1294,8 +1294,10 @@
pkt->getAddr());
//Look through writebacks for any non-uncachable writes, use that
- for (int i = 0; i < writebacks.size(); i++) {
- mshr = writebacks[i];
+ if (writebacks.size()) {
+ // We should only ever find a single match
+ assert(writebacks.size() == 1);
+ mshr = writebacks[0];
assert(!mshr->isUncacheable());
assert(mshr->getNumTargets() == 1);
PacketPtr wb_pkt = mshr->getTarget()->pkt;
@@ -1321,16 +1323,14 @@
markInService(mshr);
delete wb_pkt;
}
-
- // If this was a shared writeback, there may still be
- // other shared copies above that require invalidation.
- // We could be more selective and return here if the
- // request is non-exclusive or if the writeback is
- // exclusive.
- break;
- }
+ } // writebacks.size()
}
+ // If this was a shared writeback, there may still be
+ // other shared copies above that require invalidation.
+ // We could be more selective and return here if the
+ // request is non-exclusive or if the writeback is
+ // exclusive.
handleSnoop(pkt, blk, true, false, false);
}
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev