summaryrefslogtreecommitdiff
path: root/src/mem/physical.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/physical.hh')
-rw-r--r--src/mem/physical.hh37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/mem/physical.hh b/src/mem/physical.hh
index cd6d809e2..b447237c7 100644
--- a/src/mem/physical.hh
+++ b/src/mem/physical.hh
@@ -38,11 +38,13 @@
#include <string>
#include "base/range.hh"
+#include "base/statistics.hh"
#include "mem/mem_object.hh"
#include "mem/packet.hh"
#include "mem/tport.hh"
#include "params/PhysicalMemory.hh"
#include "sim/eventq.hh"
+#include "sim/stats.hh"
//
// Functional model for a contiguous block of physical memory. (i.e. RAM)
@@ -65,10 +67,9 @@ class PhysicalMemory : public MemObject
virtual void recvFunctional(PacketPtr pkt);
- virtual void recvStatusChange(Status status);
+ virtual void recvRangeChange();
- virtual void getDeviceAddressRanges(AddrRangeList &resp,
- bool &snoop);
+ virtual AddrRangeList getAddrRanges();
virtual unsigned deviceBlockSize() const;
};
@@ -155,6 +156,28 @@ class PhysicalMemory : public MemObject
uint64_t _size;
uint64_t _start;
+
+ /** Number of total bytes read from this memory */
+ Stats::Scalar bytesRead;
+ /** Number of instruction bytes read from this memory */
+ Stats::Scalar bytesInstRead;
+ /** Number of bytes written to this memory */
+ Stats::Scalar bytesWritten;
+ /** Number of read requests */
+ Stats::Scalar numReads;
+ /** Number of write requests */
+ Stats::Scalar numWrites;
+ /** Number of other requests */
+ Stats::Scalar numOther;
+ /** Read bandwidth from this memory */
+ Stats::Formula bwRead;
+ /** Read bandwidth from this memory */
+ Stats::Formula bwInstRead;
+ /** Write bandwidth from this memory */
+ Stats::Formula bwWrite;
+ /** Total bandwidth from this memory */
+ Stats::Formula bwTotal;
+
public:
uint64_t size() { return _size; }
uint64_t start() { return _start; }
@@ -172,7 +195,7 @@ class PhysicalMemory : public MemObject
public:
unsigned deviceBlockSize() const;
- void getAddressRanges(AddrRangeList &resp, bool &snoop);
+ AddrRangeList getAddrRanges();
virtual Port *getPort(const std::string &if_name, int idx = -1);
void virtual init();
unsigned int drain(Event *de);
@@ -181,9 +204,13 @@ class PhysicalMemory : public MemObject
Tick doAtomicAccess(PacketPtr pkt);
void doFunctionalAccess(PacketPtr pkt);
virtual Tick calculateLatency(PacketPtr pkt);
- void recvStatusChange(Port::Status status);
public:
+ /**
+ * Register Statistics
+ */
+ void regStats();
+
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section);