changeset 116c6cd45fff in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=116c6cd45fff
description:
        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.

diffstat:

 src/mem/comm_monitor.cc |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 062c820aef24 -r 116c6cd45fff src/mem/comm_monitor.cc
--- a/src/mem/comm_monitor.cc   Thu Mar 19 04:06:08 2015 -0400
+++ b/src/mem/comm_monitor.cc   Thu Mar 19 04:06:10 2015 -0400
@@ -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 @@
 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);
 }
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to