summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Blake <Geoffrey.Blake@arm.com>2015-03-19 04:06:10 -0400
committerGeoffrey Blake <Geoffrey.Blake@arm.com>2015-03-19 04:06:10 -0400
commit1d403960afec613f3aa9f1fc2ffc3287139e1d86 (patch)
treee94220ca3498ad6f5d6a147ce28f1eb5f774f34e
parent40e678069f0199c1aa8561af0b09b6ee3839b153 (diff)
downloadgem5-1d403960afec613f3aa9f1fc2ffc3287139e1d86.tar.xz
mem: Enable CommMonitor to output traces in atomic mode
The CommMonitor by default only allows memory traces to be gathered in timing mode. This patch allows memory traces to be gathered in atomic mode if all one needs is a functional trace of memory addresses used and timing information is of a secondary concern.
-rw-r--r--src/mem/comm_monitor.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mem/comm_monitor.cc b/src/mem/comm_monitor.cc
index dc4fa4bd4..a0f8688f2 100644
--- a/src/mem/comm_monitor.cc
+++ b/src/mem/comm_monitor.cc
@@ -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
@@ -176,10 +176,23 @@ CommMonitor::recvFunctionalSnoop(PacketPtr pkt)
Tick
CommMonitor::recvAtomic(PacketPtr pkt)
{
- // allow stack distance calculations for atomic if enabled
+ // do stack distance calculations if enabled
if (stackDistCalc)
stackDistCalc->update(pkt->cmd, pkt->getAddr());
+ // 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());
+ pkt_msg.set_flags(pkt->req->getFlags());
+ pkt_msg.set_addr(pkt->getAddr());
+ pkt_msg.set_size(pkt->getSize());
+
+ traceStream->write(pkt_msg);
+ }
+
return masterPort.sendAtomic(pkt);
}