diff options
author | Mrinmoy Ghosh <mrinmoy.ghosh@arm.com> | 2012-02-12 16:07:38 -0600 |
---|---|---|
committer | Mrinmoy Ghosh <mrinmoy.ghosh@arm.com> | 2012-02-12 16:07:38 -0600 |
commit | 7e104a1af235823e3d641a972ea920937f7ec67d (patch) | |
tree | d109d98f09652ed11b08dfe0d93a531b28d14df7 /src/mem/cache/prefetch/base.hh | |
parent | b7cf64398f16e93f118060bd49313f1d37f0e324 (diff) | |
download | gem5-7e104a1af235823e3d641a972ea920937f7ec67d.tar.xz |
prefetcher: Make prefetcher a sim object instead of it being a parameter on cache
Diffstat (limited to 'src/mem/cache/prefetch/base.hh')
-rw-r--r-- | src/mem/cache/prefetch/base.hh | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/mem/cache/prefetch/base.hh b/src/mem/cache/prefetch/base.hh index e3c0cbf16..ead163215 100644 --- a/src/mem/cache/prefetch/base.hh +++ b/src/mem/cache/prefetch/base.hh @@ -41,10 +41,11 @@ #include "base/statistics.hh" #include "mem/packet.hh" #include "params/BaseCache.hh" +#include "sim/sim_object.hh" class BaseCache; -class BasePrefetcher +class BasePrefetcher : public SimObject { protected: @@ -62,6 +63,14 @@ class BasePrefetcher /** The block size of the parent cache. */ int blkSize; + /** The latency before a prefetch is issued */ + Tick latency; + + /** The number of prefetches to issue */ + unsigned degree; + + /** If patterns should be found per context id */ + bool useContextId; /** Do we prefetch across page boundaries. */ bool pageStop; @@ -71,8 +80,6 @@ class BasePrefetcher /** Do we prefetch on only data reads, or on inst reads as well. */ bool onlyData; - std::string _name; - public: Stats::Scalar pfIdentified; @@ -85,16 +92,14 @@ class BasePrefetcher Stats::Scalar pfSpanPage; Stats::Scalar pfSquashed; - void regStats(const std::string &name); + void regStats(); public: - - BasePrefetcher(const BaseCacheParams *p); + typedef BasePrefetcherParams Params; + BasePrefetcher(const Params *p); virtual ~BasePrefetcher() {} - const std::string name() const { return _name; } - void setCache(BaseCache *_cache); /** @@ -130,7 +135,12 @@ class BasePrefetcher * Utility function: are addresses a and b on the same VM page? */ bool samePage(Addr a, Addr b); -}; - + public: + const Params* + params() const + { + return dynamic_cast<const Params *>(_params); + } +}; #endif //__MEM_CACHE_PREFETCH_BASE_PREFETCHER_HH__ |