gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
LinearGen Class Reference

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

#include <linear_gen.hh>

Inheritance diagram for LinearGen:
StochasticGen BaseGen

Public Member Functions

 LinearGen (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 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 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 BaseGen
 BaseGen (SimObject &obj, RequestorID requestor_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

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 StochasticGen
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 Addr cacheLineSize
 Cache line size in the simulated system. 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...
 
- Protected Attributes inherited from BaseGen
const std::string _name
 Name to use for status and debug printing. More...
 
const RequestorID requestorId
 The RequestorID used for generating requests. More...
 

Detailed Description

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 59 of file linear_gen.hh.

Constructor & Destructor Documentation

◆ LinearGen()

LinearGen::LinearGen ( 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 
)
inline

Create a linear 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
_durationduration of this state before transitioning
start_addrStart address
end_addrEnd address
_blocksizeSize used for transactions injected
cacheline_sizecache line size in the system
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 81 of file linear_gen.hh.

Member Function Documentation

◆ enter()

void LinearGen::enter ( )
virtual

Enter this generator state.

Implements BaseGen.

Definition at line 47 of file linear_gen.cc.

References dataManipulated, nextAddr, and StochasticGen::startAddr.

◆ getNextPacket()

PacketPtr LinearGen::getNextPacket ( )
virtual

Get the next generated packet.

Returns
A packet to be sent at the current tick

Implements BaseGen.

Definition at line 55 of file linear_gen.cc.

References StochasticGen::blocksize, dataManipulated, DPRINTF, StochasticGen::endAddr, BaseGen::getPacket(), nextAddr, Random::random(), random_mt, StochasticGen::readPercent, MemCmd::ReadReq, StochasticGen::startAddr, and MemCmd::WriteReq.

◆ nextPacketTick()

Tick LinearGen::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 BaseGen.

Definition at line 88 of file linear_gen.cc.

References curTick(), StochasticGen::dataLimit, dataManipulated, DPRINTF, StochasticGen::maxPeriod, MaxTick, StochasticGen::minPeriod, Random::random(), random_mt, and sc_core::wait().

Member Data Documentation

◆ dataManipulated

Addr LinearGen::dataManipulated
private

Counter to determine the amount of data manipulated.

Used to determine if we should continue generating requests.

Definition at line 109 of file linear_gen.hh.

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

◆ nextAddr

Addr LinearGen::nextAddr
private

Address of next request.

Definition at line 102 of file linear_gen.hh.

Referenced by enter(), and getNextPacket().


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

Generated on Wed Sep 30 2020 14:02:26 for gem5 by doxygen 1.8.17