42 #include "params/MemTraceProbe.hh" 43 #include "proto/packet.pb.h" 53 if (p->trace_file !=
"") {
58 const std::string suffix =
".gz";
61 if (p->trace_compress &&
62 filename.compare(filename.size() - suffix.size(), suffix.size(),
64 filename = filename + suffix;
69 (p->trace_compress ?
".gz" :
""));
86 ProtoMessage::PacketHeader header_msg;
87 header_msg.set_obj_id(
name());
91 auto id_string = header_msg.add_id_strings();
92 id_string->set_key(
i);
112 pkt_msg.set_cmd(pkt_info.
cmd.
toInt());
113 pkt_msg.set_flags(pkt_info.
flags);
114 pkt_msg.set_addr(pkt_info.
addr);
115 pkt_msg.set_size(pkt_info.
size);
117 pkt_msg.set_pc(pkt_info.
pc);
118 pkt_msg.set_pkt_id(pkt_info.
master);
125 MemTraceProbeParams::create()
std::string resolve(const std::string &name) const
Returns relative file names prepended with name of this directory.
A ProtoOutputStream wraps a coded stream, potentially with compression, based on looking at the file ...
void startup() override
startup() is the final initialization call before simulation.
void write(const google::protobuf::Message &msg)
Write a message to the stream, preprending it with the message size.
std::string getMasterName(MasterID master_id)
Get the name of an object for a given request id.
void handleRequest(const ProbePoints::PacketInfo &pkt_info) override
Callback to analyse intercepted Packets.
MemTraceProbe(MemTraceProbeParams *params)
Base class for memory system probes accepting Packet instances.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
const bool withPC
Include the Program Counter in the memory trace.
ProtoOutputStream * traceStream
Trace output stream.
Tick curTick()
The current simulated tick.
void registerExitCallback(Callback *callback)
Register an exit callback.
MasterID maxMasters()
Get the number of masters registered in the system.
virtual const std::string name() const
void closeStreams()
Callback to flush and close all open output streams on exit.
Helper template class to turn a simple class member function into a callback.
ProbePointArg< PacketInfo > Packet
Packet probe point.
A struct to hold on to the essential fields from a packet, so that the packet and underlying request ...