summaryrefslogtreecommitdiff
path: root/src/mem/abstract_mem.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-09-23 18:20:23 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-09-30 12:33:47 +0000
commit76384ec3ff2a52898aa35a27d337194ae557648a (patch)
treef403d38cb5fb050b60f5299d60d908abc504ecf4 /src/mem/abstract_mem.hh
parenta060ac86307311587d05d280ee1f4cbdb84fe98a (diff)
downloadgem5-76384ec3ff2a52898aa35a27d337194ae557648a.tar.xz
mem: Convert DRAM controller to new-style stats
Note that this changes the stat format used by the DRAM controller. Previously, it would have a structure looking a bit like this: - system - dram: Main DRAM controller - dram_0: Rank 0 - dram_1: Rank 1 This structure can't be replicated with new-world stats since stats are confined to the SimObject name space. This means that the new structure looks like this: - system - dram: Main DRAM controller - rank0: Rank 0 - rank1: Rank 1 Change-Id: I7435cfaf137c94b0c18de619d816362dd0da8125 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21142 Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Wendy Elsasser <wendy.elsasser@arm.com>
Diffstat (limited to 'src/mem/abstract_mem.hh')
-rw-r--r--src/mem/abstract_mem.hh56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/mem/abstract_mem.hh b/src/mem/abstract_mem.hh
index 8b944b981..655fc0115 100644
--- a/src/mem/abstract_mem.hh
+++ b/src/mem/abstract_mem.hh
@@ -161,33 +161,41 @@ class AbstractMemory : public ClockedObject
}
}
- /** Number of total bytes read from this memory */
- Stats::Vector bytesRead;
- /** Number of instruction bytes read from this memory */
- Stats::Vector bytesInstRead;
- /** Number of bytes written to this memory */
- Stats::Vector bytesWritten;
- /** Number of read requests */
- Stats::Vector numReads;
- /** Number of write requests */
- Stats::Vector numWrites;
- /** Number of other requests */
- Stats::Vector 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;
-
/** 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;
+ struct MemStats : public Stats::Group {
+ MemStats(AbstractMemory &mem);
+
+ void regStats() override;
+
+ const AbstractMemory &mem;
+
+ /** Number of total bytes read from this memory */
+ Stats::Vector bytesRead;
+ /** Number of instruction bytes read from this memory */
+ Stats::Vector bytesInstRead;
+ /** Number of bytes written to this memory */
+ Stats::Vector bytesWritten;
+ /** Number of read requests */
+ Stats::Vector numReads;
+ /** Number of write requests */
+ Stats::Vector numWrites;
+ /** Number of other requests */
+ Stats::Vector 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;
+ } stats;
+
private:
@@ -318,12 +326,6 @@ class AbstractMemory : public ClockedObject
* @param pkt Packet performing the access
*/
void functionalAccess(PacketPtr pkt);
-
- /**
- * Register Statistics
- */
- void regStats() override;
-
};
#endif //__MEM_ABSTRACT_MEMORY_HH__