summaryrefslogtreecommitdiff
path: root/src/mem/cache/cache.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-09-04 13:13:58 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2015-09-04 13:13:58 -0400
commit76088fb9ca0ecb747e84bdfc825cd67b189b502d (patch)
treef7745dd3e0a87202385caf92cd7a26fdbf980a74 /src/mem/cache/cache.cc
parent8e74d5484f0b207c10a585ea3270430f398cfa8a (diff)
downloadgem5-76088fb9ca0ecb747e84bdfc825cd67b189b502d.tar.xz
mem: Tidy up the snoop state-transition logic
Remove broken and unused option to pass dirty data on non-exclusive snoops. Also beef up the comments a bit.
Diffstat (limited to 'src/mem/cache/cache.cc')
-rw-r--r--src/mem/cache/cache.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index 81c2d35e1..3060c3e77 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1828,17 +1828,13 @@ Cache::handleSnoop(PacketPtr pkt, CacheBlk *blk, bool is_timing,
}
if (!pkt->req->isUncacheable() && pkt->isRead() && !invalidate) {
+ // reading non-exclusive shared data, note that we retain
+ // the block in owned state if it is dirty, with the response
+ // taken care of below, and otherwhise simply downgrade to
+ // shared
assert(!needs_exclusive);
pkt->assertShared();
- int bits_to_clear = BlkWritable;
- const bool haveOwnershipState = true; // for now
- if (!haveOwnershipState) {
- // if we don't support pure ownership (dirty && !writable),
- // have to clear dirty bit here, assume memory snarfs data
- // on cache-to-cache xfer
- bits_to_clear |= BlkDirty;
- }
- blk->status &= ~bits_to_clear;
+ blk->status &= ~BlkWritable;
}
if (respond) {
@@ -1850,9 +1846,10 @@ Cache::handleSnoop(PacketPtr pkt, CacheBlk *blk, bool is_timing,
// will write it back at a later point
pkt->assertMemInhibit();
if (have_exclusive) {
- // in the case of an uncacheable request there is no need
- // to set the exclusive flag, but since the recipient does
- // not care there is no harm in doing so
+ // in the case of an uncacheable request there is no point
+ // in setting the exclusive flag, but since the recipient
+ // does not care there is no harm in doing so, in any case
+ // it is just a hint
pkt->setSupplyExclusive();
}
if (is_timing) {