remove the totally obsolete split cache
[gem5.git] / src / mem / cache / tags / fa_lru.cc
index 66d91b35b62a69c1bc9b8d3adc036ef99050157a..607e89a75093f0bc4de2810b33dec61f8db8993a 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "mem/cache/tags/fa_lru.hh"
 #include "base/intmath.hh"
+#include "base/misc.hh"
 
 using namespace std;
 
@@ -144,7 +145,7 @@ FALRU::hashLookup(Addr addr) const
 }
 
 bool
-FALRU::probe(int asid, Addr addr) const
+FALRU::probe(Addr addr) const
 {
     Addr blkAddr = blkAlign(addr);
     FALRUBlk* blk = hashLookup(blkAddr);
@@ -152,12 +153,9 @@ FALRU::probe(int asid, Addr addr) const
 }
 
 void
-FALRU::invalidateBlk(int asid, Addr addr)
+FALRU::invalidateBlk(FALRU::BlkType *blk)
 {
-    Addr blkAddr = blkAlign(addr);
-    FALRUBlk* blk = (*tagHash.find(blkAddr)).second;
     if (blk) {
-        assert(blk->tag == blkAddr);
         blk->status = 0;
         blk->isTouched = false;
         tagsInUse--;
@@ -165,7 +163,7 @@ FALRU::invalidateBlk(int asid, Addr addr)
 }
 
 FALRUBlk*
-FALRU::findBlock(Addr addr, int asid, int &lat, int *inCache)
+FALRU::findBlock(Addr addr, int &lat, int *inCache)
 {
     accesses++;
     int tmp_in_cache = 0;
@@ -201,47 +199,9 @@ FALRU::findBlock(Addr addr, int asid, int &lat, int *inCache)
     return blk;
 }
 
-FALRUBlk*
-FALRU::findBlock(Packet * &pkt, int &lat, int *inCache)
-{
-    Addr addr = pkt->paddr;
-
-    accesses++;
-    int tmp_in_cache = 0;
-    Addr blkAddr = blkAlign(addr);
-    FALRUBlk* blk = hashLookup(blkAddr);
-
-    if (blk && blk->isValid()) {
-        assert(blk->tag == blkAddr);
-        tmp_in_cache = blk->inCache;
-        for (int i = 0; i < numCaches; i++) {
-            if (1<<i & blk->inCache) {
-                hits[i]++;
-            } else {
-                misses[i]++;
-            }
-        }
-        hits[numCaches]++;
-        if (blk != head){
-            moveToHead(blk);
-        }
-    } else {
-        blk = NULL;
-        for (int i = 0; i < numCaches+1; ++i) {
-            misses[i]++;
-        }
-    }
-    if (inCache) {
-        *inCache = tmp_in_cache;
-    }
-
-    lat = hitLatency;
-    //assert(check());
-    return blk;
-}
 
 FALRUBlk*
-FALRU::findBlock(Addr addr, int asid) const
+FALRU::findBlock(Addr addr) const
 {
     Addr blkAddr = blkAlign(addr);
     FALRUBlk* blk = hashLookup(blkAddr);
@@ -255,17 +215,15 @@ FALRU::findBlock(Addr addr, int asid) const
 }
 
 FALRUBlk*
-FALRU::findReplacement(Packet * &pkt, PacketList* &writebacks,
-                       BlkList &compress_blocks)
+FALRU::findReplacement(Addr addr, PacketList &writebacks)
 {
     FALRUBlk * blk = tail;
     assert(blk->inCache == 0);
     moveToHead(blk);
     tagHash.erase(blk->tag);
-    tagHash[blkAlign(pkt->paddr)] = blk;
+    tagHash[blkAlign(addr)] = blk;
     if (blk->isValid()) {
-        int thread_num = (blk->xc) ? blk->xc->getThreadNum() : 0;
-        replacements[thread_num]++;
+        replacements[0]++;
     } else {
         tagsInUse++;
         blk->isTouched = true;