summaryrefslogtreecommitdiff
path: root/src/mem/cache/base.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-06-27 05:49:50 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-06-27 05:49:50 -0400
commit0d68d36b9d12c36e6201fa8bc4bec34258c04eab (patch)
tree66d9dc41b12a0bfafa80c8a7801f6b5d5725cdb6 /src/mem/cache/base.cc
parenta0e551869c53d8fd0c8e3969521a2c732ad762b3 (diff)
downloadgem5-0d68d36b9d12c36e6201fa8bc4bec34258c04eab.tar.xz
mem: Remove the cache builder
This patch removes the redundant cache builder class.
Diffstat (limited to 'src/mem/cache/base.cc')
-rw-r--r--src/mem/cache/base.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 85265b61e..ba981b606 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -49,7 +49,10 @@
#include "cpu/smt.hh"
#include "debug/Cache.hh"
#include "debug/Drain.hh"
+#include "mem/cache/tags/fa_lru.hh"
+#include "mem/cache/tags/lru.hh"
#include "mem/cache/base.hh"
+#include "mem/cache/cache.hh"
#include "mem/cache/mshr.hh"
#include "sim/full_system.hh"
@@ -766,3 +769,17 @@ BaseCache::drain(DrainManager *dm)
setDrainState(Drainable::Drained);
return 0;
}
+
+BaseCache *
+BaseCacheParams::create()
+{
+ int numSets = size / (assoc * block_size);
+
+ if (numSets == 1) {
+ FALRU *tags = new FALRU(block_size, size, hit_latency);
+ return new Cache<FALRU>(this, tags);
+ } else {
+ LRU *tags = new LRU(numSets, block_size, assoc, hit_latency);
+ return new Cache<LRU>(this, tags);
+ }
+}