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