# Andreas Hansson
from m5.params import *
+from m5.proxy import *
from MemObject import MemObject
+from System import System
# The communication monitor will most typically be used in combination
# with periodic dumping and resetting of stats using schedStatEvent
type = 'CommMonitor'
cxx_header = "mem/comm_monitor.hh"
+ system = Param.System(Parent.any, "System that the monitor belongs to.")
+
# one port in each direction
master = MasterPort("Master port")
slave = SlavePort("Slave port")
readAddrMask(params->read_addr_mask),
writeAddrMask(params->write_addr_mask),
stats(params),
- traceStream(NULL)
+ traceStream(NULL),
+ system(params->system)
{
// If we are using a trace file, then open the file,
if (params->trace_file != "") {
// make sure both sides of the monitor are connected
if (!slavePort.isConnected() || !masterPort.isConnected())
fatal("Communication monitor is not connected on both sides.\n");
+
+ if (traceStream != NULL) {
+ // Check the memory mode. We only record something when in
+ // timing mode. Warn accordingly.
+ if (!system->isTimingMode())
+ warn("%s: Not in timing mode. No trace will be recorded.", name());
+ }
}
BaseMasterPort&
#include "mem/mem_object.hh"
#include "params/CommMonitor.hh"
#include "proto/protoio.hh"
+#include "sim/system.hh"
/**
* The communication monitor is a MemObject which can monitor statistics of
/** Output stream for a potential trace. */
ProtoOutputStream* traceStream;
+
+ /** The system in which the monitor lives */
+ System *system;
};
#endif //__MEM_COMM_MONITOR_HH__