summaryrefslogtreecommitdiff
path: root/src/mem/abstract_mem.hh
diff options
context:
space:
mode:
authorDam Sunwoo <dam.sunwoo@arm.com>2012-06-05 01:23:11 -0400
committerDam Sunwoo <dam.sunwoo@arm.com>2012-06-05 01:23:11 -0400
commit14539ccae19098a26a7048f475f3ffd44b711f5d (patch)
treece1f163bc99546e2ad0d211b6f42bab994ecb358 /src/mem/abstract_mem.hh
parenteced845a5ebd77ebf413793fe8afdab54262c15f (diff)
downloadgem5-14539ccae19098a26a7048f475f3ffd44b711f5d.tar.xz
Mem: add per-master stats to physmem
Added per-master stats (similar to cache stats) to physmem.
Diffstat (limited to 'src/mem/abstract_mem.hh')
-rw-r--r--src/mem/abstract_mem.hh35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/mem/abstract_mem.hh b/src/mem/abstract_mem.hh
index 42ad08e5c..7b7e41913 100644
--- a/src/mem/abstract_mem.hh
+++ b/src/mem/abstract_mem.hh
@@ -53,6 +53,9 @@
#include "params/AbstractMemory.hh"
#include "sim/stats.hh"
+
+class System;
+
/**
* An abstract memory represents a contiguous block of physical
* memory, with an associated address range, and also provides basic
@@ -140,17 +143,17 @@ class AbstractMemory : public MemObject
}
/** Number of total bytes read from this memory */
- Stats::Scalar bytesRead;
+ Stats::Vector bytesRead;
/** Number of instruction bytes read from this memory */
- Stats::Scalar bytesInstRead;
+ Stats::Vector bytesInstRead;
/** Number of bytes written to this memory */
- Stats::Scalar bytesWritten;
+ Stats::Vector bytesWritten;
/** Number of read requests */
- Stats::Scalar numReads;
+ Stats::Vector numReads;
/** Number of write requests */
- Stats::Scalar numWrites;
+ Stats::Vector numWrites;
/** Number of other requests */
- Stats::Scalar numOther;
+ Stats::Vector numOther;
/** Read bandwidth from this memory */
Stats::Formula bwRead;
/** Read bandwidth from this memory */
@@ -160,6 +163,13 @@ class AbstractMemory : public MemObject
/** Total bandwidth from this memory */
Stats::Formula bwTotal;
+ /** Pointor to the System object.
+ * This is used for getting the number of masters in the system which is
+ * needed when registering stats
+ */
+ System *_system;
+
+
private:
// Prevent copying
@@ -175,6 +185,19 @@ class AbstractMemory : public MemObject
AbstractMemory(const Params* p);
virtual ~AbstractMemory();
+ /** read the system pointer
+ * Implemented for completeness with the setter
+ * @return pointer to the system object */
+ System* system() const { return _system; }
+
+ /** Set the system pointer on this memory
+ * This can't be done via a python parameter because the system needs
+ * pointers to all the memories and the reverse would create a cycle in the
+ * object graph. An init() this is set.
+ * @param sys system pointer to set
+ */
+ void system(System *sys) { _system = sys; }
+
const Params *
params() const
{