# Eventually this code should go in a python file specific to the
# MOESI_hammer protocol
#
-
- l1i_cache = L1Cache()
- l1d_cache = L1Cache()
- l2_cache = L2Cache()
+ l1i_profiler = CacheProfiler(description = ("l1i_%s_profiler" % i))
+ l1i_cache = L1Cache(cache_profiler = l1i_profiler)
+
+ l1d_profiler = CacheProfiler(description = ("l1d_%s_profiler" % i))
+ l1d_cache = L1Cache(cache_profiler = l1d_profiler)
+
+ l2_profiler = CacheProfiler(description = ("l2_%s_profiler" % i))
+ l2_cache = L2Cache(cache_profiler = l2_profiler)
cpu_seq = RubySequencer(icache = l1i_cache,
dcache = l1d_cache,
#include "mem/ruby/profiler/Profiler.hh"
#include "mem/gems_common/Vector.hh"
-CacheProfiler::CacheProfiler(string description)
- : m_requestSize(-1)
+CacheProfiler::CacheProfiler(const CacheProfilerParams* params)
+ : SimObject(params), m_requestSize(-1)
{
- m_description = description;
+ m_description = params->description;
m_requestTypeVec_ptr = new Vector<int>;
m_requestTypeVec_ptr->setSize(int(CacheRequestType_NUM));
}
}
+CacheProfiler *
+CacheProfilerParams::create()
+{
+ return new CacheProfiler(this);
+}
#include "mem/protocol/PrefetchBit.hh"
#include "mem/protocol/CacheRequestType.hh"
+#include "params/CacheProfiler.hh"
+
template <class TYPE> class Vector;
-class CacheProfiler {
+class CacheProfiler : public SimObject {
public:
// Constructors
- CacheProfiler(string description);
+ typedef CacheProfilerParams Params;
+ CacheProfiler(const Params *);
// Destructor
~CacheProfiler();
cxx_class = 'Profiler'
hot_lines = Param.Bool(False, "")
all_instructions = Param.Bool(False, "")
+
+class CacheProfiler(SimObject):
+ type = 'CacheProfiler'
+ cxx_class = 'CacheProfiler'
+ description = Param.String("")
latency = Param.Int("");
assoc = Param.Int("");
replacement_policy = Param.String("PSEUDO_LRU", "");
+ cache_profiler = Param.CacheProfiler("");
m_latency = p->latency;
m_cache_assoc = p->assoc;
m_policy = p->replacement_policy;
+ m_profiler_ptr = p->cache_profiler;
}
void CacheMemory::profileMiss(const CacheMsg & msg)
{
m_profiler_ptr->addStatSample(msg.getType(), msg.getAccessMode(),
- msg.getSize(), msg.getPrefetch());
+ msg.getSize(), msg.getPrefetch());
}
void CacheMemory::recordCacheContents(CacheRecorder& tr) const