gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::StridedGen Class Reference

The strided generator generates sequential requests from a start to an end address, with a fixed block size. More...

#include <strided_gen.hh>

Inheritance diagram for gem5::StridedGen:
gem5::StochasticGen gem5::BaseGen

Public Member Functions

 StridedGen (SimObject &obj, RequestorID requestor_id, Tick duration, Addr cacheline_size, Addr start_addr, Addr end_addr, Addr offset, Addr block_size, Addr superblock_size, Addr stride_size, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
 Create a strided 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.
 

Private Attributes

Addr offset
 
Addr superblockSize
 
Addr strideSize
 
Addr nextAddr
 Address of next request.
 
Addr dataManipulated
 Counter to determine the amount of data manipulated.
 

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.
 
- 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.
 

Detailed Description

The strided 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 62 of file strided_gen.hh.

Constructor & Destructor Documentation

◆ StridedGen()

gem5::StridedGen::StridedGen ( SimObject & obj,
RequestorID requestor_id,
Tick duration,
Addr cacheline_size,
Addr start_addr,
Addr end_addr,
Addr offset,
Addr block_size,
Addr superblock_size,
Addr stride_size,
Tick min_period,
Tick max_period,
uint8_t read_percent,
Addr data_limit )

Create a strided address sequence generator.

Set min_period == max_period for a fixed inter-transaction time.

Parameters
objSimObject owning this sequence generator
requestor_idRequestorID related to the memory requests
cacheline_sizecache line size in the system
durationduration of this state before transitioning
start_addrStart address
end_addrEnd address
offsetThe offset to start_addr for generating addresses. First generated address = start_addr + offset.
block_sizeSize used for transactions injected
stride_sizeThe strided size for consecutive requests
superblock_sizeNumber of bytes to read before taking a stride
min_periodLower limit of random inter-transaction time
max_periodUpper limit of random inter-transaction time
read_percentPercent of transactions that are reads
data_limitUpper limit on how much data to read/write

Definition at line 49 of file strided_gen.cc.

References offset.

Member Function Documentation

◆ enter()

void gem5::StridedGen::enter ( )
virtual

Enter this generator state.

Implements gem5::BaseGen.

Definition at line 67 of file strided_gen.cc.

References dataManipulated, nextAddr, offset, and gem5::StochasticGen::startAddr.

◆ getNextPacket()

◆ nextPacketTick()

Tick gem5::StridedGen::nextPacketTick ( bool elastic,
Tick delay ) const
virtual

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.

Parameters
elasticshould the injection respond to flow control or not
delaytime the previous packet spent waiting
Returns
next tick when a packet is available

Implements gem5::BaseGen.

Definition at line 114 of file strided_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.

Member Data Documentation

◆ dataManipulated

Addr gem5::StridedGen::dataManipulated
private

Counter to determine the amount of data manipulated.

Used to determine if we should continue generating requests.

Definition at line 116 of file strided_gen.hh.

Referenced by enter(), getNextPacket(), and nextPacketTick().

◆ nextAddr

Addr gem5::StridedGen::nextAddr
private

Address of next request.

Definition at line 109 of file strided_gen.hh.

Referenced by enter(), and getNextPacket().

◆ offset

Addr gem5::StridedGen::offset
private

Definition at line 103 of file strided_gen.hh.

Referenced by enter(), getNextPacket(), and StridedGen().

◆ strideSize

Addr gem5::StridedGen::strideSize
private

Definition at line 106 of file strided_gen.hh.

Referenced by getNextPacket().

◆ superblockSize

Addr gem5::StridedGen::superblockSize
private

Definition at line 104 of file strided_gen.hh.

Referenced by getNextPacket().


The documentation for this class was generated from the following files:

Generated on Tue Jun 18 2024 16:24:15 for gem5 by doxygen 1.11.0