44#include "debug/TrafficGen.hh"
45#include "proto/packet.pb.h"
62 ProtoMessage::PacketHeader header_msg;
64 panic(
"Failed to read packet header from trace\n");
66 panic(
"Trace was recorded with a different tick frequency %d\n",
67 header_msg.tick_freq());
81 ProtoMessage::Packet pkt_msg;
83 element.
cmd = pkt_msg.
cmd();
84 element.
addr = pkt_msg.addr();
86 element.
tick = pkt_msg.tick();
87 element.
flags = pkt_msg.has_flags() ? pkt_msg.flags() : 0;
174 warn(
"Trace player %s was unable to replay the entire trace!\n",
PacketPtr getPacket(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0)
Generate a new request and associated packet.
std::string name() const
Get the name, useful for DPRINTFs.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void exit()
Exit this generator state.
PacketPtr getNextPacket()
Get the next generated packet.
bool traceComplete
Set to true when the trace replay for one instance of state is complete.
Tick nextPacketTick(bool elastic, Tick delay) const
Returns the tick when the next request should be generated.
Addr addrOffset
Offset for memory requests.
TraceElement currElement
Store the current and next element in the trace.
Tick tickOffset
Stores the time when the state was entered.
void enter()
Enter this generator state.
InputStream trace
Input stream used for reading the input trace file.
The traffic generator is a module that generates stimuli for the memory system, based on a collection...
#define panic(...)
This implements a cprintf based panic() function.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
const FlagsType init
This Stat is Initialized.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Tick
Tick count type.
This struct stores a line in the trace file.
MemCmd cmd
Specifies if the request is to be a read or a write.
Addr addr
The address for the request.
Addr blocksize
The size of the access for the request.
Request::FlagsType flags
Potential request flags to use.
void clear()
Make this element invalid.
Tick tick
The time at which the request should be sent.
bool isValid() const
Check validity of this element.
Declaration of the trace generator that reads a trace file and plays the transactions.