50 #ifndef __CPU_TRAFFIC_GEN_GENERATORS_HH__
51 #define __CPU_TRAFFIC_GEN_GENERATORS_HH__
111 virtual void enter() = 0;
147 :
BaseGen(_name, master_id, _duration)
188 uint8_t read_percent,
Addr data_limit)
189 :
BaseGen(_name, master_id, _duration),
265 uint8_t read_percent,
Addr data_limit)
266 :
BaseGen(_name, master_id, _duration),
345 uint8_t read_percent,
Addr data_limit,
346 unsigned int num_seq_pkts,
unsigned int page_size,
347 unsigned int nbr_of_banks_DRAM,
unsigned int nbr_of_banks_util,
348 unsigned int addr_mapping,
349 unsigned int nbr_of_ranks)
350 :
RandomGen(_name, master_id, _duration, start_addr, end_addr,
351 _blocksize, min_period, max_period, read_percent, data_limit),
364 warn(
"Unknown address mapping specified, using RoRaBaCoCh\n");
376 void genStartAddr(
unsigned int new_bank ,
unsigned int new_rank);
456 uint8_t read_percent,
Addr data_limit,
457 unsigned int num_seq_pkts,
unsigned int page_size,
458 unsigned int nbr_of_banks_DRAM,
unsigned int nbr_of_banks_util,
459 unsigned int addr_mapping,
460 unsigned int nbr_of_ranks,
461 unsigned int max_seq_count_per_rank)
462 :
DramGen(_name, master_id, _duration, start_addr, end_addr,
463 _blocksize, min_period, max_period, read_percent, data_limit,
464 num_seq_pkts, page_size, nbr_of_banks_DRAM,
465 nbr_of_banks_util, addr_mapping,
473 fatal(
"%s: Unsupported read percentage for DramRotGen: %d",
596 const std::string& trace_file,
Addr addr_offset)
597 :
BaseGen(_name, master_id, _duration),
const Tick duration
Time to spend in this state.
const Addr blocksize
Block size.
bool traceComplete
Set to true when the trace replay for one instance of state is complete.
const unsigned int numSeqPkts
Number of sequential DRAM packets to be generated per cpu request.
RandomGen(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 random address sequence generator.
std::string name() const
Get the name, useful for DPRINTFs.
void enter()
Enter this generator state.
BaseGen(const std::string &_name, MasterID master_id, Tick _duration)
Create a base generator.
virtual void enter()=0
Enter this generator state.
const Tick minPeriod
Request generation period.
const Tick minPeriod
Request generation period.
The linear generator generates sequential requests from a start to an end address, with a fixed block size.
void enter()
Enter this generator state.
void genStartAddr(unsigned int new_bank, unsigned int new_rank)
Insert bank, rank, and column bits into packed address to create address for 1st command in a series...
PacketPtr getPacket(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0)
Generate a new request and associated packet.
PacketPtr getNextPacket()
Get the next generated packet.
virtual PacketPtr getNextPacket()=0
Get the next generated packet.
unsigned int countNumSeqPkts
Track number of sequential packets generated for a request.
const unsigned int nbrOfBanksDRAM
Number of banks in DRAM.
void clear()
Make this element invalid.
Tick tick
The time at which the request should be sent.
bool isRead
Remember type of requests to be generated in series.
const Addr endAddr
End of address range.
virtual void exit()
Exit this generator state.
DramRotGen(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, unsigned int num_seq_pkts, unsigned int page_size, unsigned int nbr_of_banks_DRAM, unsigned int nbr_of_banks_util, unsigned int addr_mapping, unsigned int nbr_of_ranks, unsigned int max_seq_count_per_rank)
Create a DRAM address sequence generator.
PacketPtr getNextPacket()
Get the next generated packet.
const unsigned int bankBits
Number of bank bits in DRAM address.
const Addr startAddr
Start of address range.
unsigned int addrMapping
Address mapping to be used.
const uint8_t readPercent
Percent of generated transactions that should be reads.
Tick nextPacketTick(bool elastic, Tick delay) const
Determine the tick when the next packet is available.
Tick nextPacketTick(bool elastic, Tick delay) const
Determine the tick when the next packet is available.
const Addr dataLimit
Maximum amount of data to manipulate.
unsigned int nextSeqCount
Next packet series count used to set rank and bank, and update isRead Incremented at the start of a n...
TraceElement currElement
Store the current and next element in the trace.
MemCmd cmd
Specifies if the request is to be a read or a write.
PacketPtr getNextPacket()
Get the next generated packet.
void enter()
Enter this generator state.
const MasterID masterID
The MasterID used for generating requests.
const Addr dataLimit
Maximum amount of data to manipulate.
IdleGen(const std::string &_name, MasterID master_id, Tick _duration)
The idle generator does nothing.
The trace replay generator reads a trace file and plays back the transactions.
virtual Tick nextPacketTick(bool elastic, Tick delay) const =0
Determine the tick when the next packet is available.
Addr nextAddr
Address of next request.
const Addr blocksize
Blocksize and address increment.
void exit()
Exit this generator state.
const unsigned int blockBits
Number of block bits in DRAM address.
This struct stores a line in the trace file.
uint64_t Tick
Tick count type.
Request::FlagsType flags
Potential request flags to use.
const unsigned int nbrOfBanksUtil
Number of banks to be utilized for a given configuration.
Tick nextPacketTick(bool elastic, Tick delay) const
Returns the tick when the next request should be generated.
DRAM specific generator is for issuing request with variable page hit length and bank utilization...
void enter()
Enter this generator state.
const unsigned int pageBits
Number of page bits in DRAM address.
Addr blocksize
The size of the access for the request.
Tick nextPacketTick(bool elastic, Tick delay) const
Determine the tick when the next packet is available.
const unsigned int rankBits
Number of rank bits in DRAM address.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const unsigned int nbrOfRanks
Number of ranks to be utilized for a given configuration.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
InputStream trace
Input stream used for reading the input trace file.
Addr addrOffset
Offset for memory requests.
const Addr endAddr
End of address range.
Addr addr
The address for the request.
bool isValid() const
Check validity of this element.
PacketPtr getNextPacket()
Get the next generated packet.
Addr dataManipulated
Counter to determine the amount of data manipulated.
int floorLog2(unsigned x)
const uint8_t readPercent
Percent of generated transactions that should be reads.
Declaration of the Packet class.
Addr addr
Address of request.
TraceGen(const std::string &_name, MasterID master_id, Tick _duration, const std::string &trace_file, Addr addr_offset)
Create a trace generator.
Tick tickOffset
Stores the time when the state was entered.
The random generator is similar to the linear one, but does not generate sequential addresses...
PacketPtr getNextPacket()
Get the next generated packet.
PacketPtr getNextPacket()
Get the next generated packet.
DramGen(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, unsigned int num_seq_pkts, unsigned int page_size, unsigned int nbr_of_banks_DRAM, unsigned int nbr_of_banks_util, unsigned int addr_mapping, unsigned int nbr_of_ranks)
Create a DRAM address sequence generator.
const unsigned int pageSize
Page size of DRAM.
const Addr startAddr
Start of address range.
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.
const unsigned int maxSeqCountPerRank
Number of command series issued before the rank is changed.
Base class for all generators, with the shared functionality and virtual functions for entering...
Declaration of a wrapper for protobuf output streams and input streams.
const std::string _name
Name to use for status and debug printing.
Addr dataManipulated
Counter to determine the amount of data manipulated.