summaryrefslogtreecommitdiff
path: root/src/mem/abstract_mem.hh
diff options
context:
space:
mode:
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
{