gem5
|
The linear generator generates sequential requests from a start to an end address, with a fixed block size. More...
#include <generators.hh>
Public Member Functions | |
LinearGen (const std::string &_name, MasterID master_id, Tick _duration, Addr start_addr, Addr end_addr, Addr _blocksize, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit) | |
Create a linear address sequence generator. More... | |
void | enter () |
Enter this generator state. More... | |
PacketPtr | getNextPacket () |
Get the next generated packet. More... | |
Tick | nextPacketTick (bool elastic, Tick delay) const |
Determine the tick when the next packet is available. More... | |
Public Member Functions inherited from BaseGen | |
BaseGen (const std::string &_name, MasterID master_id, Tick _duration) | |
Create a base generator. More... | |
virtual | ~BaseGen () |
std::string | name () const |
Get the name, useful for DPRINTFs. More... | |
virtual void | exit () |
Exit this generator state. More... | |
Private Attributes | |
const Addr | startAddr |
Start of address range. More... | |
const Addr | endAddr |
End of address range. More... | |
const Addr | blocksize |
Blocksize and address increment. More... | |
const Tick | minPeriod |
Request generation period. More... | |
const Tick | maxPeriod |
const uint8_t | readPercent |
Percent of generated transactions that should be reads. More... | |
const Addr | dataLimit |
Maximum amount of data to manipulate. More... | |
Addr | nextAddr |
Address of next request. More... | |
Addr | dataManipulated |
Counter to determine the amount of data manipulated. More... | |
Additional Inherited Members | |
Public Attributes inherited from BaseGen | |
const Tick | duration |
Time to spend in this state. More... | |
Protected Member Functions inherited from BaseGen | |
PacketPtr | getPacket (Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0) |
Generate a new request and associated packet. More... | |
Protected Attributes inherited from BaseGen | |
const std::string | _name |
Name to use for status and debug printing. More... | |
const MasterID | masterID |
The MasterID used for generating requests. More... | |
The linear generator generates sequential requests from a start to an end address, with a fixed block size.
A fraction of the requests are reads, as determined by the read percent. There is an optional data limit for when to stop generating new requests.
Definition at line 164 of file generators.hh.
|
inline |
Create a linear address sequence generator.
Set min_period == max_period for a fixed inter-transaction time.
_name | Name to use for status and debug |
master_id | MasterID set on each request |
_duration | duration of this state before transitioning |
start_addr | Start address |
end_addr | End address |
_blocksize | Size used for transactions injected |
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 185 of file generators.hh.
|
virtual |
Enter this generator state.
Implements BaseGen.
Definition at line 80 of file generators.cc.
References dataManipulated, nextAddr, and startAddr.
|
virtual |
Get the next generated packet.
Implements BaseGen.
Definition at line 88 of file generators.cc.
References blocksize, dataManipulated, DPRINTF, endAddr, BaseGen::getPacket(), nextAddr, Random::random(), random_mt, readPercent, MemCmd::ReadReq, startAddr, and 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 BaseGen.
Definition at line 121 of file generators.cc.
References curTick(), dataLimit, dataManipulated, DPRINTF, maxPeriod, MaxTick, minPeriod, Random::random(), and random_mt.
|
private |
Blocksize and address increment.
Definition at line 211 of file generators.hh.
Referenced by getNextPacket().
|
private |
Maximum amount of data to manipulate.
Definition at line 223 of file generators.hh.
Referenced by nextPacketTick().
|
private |
Counter to determine the amount of data manipulated.
Used to determine if we should continue generating requests.
Definition at line 233 of file generators.hh.
Referenced by enter(), getNextPacket(), and nextPacketTick().
|
private |
|
private |
Definition at line 215 of file generators.hh.
Referenced by nextPacketTick().
|
private |
Request generation period.
Definition at line 214 of file generators.hh.
Referenced by nextPacketTick().
|
private |
Address of next request.
Definition at line 226 of file generators.hh.
Referenced by enter(), and getNextPacket().
|
private |
Percent of generated transactions that should be reads.
Definition at line 220 of file generators.hh.
Referenced by getNextPacket().
|
private |
Start of address range.
Definition at line 205 of file generators.hh.
Referenced by enter(), and getNextPacket().