* @file
* Simobject instatiation of caches.
*/
+#include <list>
#include <vector>
-// Must be included first to determine which caches we want
-#include "enums/Prefetch.hh"
-#include "mem/config/cache.hh"
-#include "mem/config/prefetch.hh"
+#include "config/the_isa.hh"
#include "mem/cache/base.hh"
#include "mem/cache/cache.hh"
-#include "mem/bus.hh"
+#include "mem/config/cache.hh"
#include "params/BaseCache.hh"
// Tag Templates
#include "mem/cache/tags/iic.hh"
#endif
-//Prefetcher Headers
-#if defined(USE_GHB)
-#include "mem/cache/prefetch/ghb.hh"
-#endif
-#if defined(USE_TAGGED)
-#include "mem/cache/prefetch/tagged.hh"
-#endif
-#if defined(USE_STRIDED)
-#include "mem/cache/prefetch/stride.hh"
-#endif
-
using namespace std;
-using namespace TheISA;
-
-#define BUILD_CACHE(TAGS, tags) \
- do { \
- BasePrefetcher *pf; \
- if (prefetch_policy == Enums::tagged) { \
- BUILD_TAGGED_PREFETCHER(TAGS); \
- } \
- else if (prefetch_policy == Enums::stride) { \
- BUILD_STRIDED_PREFETCHER(TAGS); \
- } \
- else if (prefetch_policy == Enums::ghb) { \
- BUILD_GHB_PREFETCHER(TAGS); \
- } \
- else { \
- BUILD_NULL_PREFETCHER(TAGS); \
- } \
- Cache<TAGS> *retval = \
- new Cache<TAGS>(this, tags, pf); \
- return retval; \
+
+#define BUILD_CACHE(TAGS, tags) \
+ do { \
+ Cache<TAGS> *retval = \
+ new Cache<TAGS>(this, tags); \
+ return retval; \
} while (0)
#define BUILD_CACHE_PANIC(x) do { \
} \
} while (0)
-#define BUILD_COHERENCE(b) do { \
- } while (0)
-
-#if defined(USE_TAGGED)
-#define BUILD_TAGGED_PREFETCHER(t) \
- pf = new TaggedPrefetcher(this)
-#else
-#define BUILD_TAGGED_PREFETCHER(t) BUILD_CACHE_PANIC("Tagged Prefetcher")
-#endif
-
-#if defined(USE_STRIDED)
-#define BUILD_STRIDED_PREFETCHER(t) \
- pf = new StridePrefetcher(this)
-#else
-#define BUILD_STRIDED_PREFETCHER(t) BUILD_CACHE_PANIC("Stride Prefetcher")
-#endif
-
-#if defined(USE_GHB)
-#define BUILD_GHB_PREFETCHER(t) \
- pf = new GHBPrefetcher(this)
-#else
-#define BUILD_GHB_PREFETCHER(t) BUILD_CACHE_PANIC("GHB Prefetcher")
-#endif
-
-#if defined(USE_TAGGED)
-#define BUILD_NULL_PREFETCHER(t) \
- pf = new TaggedPrefetcher(this)
-#else
-#define BUILD_NULL_PREFETCHER(t) BUILD_CACHE_PANIC("NULL Prefetcher (uses Tagged)")
-#endif
-
BaseCache *
BaseCacheParams::create()
{
subblock_size = block_size;
}
- //Warnings about prefetcher policy
- if (prefetch_policy == Enums::none) {
- if (prefetch_miss || prefetch_access)
- panic("With no prefetcher, you shouldn't prefetch from"
- " either miss or access stream\n");
- }
-
- if (prefetch_policy == Enums::tagged || prefetch_policy == Enums::stride ||
- prefetch_policy == Enums::ghb) {
-
- if (!prefetch_miss && !prefetch_access)
- warn("With this prefetcher you should chose a prefetch"
- " stream (miss or access)\nNo Prefetching will occur\n");
-
- if (prefetch_miss && prefetch_access)
- panic("Can't do prefetches from both miss and access stream");
- }
-
#if defined(USE_CACHE_IIC)
// Build IIC params
IIC::Params iic_params;