46 #include "debug/TrafficGen.hh" 50 : _name(obj.
name()), masterID(master_id),
68 uint8_t* pkt_data =
new uint8_t[req->getSize()];
72 std::fill_n(pkt_data, req->getSize(), (uint8_t)masterID);
81 Addr _blocksize,
Addr cacheline_size,
83 uint8_t read_percent,
Addr data_limit)
84 :
BaseGen(obj, master_id, _duration),
85 startAddr(start_addr), endAddr(end_addr),
86 blocksize(_blocksize), cacheLineSize(cacheline_size),
87 minPeriod(min_period), maxPeriod(max_period),
88 readPercent(read_percent), dataLimit(data_limit)
91 fatal(
"TrafficGen %s block size (%d) is larger than " 92 "cache line size (%d)\n",
name(),
95 if (read_percent > 100)
96 fatal(
"%s cannot have more than 100% reads",
name());
98 if (min_period > max_period)
99 fatal(
"%s cannot have min_period > max_period",
name());
#define fatal(...)
This implements a cprintf based fatal() function.
const std::string & name()
std::shared_ptr< Request > RequestPtr
PacketPtr getPacket(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0)
Generate a new request and associated packet.
StochasticGen(SimObject &obj, MasterID master_id, Tick _duration, Addr start_addr, Addr end_addr, Addr _blocksize, Addr cacheline_size, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
const MasterID masterID
The MasterID used for generating requests.
uint64_t Tick
Tick count type.
Declaration of the base generator class for all generators.
BaseGen(SimObject &obj, MasterID master_id, Tick _duration)
Create a base generator.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
const Addr blocksize
Blocksize and address increment.
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
Base class for all generators, with the shared functionality and virtual functions for entering...
Abstract superclass for simulation objects.
const Addr cacheLineSize
Cache line size in the simulated system.
ProbePointArg< PacketInfo > Packet
Packet probe point.
std::string name() const
Get the name, useful for DPRINTFs.