summaryrefslogtreecommitdiff
path: root/src/mem/cache/base.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/base.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/base.cc')
-rw-r--r--src/mem/cache/base.cc16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index b474aeedc..a2443eaad 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -783,21 +783,7 @@ BaseCache::drain(DrainManager *dm)
BaseCache *
BaseCacheParams::create()
{
- unsigned numSets = size / (assoc * system->cacheLineSize());
-
assert(tags);
- if (dynamic_cast<FALRU*>(tags)) {
- if (numSets != 1)
- fatal("Got FALRU tags with more than one set\n");
- return new Cache<FALRU>(this);
- } else if (dynamic_cast<LRU*>(tags)) {
- if (numSets == 1)
- warn("Consider using FALRU tags for a fully associative cache\n");
- return new Cache<LRU>(this);
- } else if (dynamic_cast<RandomRepl*>(tags)) {
- return new Cache<RandomRepl>(this);
- } else {
- fatal("No suitable tags selected\n");
- }
+ return new Cache(this);
}