mem: Add check for block status on WriteLineReq fill
authorAndreas Hansson <andreas.hansson@arm.com>
Fri, 25 Sep 2015 11:26:58 +0000 (07:26 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Fri, 25 Sep 2015 11:26:58 +0000 (07:26 -0400)
More checks to help with understanding of functionality.

src/mem/cache/cache.cc

index fe715fa6dfd0acd04c2a88f178f700583a9b9c65..71fbb18847f81281346c09f3029b1d43cb90151f 100644 (file)
@@ -1657,6 +1657,16 @@ Cache::handleFill(PacketPtr pkt, CacheBlk *blk, PacketList &writebacks)
         blk->status |= BlkSecure;
     blk->status |= BlkValid | BlkReadable;
 
+    // sanity check for whole-line writes, which should always be
+    // marked as writable as part of the fill, and then later marked
+    // dirty as part of satisfyCpuSideRequest
+    if (pkt->cmd == MemCmd::WriteLineReq) {
+        assert(!pkt->sharedAsserted());
+        // at the moment other caches do not respond to the
+        // invalidation requests corresponding to a whole-line write
+        assert(!pkt->memInhibitAsserted());
+    }
+
     if (!pkt->sharedAsserted()) {
         // we could get non-shared responses from memory (rather than
         // a cache) even in a read-only cache, note that we set this