mem: Fix guest corruption when caches handle uncacheable accesses
[gem5.git] / src / mem / comm_monitor.hh
index e59b8c467e9da6f320c6196ce2fbdb9ff272cdba..271ae5fff2060af702eade3c13beac173654da0a 100644 (file)
@@ -45,6 +45,7 @@
 #include "base/time.hh"
 #include "mem/mem_object.hh"
 #include "params/CommMonitor.hh"
+#include "proto/protoio.hh"
 
 /**
  * The communication monitor is a MemObject which can monitor statistics of
@@ -75,7 +76,13 @@ class CommMonitor : public MemObject
     CommMonitor(Params* params);
 
     /** Destructor */
-    ~CommMonitor() { }
+    ~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);
@@ -427,6 +434,9 @@ class CommMonitor : public MemObject
 
     /** Instantiate stats */
     MonitorStats stats;
+
+    /** Output stream for a potential trace. */
+    ProtoOutputStream* traceStream;
 };
 
 #endif //__MEM_COMM_MONITOR_HH__