summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags/fa_lru.cc
diff options
context:
space:
mode:
authorDavid Guillen <david.guillen@arm.com>2015-05-05 03:22:21 -0400
committerDavid Guillen <david.guillen@arm.com>2015-05-05 03:22:21 -0400
commit5287945a8bb98476a9326c5d9c51491cdc7212f2 (patch)
treec2263df9baa298e151c2fc68c22b9e3439f07edf /src/mem/cache/tags/fa_lru.cc
parentd0d933facc9085727c12f53de76a2cb879ded4c8 (diff)
downloadgem5-5287945a8bb98476a9326c5d9c51491cdc7212f2.tar.xz
mem: Remove templates in cache model
This patch changes the cache implementation to rely on virtual methods rather than using the replacement policy as a template argument. There is no impact on the simulation performance, and overall the changes make it easier to modify (and subclass) the cache and/or replacement policy.
Diffstat (limited to 'src/mem/cache/tags/fa_lru.cc')
-rw-r--r--src/mem/cache/tags/fa_lru.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc
index ffe2cbf25..8d4f75382 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -161,13 +161,19 @@ FALRU::hashLookup(Addr addr) const
}
void
-FALRU::invalidate(FALRU::BlkType *blk)
+FALRU::invalidate(CacheBlk *blk)
{
assert(blk);
tagsInUse--;
}
-FALRUBlk*
+CacheBlk*
+FALRU::accessBlock(Addr addr, bool is_secure, Cycles &lat, int context_src)
+{
+ return accessBlock(addr, is_secure, lat, context_src, 0);
+}
+
+CacheBlk*
FALRU::accessBlock(Addr addr, bool is_secure, Cycles &lat, int context_src,
int *inCache)
{
@@ -206,7 +212,7 @@ FALRU::accessBlock(Addr addr, bool is_secure, Cycles &lat, int context_src,
}
-FALRUBlk*
+CacheBlk*
FALRU::findBlock(Addr addr, bool is_secure) const
{
Addr blkAddr = blkAlign(addr);
@@ -220,7 +226,7 @@ FALRU::findBlock(Addr addr, bool is_secure) const
return blk;
}
-FALRUBlk*
+CacheBlk*
FALRU::findVictim(Addr addr)
{
FALRUBlk * blk = tail;
@@ -243,7 +249,7 @@ FALRU::findVictim(Addr addr)
}
void
-FALRU::insertBlock(PacketPtr pkt, FALRU::BlkType *blk)
+FALRU::insertBlock(PacketPtr pkt, CacheBlk *blk)
{
}