diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2013-06-27 05:49:50 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2013-06-27 05:49:50 -0400 |
commit | 0d68d36b9d12c36e6201fa8bc4bec34258c04eab (patch) | |
tree | 66d9dc41b12a0bfafa80c8a7801f6b5d5725cdb6 /src/mem/cache/base.cc | |
parent | a0e551869c53d8fd0c8e3969521a2c732ad762b3 (diff) | |
download | gem5-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.cc | 17 |
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); + } +} |