Go to the documentation of this file.
44 #include "debug/TrafficGen.hh"
45 #include "enums/AddrMap.hh"
50 Addr _blocksize,
Addr cacheline_size,
52 uint8_t read_percent,
Addr data_limit,
53 unsigned int num_seq_pkts,
unsigned int page_size,
54 unsigned int nbr_of_banks_DRAM,
55 unsigned int nbr_of_banks_util,
56 Enums::AddrMap addr_mapping,
57 unsigned int nbr_of_ranks)
58 :
RandomGen(obj, requestor_id, _duration, start_addr, end_addr,
59 _blocksize, cacheline_size, min_period, max_period,
60 read_percent, data_limit),
61 numSeqPkts(num_seq_pkts), countNumSeqPkts(0),
addr(0),
62 isRead(true), pageSize(page_size),
63 pageBits(
floorLog2(page_size / _blocksize)),
66 nbrOfBanksDRAM(nbr_of_banks_DRAM),
67 nbrOfBanksUtil(nbr_of_banks_util), addrMapping(addr_mapping),
69 nbrOfRanks(nbr_of_ranks)
71 if (nbr_of_banks_util > nbr_of_banks_DRAM)
72 fatal(
"Attempting to use more banks (%d) than "
73 "what is available (%d)\n",
74 nbr_of_banks_util, nbr_of_banks_DRAM);
94 unsigned int new_bank =
98 unsigned int new_rank =
125 "size %d, countNumSeqPkts: %d, numSeqPkts: %d\n",
166 unsigned int new_col =
#define fatal(...)
This implements a cprintf based fatal() function.
void replaceBits(T &val, int first, int last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
const unsigned int nbrOfBanksDRAM
Number of banks in DRAM.
PacketPtr getNextPacket()
Get the next generated packet.
const unsigned int numSeqPkts
Number of sequential DRAM packets to be generated per cpu request.
uint64_t Tick
Tick count type.
unsigned int countNumSeqPkts
Track number of sequential packets generated for a request
const unsigned int blockBits
Number of block bits in DRAM address.
const unsigned int rankBits
Number of rank bits in DRAM address.
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
const unsigned int bankBits
Number of bank bits in DRAM address.
const uint8_t readPercent
Percent of generated transactions that should be reads.
const unsigned int pageBits
Number of page bits in DRAM address.
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.
const unsigned int nbrOfRanks
Number of ranks to be utilized for a given configuration.
Addr addr
Address of request.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
PacketPtr getPacket(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0)
Generate a new request and associated packet.
Addr dataManipulated
Counter to determine the amount of data manipulated.
const Addr blocksize
Blocksize and address increment.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
DramGen(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, unsigned int num_seq_pkts, unsigned int page_size, unsigned int nbr_of_banks_DRAM, unsigned int nbr_of_banks_util, Enums::AddrMap addr_mapping, unsigned int nbr_of_ranks)
Create a DRAM address sequence generator.
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
The random generator is similar to the linear one, but does not generate sequential addresses.
const Addr endAddr
End of address range.
bool isRead
Remember type of requests to be generated in series.
const unsigned int nbrOfBanksUtil
Number of banks to be utilized for a given configuration.
The traffic generator is a module that generates stimuli for the memory system, based on a collection...
const Addr startAddr
Start of address range.
const unsigned int pageSize
Page size of DRAM.
Enums::AddrMap addrMapping
Address mapping to be used.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17