gem5 v24.0.0.0
|
The random generator is similar to the linear one, but does not generate sequential addresses. More...
#include <random_gen.hh>
Public Member Functions | |
RandomGen (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) | |
Create a random address sequence generator. | |
void | enter () |
Enter this generator state. | |
PacketPtr | getNextPacket () |
Get the next generated packet. | |
Tick | nextPacketTick (bool elastic, Tick delay) const |
Determine the tick when the next packet is available. | |
Public Member Functions inherited from gem5::StochasticGen | |
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) | |
Public Member Functions inherited from gem5::BaseGen | |
BaseGen (SimObject &obj, RequestorID requestor_id, Tick _duration) | |
Create a base generator. | |
virtual | ~BaseGen () |
std::string | name () const |
Get the name, useful for DPRINTFs. | |
virtual void | exit () |
Exit this generator state. | |
Protected Attributes | |
Addr | dataManipulated |
Counter to determine the amount of data manipulated. | |
Protected Attributes inherited from gem5::StochasticGen | |
const Addr | startAddr |
Start of address range. | |
const Addr | endAddr |
End of address range. | |
const Addr | blocksize |
Blocksize and address increment. | |
const Addr | cacheLineSize |
Cache line size in the simulated system. | |
const Tick | minPeriod |
Request generation period. | |
const Tick | maxPeriod |
const uint8_t | readPercent |
Percent of generated transactions that should be reads. | |
const Addr | dataLimit |
Maximum amount of data to manipulate. | |
Protected Attributes inherited from gem5::BaseGen | |
const std::string | _name |
Name to use for status and debug printing. | |
const RequestorID | requestorId |
The RequestorID used for generating requests. | |
Additional Inherited Members | |
Public Attributes inherited from gem5::BaseGen | |
const Tick | duration |
Time to spend in this state. | |
Protected Member Functions inherited from gem5::BaseGen | |
PacketPtr | getPacket (Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0) |
Generate a new request and associated packet. | |
The random generator is similar to the linear one, but does not generate sequential addresses.
Instead it randomly picks an address in the range, aligned to the block size.
Definition at line 60 of file random_gen.hh.
|
inline |
Create a random address sequence generator.
Set min_period == max_period for a fixed inter-transaction time.
gen | Traffic generator owning this sequence generator |
_duration | duration of this state before transitioning |
requestor_id | RequestorID related to the memory requests |
start_addr | Start address |
end_addr | End address |
_blocksize | Size used for transactions injected |
cacheline_size | cache line size in the system |
min_period | Lower limit of random inter-transaction time |
max_period | Upper limit of random inter-transaction time |
read_percent | Percent of transactions that are reads |
data_limit | Upper limit on how much data to read/write |
Definition at line 82 of file random_gen.hh.
|
virtual |
Enter this generator state.
Implements gem5::BaseGen.
Definition at line 50 of file random_gen.cc.
References dataManipulated.
|
virtual |
Get the next generated packet.
Implements gem5::BaseGen.
Definition at line 57 of file random_gen.cc.
References gem5::X86ISA::addr, gem5::StochasticGen::blocksize, dataManipulated, DPRINTF, gem5::StochasticGen::endAddr, gem5::BaseGen::getPacket(), gem5::Random::random(), gem5::random_mt, gem5::StochasticGen::readPercent, gem5::MemCmd::ReadReq, gem5::StochasticGen::startAddr, and gem5::MemCmd::WriteReq.
Determine the tick when the next packet is available.
MaxTick means that there will not be any further packets in the current activation cycle of the generator.
elastic | should the injection respond to flow control or not |
delay | time the previous packet spent waiting |
Implements gem5::BaseGen.
Definition at line 84 of file random_gen.cc.
References gem5::curTick(), gem5::StochasticGen::dataLimit, dataManipulated, DPRINTF, gem5::StochasticGen::maxPeriod, gem5::MaxTick, gem5::StochasticGen::minPeriod, gem5::Random::random(), and gem5::random_mt.
|
protected |
Counter to determine the amount of data manipulated.
Used to determine if we should continue generating requests.
Definition at line 106 of file random_gen.hh.
Referenced by enter(), gem5::DramGen::getNextPacket(), gem5::DramRotGen::getNextPacket(), gem5::NvmGen::getNextPacket(), getNextPacket(), and nextPacketTick().