summaryrefslogtreecommitdiff
path: root/src/mem/comm_monitor.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2015-07-06 17:08:53 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2015-07-06 17:08:53 +0100
commit777cc71c4a54412f78eabe381532f661c6174fee (patch)
treec4639bc7ca138c337095e2cced775ad7e94eff7c /src/mem/comm_monitor.cc
parent381e9191ddcacb78f2f1e72040d9843d43b3461b (diff)
downloadgem5-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.cc')
-rw-r--r--src/mem/comm_monitor.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mem/comm_monitor.cc b/src/mem/comm_monitor.cc
index a0f8688f2..d95a2fd5a 100644
--- a/src/mem/comm_monitor.cc
+++ b/src/mem/comm_monitor.cc
@@ -52,12 +52,13 @@ CommMonitor::CommMonitor(Params* params)
slavePort(name() + "-slave", *this),
samplePeriodicEvent(this),
samplePeriodTicks(params->sample_period),
+ samplePeriod(params->sample_period / SimClock::Float::s),
readAddrMask(params->read_addr_mask),
writeAddrMask(params->write_addr_mask),
- stats(params),
stackDistCalc(params->stack_dist_calc),
- traceStream(NULL),
- system(params->system)
+ system(params->system),
+ traceStream(nullptr),
+ stats(params)
{
// If we are using a trace file, then open the file
if (params->trace_enable) {
@@ -98,12 +99,9 @@ CommMonitor::CommMonitor(Params* params)
registerExitCallback(cb);
}
- // keep track of the sample period both in ticks and absolute time
- samplePeriod.setTick(params->sample_period);
-
DPRINTF(CommMonitor,
"Created monitor %s with sample period %d ticks (%f ms)\n",
- name(), samplePeriodTicks, samplePeriod.msec());
+ name(), samplePeriodTicks, samplePeriod * 1E3);
}
CommMonitor::~CommMonitor()
@@ -180,9 +178,9 @@ CommMonitor::recvAtomic(PacketPtr pkt)
if (stackDistCalc)
stackDistCalc->update(pkt->cmd, pkt->getAddr());
- // if tracing enabled, store the packet information
- // to the trace stream
- if (traceStream != NULL) {
+ // if tracing enabled, store the packet information
+ // to the trace stream
+ if (traceStream != NULL) {
ProtoMessage::Packet pkt_msg;
pkt_msg.set_tick(curTick());
pkt_msg.set_cmd(pkt->cmdToIndex());