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

Change subject: mem-cache: Move insertBlock functionality in FALRU
......................................................................

mem-cache: Move insertBlock functionality in FALRU

Block insertion is being done in the getCandidates function, while the
insertBlock function does not do anything.

Change-Id: Iadab9c1ea61519214f66fa24c4b91c4fc95604c0
---
M src/mem/cache/tags/fa_lru.cc
1 file changed, 20 insertions(+), 17 deletions(-)



diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc
index 58e91cf..8fcc947 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -247,12 +247,26 @@
 {
     ReplacementCandidates cands;

-    FALRUBlk * blk = tail;
-    assert(blk->inCache == 0);
-    moveToHead(blk);
-    tagHash.erase(blk->tag);
-    tagHash[blkAlign(addr)] = blk;
-    if (blk->isValid()) {
+    // FALRU is a specialization that does not use the ReplacementPolicy
+    // classes to make decisions regarding which block to evict
+    cands.push_back(tail);
+
+    return cands;
+}
+
+void
+FALRU::insertBlock(PacketPtr pkt, CacheBlk *blk)
+{
+    FALRUBlk* faBlk = (FALRUBlk*)blk;
+
+    assert(faBlk->inCache == 0);
+
+    moveToHead(faBlk);
+
+    tagHash.erase(faBlk->tag);
+    tagHash[blkAlign(pkt->getAddr())] = faBlk;
+
+    if (faBlk->isValid()) {
         replacements[0]++;
     } else {
         tagsInUse++;
@@ -262,17 +276,6 @@
         }
     }
     //assert(check());
-
-    // FALRU is a specialization that does not use the ReplacementPolicy
-    // classes to make decisions regarding which block to evict
-    cands.push_back(blk);
-
-    return cands;
-}
-
-void
-FALRU::insertBlock(PacketPtr pkt, CacheBlk *blk)
-{
 }

 void

--
To view, visit https://gem5-review.googlesource.com/8882
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: Iadab9c1ea61519214f66fa24c4b91c4fc95604c0
Gerrit-Change-Number: 8882
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