Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/8781

Change subject: mem-cache: Fix bug generated by 8282
......................................................................

mem-cache: Fix bug generated by 8282

Merge 8282 generated a bug in tagsInUse and refCount calculation.

Change-Id: I079e327a0a26a7968f2ed8e433dd6e790c80998b
---
M src/mem/cache/blk.hh
M src/mem/cache/tags/base_set_assoc.hh
2 files changed, 4 insertions(+), 2 deletions(-)



diff --git a/src/mem/cache/blk.hh b/src/mem/cache/blk.hh
index 44691c1..c2edc1a 100644
--- a/src/mem/cache/blk.hh
+++ b/src/mem/cache/blk.hh
@@ -212,6 +212,7 @@
     {
         status = 0;
         isTouched = false;
+        refCount = 0;
         lockList.clear();
     }

diff --git a/src/mem/cache/tags/base_set_assoc.hh b/src/mem/cache/tags/base_set_assoc.hh
index 21a250e..44f68d5 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -239,8 +239,6 @@
          uint32_t task_id = pkt->req->taskId();

          if (!blk->isTouched) {
-             tagsInUse++;
-             blk->isTouched = true;
              if (!warmedUp && tagsInUse.value() >= warmupBound) {
                  warmedUp = true;
                  warmupCycle = curTick();
@@ -260,6 +258,9 @@
              blk->invalidate();
          }

+         // Previous block, if existed, has been removed, and now we have
+         // to insert the new one and mark it as touched
+         tagsInUse++;
          blk->isTouched = true;

// Set tag for new block. Caller is responsible for setting status.

--
To view, visit https://gem5-review.googlesource.com/8781
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I079e327a0a26a7968f2ed8e433dd6e790c80998b
Gerrit-Change-Number: 8781
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to