68 uint8_t* pkt_data =
new uint8_t[req->getSize()];
72 std::fill_n(pkt_data, req->getSize(), (uint8_t)
requestorId);
81 Addr _blocksize,
Addr cacheline_size,
83 uint8_t read_percent,
Addr data_limit)
84 :
BaseGen(obj, requestor_id, _duration),
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());
Declaration of the base generator class for all generators.
PacketPtr getPacket(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0)
Generate a new request and associated packet.
const Tick duration
Time to spend in this state.
BaseGen(SimObject &obj, RequestorID requestor_id, Tick _duration)
Create a base generator.
const RequestorID requestorId
The RequestorID used for generating requests.
const std::string _name
Name to use for status and debug printing.
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 dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
Abstract superclass for simulation objects.
const Addr startAddr
Start of address range.
const Tick minPeriod
Request generation period.
const Addr dataLimit
Maximum amount of data to manipulate.
const Addr cacheLineSize
Cache line size in the simulated system.
const Addr endAddr
End of address range.
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)
const Addr blocksize
Blocksize and address increment.
const uint8_t readPercent
Percent of generated transactions that should be reads.
#define fatal(...)
This implements a cprintf based fatal() function.
Copyright (c) 2024 Arm Limited All rights reserved.
std::shared_ptr< Request > RequestPtr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.