48 #include "debug/TrafficGen.hh"
49 #include "proto/packet.pb.h"
52 : _name(_name), masterID(master_id), duration(_duration)
69 uint8_t* pkt_data =
new uint8_t[req->
getSize()];
73 std::fill_n(pkt_data, req->
getSize(), (uint8_t)masterID);
199 unsigned int new_bank =
203 unsigned int new_rank =
229 "size %d, countNumSeqPkts: %d, numSeqPkts: %d\n",
290 "new_rank: %d new_bank: %d\n",
316 "size %d, countNumSeqPkts: %d, numSeqPkts: %d\n",
357 unsigned int new_col =
422 ProtoMessage::PacketHeader header_msg;
424 panic(
"Failed to read packet header from trace\n");
426 panic(
"Trace was recorded with a different tick frequency %d\n",
427 header_msg.tick_freq());
443 element.
cmd = pkt_msg.
cmd();
444 element.
addr = pkt_msg.addr();
446 element.
tick = pkt_msg.tick();
447 element.
flags = pkt_msg.has_flags() ? pkt_msg.flags() : 0;
534 warn(
"Trace player %s was unable to replay the entire trace!\n",
const Addr blocksize
Block size.
bool traceComplete
Set to true when the trace replay for one instance of state is complete.
const unsigned int numSeqPkts
Number of sequential DRAM packets to be generated per cpu request.
std::string name() const
Get the name, useful for DPRINTFs.
Declaration of a set of generator behaviours that are used by the stand-alone traffic generator...
BaseGen(const std::string &_name, MasterID master_id, Tick _duration)
Create a base generator.
const Tick minPeriod
Request generation period.
const Tick minPeriod
Request generation period.
void enter()
Enter this generator state.
void genStartAddr(unsigned int new_bank, unsigned int new_rank)
Insert bank, rank, and column bits into packed address to create address for 1st command in a series...
PacketPtr getPacket(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0)
Generate a new request and associated packet.
PacketPtr getNextPacket()
Get the next generated packet.
unsigned int countNumSeqPkts
Track number of sequential packets generated for a request.
const unsigned int nbrOfBanksDRAM
Number of banks in DRAM.
void clear()
Make this element invalid.
Tick tick
The time at which the request should be sent.
bool isRead
Remember type of requests to be generated in series.
const Addr endAddr
End of address range.
PacketPtr getNextPacket()
Get the next generated packet.
const unsigned int bankBits
Number of bank bits in DRAM address.
const Addr startAddr
Start of address range.
unsigned int addrMapping
Address mapping to be used.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
const uint8_t readPercent
Percent of generated transactions that should be reads.
Tick nextPacketTick(bool elastic, Tick delay) const
Determine the tick when the next packet is available.
const Addr dataLimit
Maximum amount of data to manipulate.
unsigned int nextSeqCount
Next packet series count used to set rank and bank, and update isRead Incremented at the start of a n...
TraceElement currElement
Store the current and next element in the trace.
MemCmd cmd
Specifies if the request is to be a read or a write.
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
PacketPtr getNextPacket()
Get the next generated packet.
void enter()
Enter this generator state.
const MasterID masterID
The MasterID used for generating requests.
const Addr dataLimit
Maximum amount of data to manipulate.
Tick curTick()
The current simulated tick.
Addr nextAddr
Address of next request.
const Addr blocksize
Blocksize and address increment.
void exit()
Exit this generator state.
const unsigned int blockBits
Number of block bits in DRAM address.
The traffic generator is a master module that generates stimuli for the memory system, based on a collection of simple generator behaviours that are either probabilistic or based on traces.
This struct stores a line in the trace file.
uint64_t Tick
Tick count type.
Request::FlagsType flags
Potential request flags to use.
void replaceBits(T &val, int first, int last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
const unsigned int nbrOfBanksUtil
Number of banks to be utilized for a given configuration.
Tick nextPacketTick(bool elastic, Tick delay) const
Returns the tick when the next request should be generated.
void enter()
Enter this generator state.
const unsigned int pageBits
Number of page bits in DRAM address.
Addr blocksize
The size of the access for the request.
Tick nextPacketTick(bool elastic, Tick delay) const
Determine the tick when the next packet is available.
const unsigned int rankBits
Number of rank bits in DRAM address.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const unsigned int nbrOfRanks
Number of ranks to be utilized for a given configuration.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
InputStream trace
Input stream used for reading the input trace file.
Addr addrOffset
Offset for memory requests.
const Addr endAddr
End of address range.
Addr addr
The address for the request.
bool isValid() const
Check validity of this element.
PacketPtr getNextPacket()
Get the next generated packet.
Addr dataManipulated
Counter to determine the amount of data manipulated.
const uint8_t readPercent
Percent of generated transactions that should be reads.
Addr addr
Address of request.
Tick tickOffset
Stores the time when the state was entered.
PacketPtr getNextPacket()
Get the next generated packet.
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
const unsigned int pageSize
Page size of DRAM.
const Addr startAddr
Start of address range.
const unsigned int maxSeqCountPerRank
Number of command series issued before the rank is changed.
const FlagsType init
This Stat is Initialized.
Addr dataManipulated
Counter to determine the amount of data manipulated.
ProbePointArg< PacketInfo > Packet
Packet probe point.