Go to the documentation of this file.
46 #include "debug/TrafficGen.hh"
47 #include "enums/AddrMap.hh"
53 Addr start_addr_dram,
Addr end_addr_dram,
55 Addr start_addr_nvm,
Addr end_addr_nvm,
59 uint8_t read_percent,
Addr data_limit,
60 unsigned int num_seq_pkts_dram,
unsigned int page_size_dram,
61 unsigned int nbr_of_banks_dram,
62 unsigned int nbr_of_banks_util_dram,
63 unsigned int num_seq_pkts_nvm,
unsigned int buffer_size_nvm,
64 unsigned int nbr_of_banks_nvm,
65 unsigned int nbr_of_banks_util_nvm,
66 Enums::AddrMap addr_mapping,
67 unsigned int nbr_of_ranks_dram,
68 unsigned int nbr_of_ranks_nvm,
70 :
BaseGen(obj, requestor_id, _duration),
71 startAddrDram(start_addr_dram),
72 endAddrDram(end_addr_dram),
73 blocksizeDram(blocksize_dram),
74 startAddrNvm(start_addr_nvm),
75 endAddrNvm(end_addr_nvm),
76 blocksizeNvm(blocksize_nvm),
77 cacheLineSize(cacheline_size),
78 minPeriod(min_period), maxPeriod(max_period),
79 readPercent(read_percent), dataLimit(data_limit),
80 numSeqPktsDram(num_seq_pkts_dram),
81 numSeqPktsNvm(num_seq_pkts_nvm),
82 countNumSeqPkts(0),
addr(0),
83 pageSizeDram(page_size_dram),
84 pageBitsDram(
floorLog2(pageSizeDram / blocksizeDram)),
85 bankBitsDram(
floorLog2(nbr_of_banks_dram)),
87 nbrOfBanksDram(nbr_of_banks_dram),
88 nbrOfBanksUtilDram(nbr_of_banks_util_dram),
89 bufferSizeNvm(buffer_size_nvm),
90 pageBitsNvm(
floorLog2(bufferSizeNvm / blocksizeNvm)),
93 nbrOfBanksNvm(nbr_of_banks_nvm),
94 nbrOfBanksUtilNvm(nbr_of_banks_util_nvm),
95 addrMapping(addr_mapping),
96 nbrOfRanksDram(nbr_of_ranks_dram),
98 nbrOfRanksNvm(nbr_of_ranks_nvm),
100 nvmPercent(nvm_percent),
106 fatal(
"TrafficGen %s Dram block size (%d) is larger than "
107 "cache line size (%d)\n",
name(),
111 fatal(
"TrafficGen %s Nvm block size (%d) is larger than "
112 "cache line size (%d)\n",
name(),
116 fatal(
"%s cannot have more than 100% reads",
name());
119 fatal(
"%s cannot have min_period > max_period",
name());
122 fatal(
"Attempting to use more Dram banks (%d) than "
123 "what is available (%d)\n",
127 fatal(
"Attempting to use more Nvm banks (%d) than "
128 "what is available (%d)\n",
189 unsigned int new_bank =
193 unsigned int new_rank =
221 "size %d, countNumSeqPkts: %d, numSeqPkts: %d\n",
262 unsigned int new_col =
#define fatal(...)
This implements a cprintf based fatal() function.
Addr addr
Address of request.
Base class for all generators, with the shared functionality and virtual functions for entering,...
Addr endAddr
End of address range.
const unsigned int blockBitsDram
Number of block bits in DRAM address.
Enums::AddrMap addrMapping
Address mapping to be used.
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 Addr cacheLineSize
Cache line size in the simulated system.
const Addr startAddrNvm
Start of DRAM address range.
const unsigned int bufferSizeNvm
Buffer size of NVM.
Addr dataManipulated
Counter to determine the amount of data manipulated.
uint64_t Tick
Tick count type.
const uint8_t readPercent
Percent of generated transactions that should be reads.
const unsigned int pageBitsNvm
Number of buffer bits in NVM address.
unsigned int countNumSeqPkts
Track number of sequential packets generated for a request
bool isNvm
Remember the interface to be generated in series.
unsigned int blockBits
Number of block bits in DRAM address.
const Addr blocksizeNvm
Blocksize and address increment for DRAM.
const unsigned int numSeqPktsNvm
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
std::string name() const
Get the name, useful for DPRINTFs.
const unsigned int pageBitsDram
Number of page bits in DRAM address.
const unsigned int bankBitsDram
Number of bank bits in DRAM address.
const Addr dataLimit
Maximum amount of data to manipulate.
PacketPtr getNextPacket()
Get the next generated packet.
Addr startAddr
Start of address range.
const Addr endAddrNvm
End of DRAM address range.
const unsigned int pageSizeDram
Page size of DRAM.
unsigned int nbrOfRanks
Number of ranks to be utilized for a given configuration.
const unsigned int numSeqPktsDram
Number of sequential packets to be generated per cpu request.
const unsigned int nbrOfRanksDram
Number of ranks to be utilized for a given configuration.
const uint8_t nvmPercent
Percent of generated transactions that should go to NVM.
const unsigned int nbrOfBanksUtilNvm
Number of banks to be utilized for a given configuration.
unsigned int rankBits
Number of rank bits in DRAM address.
const Addr startAddrDram
Start of DRAM address range.
unsigned int pageBits
Number of page bits in DRAM address.
const unsigned int nbrOfRanksNvm
Number of ranks to be utilized for a given configuration.
const unsigned int rankBitsDram
Number of rank bits in DRAM address.
unsigned int bankBits
Number of bank bits in DRAM address.
const unsigned int nbrOfBanksUtilDram
Number of banks to be utilized for a given configuration.
void enter()
Enter this generator state.
const unsigned int rankBitsNvm
Number of rank bits in DRAM address.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Tick nextPacketTick(bool elastic, Tick delay) const
Determine the tick when the next packet is available.
unsigned int pageSize
Page size of DRAM.
const unsigned int blockBitsNvm
Number of block bits in NVM address.
Addr blocksize
Blocksize and address increment.
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.
HybridGen(SimObject &obj, RequestorID requestor_id, Tick _duration, Addr start_addr_dram, Addr end_addr_dram, Addr blocksize_dram, Addr start_addr_nvm, Addr end_addr_nvm, Addr blocksize_nvm, Addr cacheline_size, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit, unsigned int num_seq_pkts_dram, unsigned int page_size_dram, unsigned int nbr_of_banks_dram, unsigned int nbr_of_banks_util_dram, unsigned int num_seq_pkts_nvm, unsigned int buffer_size_nvm, unsigned int nbr_of_banks_nvm, unsigned int nbr_of_banks_util_nvm, Enums::AddrMap addr_mapping, unsigned int nbr_of_ranks_dram, unsigned int nbr_of_ranks_nvm, uint8_t nvm_percent)
Create a hybrid DRAM + NVM address sequence generator.
PacketPtr getPacket(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0)
Generate a new request and associated packet.
unsigned int numSeqPkts
Number of sequential DRAM packets to be generated per cpu request.
unsigned int nbrOfBanksUtil
Number of banks to be utilized for a given configuration.
const unsigned int nbrOfBanksNvm
Number of banks in NVM.
unsigned int nbrOfBanks
Number of banks in DRAM.
Overload hash function for BasicBlockRange type.
const Tick minPeriod
Request generation period.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
const Addr endAddrDram
End of DRAM address range.
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...
bool isRead
Remember type of requests to be generated in series.
const Addr blocksizeDram
Blocksize and address increment for DRAM.
const unsigned int bankBitsNvm
Number of bank bits in NVM address.
The traffic generator is a module that generates stimuli for the memory system, based on a collection...
Tick curTick()
The current simulated tick.
const unsigned int nbrOfBanksDram
Number of banks in DRAM.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17