diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-07-06 17:08:53 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-07-06 17:08:53 +0100 |
commit | 777cc71c4a54412f78eabe381532f661c6174fee (patch) | |
tree | c4639bc7ca138c337095e2cced775ad7e94eff7c /src/mem/comm_monitor.hh | |
parent | 381e9191ddcacb78f2f1e72040d9843d43b3461b (diff) | |
download | gem5-777cc71c4a54412f78eabe381532f661c6174fee.tar.xz |
mem: Cleanup CommMonitor in preparation for probe support
Make configuration parameters constant and get rid of an unnecessary
dependency on the Time class.
Diffstat (limited to 'src/mem/comm_monitor.hh')
-rw-r--r-- | src/mem/comm_monitor.hh | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/src/mem/comm_monitor.hh b/src/mem/comm_monitor.hh index f4aa9a20e..74c711955 100644 --- a/src/mem/comm_monitor.hh +++ b/src/mem/comm_monitor.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 ARM Limited + * Copyright (c) 2012-2013, 2015 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -42,7 +42,6 @@ #define __MEM_COMM_MONITOR_HH__ #include "base/statistics.hh" -#include "base/time.hh" #include "mem/mem_object.hh" #include "mem/stack_dist_calc.hh" #include "params/CommMonitor.hh" @@ -63,7 +62,7 @@ class CommMonitor : public MemObject { - public: + public: // Construction & SimObject interfaces /** Parameters of communication monitor */ typedef CommMonitorParams Params; @@ -80,22 +79,16 @@ class CommMonitor : public MemObject /** Destructor */ ~CommMonitor(); - /** - * Callback to flush and close all open output streams on exit. If - * we were calling the destructor it could be done there. - */ - void closeStreams(); - - virtual BaseMasterPort& getMasterPort(const std::string& if_name, - PortID idx = InvalidPortID); + void init() M5_ATTR_OVERRIDE; + void regStats() M5_ATTR_OVERRIDE; + void startup() M5_ATTR_OVERRIDE; - virtual BaseSlavePort& getSlavePort(const std::string& if_name, - PortID idx = InvalidPortID); + public: // MemObject interfaces + BaseMasterPort& getMasterPort(const std::string& if_name, + PortID idx = InvalidPortID) M5_ATTR_OVERRIDE; - virtual void init(); - - /** Register statistics */ - void regStats(); + BaseSlavePort& getSlavePort(const std::string& if_name, + PortID idx = InvalidPortID) M5_ATTR_OVERRIDE; private: @@ -397,33 +390,44 @@ class CommMonitor : public MemObject /** This function is called periodically at the end of each time bin */ void samplePeriodic(); - /** Schedule the first periodic event */ - void startup(); + /** + * Callback to flush and close all open output streams on exit. If + * we were calling the destructor it could be done there. + */ + void closeStreams(); /** Periodic event called at the end of each simulation time bin */ EventWrapper<CommMonitor, &CommMonitor::samplePeriodic> samplePeriodicEvent; + /** + *@{ + * @name Configuration + */ + /** Length of simulation time bin*/ - Tick samplePeriodTicks; - Time samplePeriod; + const Tick samplePeriodTicks; + /** Sample period in seconds */ + const double samplePeriod; /** Address mask for sources of read accesses to be captured */ - Addr readAddrMask; + const Addr readAddrMask; /** Address mask for sources of write accesses to be captured */ - Addr writeAddrMask; - - /** Instantiate stats */ - MonitorStats stats; + const Addr writeAddrMask; /** Optional stack distance calculator */ - StackDistCalc* stackDistCalc; + StackDistCalc *const stackDistCalc; + + /** The system in which the monitor lives */ + System *const system; + + /** @} */ /** Output stream for a potential trace. */ - ProtoOutputStream* traceStream; + ProtoOutputStream *traceStream; - /** The system in which the monitor lives */ - System *system; + /** Instantiate stats */ + MonitorStats stats; }; #endif //__MEM_COMM_MONITOR_HH__ |