changeset 68da5ef4bb6f in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=68da5ef4bb6f
description:
        mem: Properly set cache block status fields on writebacks

        When a cacheline is written back to a lower-level cache,
        tags->insertBlock() sets various status parameters. However these
        status bits were cleared immediately after calling. This patch makes
        it so that these status fields are not cleared by moving them outside
        of the tags->insertBlock() call.

diffstat:

 src/mem/cache/cache_impl.hh          |  6 +++++-
 src/mem/cache/tags/base_set_assoc.hh |  5 ++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 6e6557085eb7 -r 68da5ef4bb6f src/mem/cache/cache_impl.hh
--- a/src/mem/cache/cache_impl.hh       Wed Aug 13 06:57:21 2014 -0400
+++ b/src/mem/cache/cache_impl.hh       Wed Aug 13 06:57:24 2014 -0400
@@ -336,7 +336,11 @@
                 return false;
             }
             tags->insertBlock(pkt, blk);
-            blk->status = BlkValid | BlkReadable;
+
+            blk->status = (BlkValid | BlkReadable);
+            if (pkt->isSecure()) {
+                blk->status |= BlkSecure;
+            }
         }
         std::memcpy(blk->data, pkt->getPtr<uint8_t>(), blkSize);
         blk->status |= BlkDirty;
diff -r 6e6557085eb7 -r 68da5ef4bb6f src/mem/cache/tags/base_set_assoc.hh
--- a/src/mem/cache/tags/base_set_assoc.hh      Wed Aug 13 06:57:21 2014 -0400
+++ b/src/mem/cache/tags/base_set_assoc.hh      Wed Aug 13 06:57:24 2014 -0400
@@ -247,7 +247,7 @@
          Addr addr = pkt->getAddr();
          MasterID master_id = pkt->req->masterId();
          uint32_t task_id = pkt->req->taskId();
-         bool is_secure = pkt->isSecure();
+
          if (!blk->isTouched) {
              tagsInUse++;
              blk->isTouched = true;
@@ -275,10 +275,9 @@
          }
 
          blk->isTouched = true;
+
          // Set tag for new block.  Caller is responsible for setting status.
          blk->tag = extractTag(addr);
-         if (is_secure)
-             blk->status |= BlkSecure;
 
          // deal with what we are bringing in
          assert(master_id < cache->system->maxMasters());
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to