gem5  v20.1.0.0
hybrid_gen.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed here under. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  * Authors: Wendy Elsasser
38  */
39 
46 #ifndef __CPU_TRAFFIC_GEN_HYBRID_GEN_HH__
47 #define __CPU_TRAFFIC_GEN_HYBRID_GEN_HH__
48 
49 #include "base/bitfield.hh"
50 #include "base/intmath.hh"
51 #include "base_gen.hh"
52 #include "enums/AddrMap.hh"
53 #include "mem/packet.hh"
54 
60 class HybridGen : public BaseGen
61 {
62 
63  public:
64 
98  HybridGen(SimObject &obj,
99  RequestorID requestor_id, Tick _duration,
100  Addr start_addr_dram, Addr end_addr_dram,
101  Addr blocksize_dram,
102  Addr start_addr_nvm, Addr end_addr_nvm,
103  Addr blocksize_nvm,
104  Addr cacheline_size,
105  Tick min_period, Tick max_period,
106  uint8_t read_percent, Addr data_limit,
107  unsigned int num_seq_pkts_dram, unsigned int page_size_dram,
108  unsigned int nbr_of_banks_dram, unsigned int nbr_of_banks_util_dram,
109  unsigned int num_seq_pkts_nvm, unsigned int buffer_size_nvm,
110  unsigned int nbr_of_banks_nvm, unsigned int nbr_of_banks_util_nvm,
111  Enums::AddrMap addr_mapping,
112  unsigned int nbr_of_ranks_dram,
113  unsigned int nbr_of_ranks_nvm,
114  uint8_t nvm_percent);
115 
116  void enter();
117 
119 
126  void genStartAddr(unsigned int new_bank , unsigned int new_rank);
127 
128  Tick nextPacketTick(bool elastic, Tick delay) const;
129 
130  protected:
133 
136 
139 
142 
145 
148 
151 
155 
157  const uint8_t readPercent;
158 
161 
163  const unsigned int numSeqPktsDram;
164  const unsigned int numSeqPktsNvm;
165 
167  unsigned int countNumSeqPkts;
168 
171 
173  const unsigned int pageSizeDram;
174 
176  const unsigned int pageBitsDram;
177 
179  const unsigned int bankBitsDram;
180 
182  const unsigned int blockBitsDram;
183 
185  const unsigned int nbrOfBanksDram;
186 
188  const unsigned int nbrOfBanksUtilDram;
189 
191  const unsigned int bufferSizeNvm;
192 
194  const unsigned int pageBitsNvm;
195 
197  const unsigned int bankBitsNvm;
198 
200  const unsigned int blockBitsNvm;
201 
203  const unsigned int nbrOfBanksNvm;
204 
206  const unsigned int nbrOfBanksUtilNvm;
207 
209  Enums::AddrMap addrMapping;
210 
212  const unsigned int nbrOfRanksDram;
213 
215  const unsigned int rankBitsDram;
216 
218  const unsigned int nbrOfRanksNvm;
219 
221  const unsigned int rankBitsNvm;
222 
224  const uint8_t nvmPercent;
225 
227  bool isRead;
228 
230  bool isNvm;
231 
238 
240  unsigned int numSeqPkts;
241 
244 
247 
250 
252  unsigned int pageSize;
253 
255  unsigned int pageBits;
256 
258  unsigned int bankBits;
259 
261  unsigned int blockBits;
262 
264  unsigned int nbrOfBanks;
265 
267  unsigned int nbrOfBanksUtil;
268 
270  unsigned int nbrOfRanks;
271 
273  unsigned int rankBits;
274 
275 };
276 
277 #endif
HybridGen::addr
Addr addr
Address of request.
Definition: hybrid_gen.hh:170
BaseGen
Base class for all generators, with the shared functionality and virtual functions for entering,...
Definition: base_gen.hh:57
HybridGen::endAddr
Addr endAddr
End of address range.
Definition: hybrid_gen.hh:246
HybridGen::blockBitsDram
const unsigned int blockBitsDram
Number of block bits in DRAM address.
Definition: hybrid_gen.hh:182
HybridGen::addrMapping
Enums::AddrMap addrMapping
Address mapping to be used.
Definition: hybrid_gen.hh:209
HybridGen::cacheLineSize
const Addr cacheLineSize
Cache line size in the simulated system.
Definition: hybrid_gen.hh:150
HybridGen::startAddrNvm
const Addr startAddrNvm
Start of DRAM address range.
Definition: hybrid_gen.hh:141
HybridGen::bufferSizeNvm
const unsigned int bufferSizeNvm
Buffer size of NVM.
Definition: hybrid_gen.hh:191
HybridGen::dataManipulated
Addr dataManipulated
Counter to determine the amount of data manipulated.
Definition: hybrid_gen.hh:237
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
HybridGen::readPercent
const uint8_t readPercent
Percent of generated transactions that should be reads.
Definition: hybrid_gen.hh:157
HybridGen::pageBitsNvm
const unsigned int pageBitsNvm
Number of buffer bits in NVM address.
Definition: hybrid_gen.hh:194
HybridGen::countNumSeqPkts
unsigned int countNumSeqPkts
Track number of sequential packets generated for a request
Definition: hybrid_gen.hh:167
HybridGen::isNvm
bool isNvm
Remember the interface to be generated in series.
Definition: hybrid_gen.hh:230
HybridGen::blockBits
unsigned int blockBits
Number of block bits in DRAM address.
Definition: hybrid_gen.hh:261
HybridGen::blocksizeNvm
const Addr blocksizeNvm
Blocksize and address increment for DRAM.
Definition: hybrid_gen.hh:147
HybridGen
Hybrid NVM + DRAM specific generator is for issuing request with variable buffer hit length and bank ...
Definition: hybrid_gen.hh:60
HybridGen::numSeqPktsNvm
const unsigned int numSeqPktsNvm
Definition: hybrid_gen.hh:164
HybridGen::pageBitsDram
const unsigned int pageBitsDram
Number of page bits in DRAM address.
Definition: hybrid_gen.hh:176
HybridGen::bankBitsDram
const unsigned int bankBitsDram
Number of bank bits in DRAM address.
Definition: hybrid_gen.hh:179
HybridGen::dataLimit
const Addr dataLimit
Maximum amount of data to manipulate.
Definition: hybrid_gen.hh:160
HybridGen::getNextPacket
PacketPtr getNextPacket()
Get the next generated packet.
Definition: hybrid_gen.cc:140
packet.hh
HybridGen::startAddr
Addr startAddr
Start of address range.
Definition: hybrid_gen.hh:243
HybridGen::endAddrNvm
const Addr endAddrNvm
End of DRAM address range.
Definition: hybrid_gen.hh:144
RequestorID
uint16_t RequestorID
Definition: request.hh:85
HybridGen::pageSizeDram
const unsigned int pageSizeDram
Page size of DRAM.
Definition: hybrid_gen.hh:173
HybridGen::nbrOfRanks
unsigned int nbrOfRanks
Number of ranks to be utilized for a given configuration.
Definition: hybrid_gen.hh:270
bitfield.hh
HybridGen::numSeqPktsDram
const unsigned int numSeqPktsDram
Number of sequential packets to be generated per cpu request.
Definition: hybrid_gen.hh:163
HybridGen::nbrOfRanksDram
const unsigned int nbrOfRanksDram
Number of ranks to be utilized for a given configuration.
Definition: hybrid_gen.hh:212
HybridGen::nvmPercent
const uint8_t nvmPercent
Percent of generated transactions that should go to NVM.
Definition: hybrid_gen.hh:224
HybridGen::nbrOfBanksUtilNvm
const unsigned int nbrOfBanksUtilNvm
Number of banks to be utilized for a given configuration.
Definition: hybrid_gen.hh:206
HybridGen::rankBits
unsigned int rankBits
Number of rank bits in DRAM address.
Definition: hybrid_gen.hh:273
HybridGen::startAddrDram
const Addr startAddrDram
Start of DRAM address range.
Definition: hybrid_gen.hh:132
HybridGen::pageBits
unsigned int pageBits
Number of page bits in DRAM address.
Definition: hybrid_gen.hh:255
HybridGen::nbrOfRanksNvm
const unsigned int nbrOfRanksNvm
Number of ranks to be utilized for a given configuration.
Definition: hybrid_gen.hh:218
HybridGen::rankBitsDram
const unsigned int rankBitsDram
Number of rank bits in DRAM address.
Definition: hybrid_gen.hh:215
HybridGen::bankBits
unsigned int bankBits
Number of bank bits in DRAM address.
Definition: hybrid_gen.hh:258
HybridGen::nbrOfBanksUtilDram
const unsigned int nbrOfBanksUtilDram
Number of banks to be utilized for a given configuration.
Definition: hybrid_gen.hh:188
HybridGen::enter
void enter()
Enter this generator state.
Definition: hybrid_gen.cc:133
HybridGen::rankBitsNvm
const unsigned int rankBitsNvm
Number of rank bits in DRAM address.
Definition: hybrid_gen.hh:221
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
HybridGen::nextPacketTick
Tick nextPacketTick(bool elastic, Tick delay) const
Determine the tick when the next packet is available.
Definition: hybrid_gen.cc:288
HybridGen::pageSize
unsigned int pageSize
Page size of DRAM.
Definition: hybrid_gen.hh:252
HybridGen::blockBitsNvm
const unsigned int blockBitsNvm
Number of block bits in NVM address.
Definition: hybrid_gen.hh:200
HybridGen::blocksize
Addr blocksize
Blocksize and address increment.
Definition: hybrid_gen.hh:249
HybridGen::genStartAddr
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.
Definition: hybrid_gen.cc:239
HybridGen::HybridGen
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.
Definition: hybrid_gen.cc:51
HybridGen::numSeqPkts
unsigned int numSeqPkts
Number of sequential DRAM packets to be generated per cpu request.
Definition: hybrid_gen.hh:240
HybridGen::nbrOfBanksUtil
unsigned int nbrOfBanksUtil
Number of banks to be utilized for a given configuration.
Definition: hybrid_gen.hh:267
HybridGen::nbrOfBanksNvm
const unsigned int nbrOfBanksNvm
Number of banks in NVM.
Definition: hybrid_gen.hh:203
HybridGen::maxPeriod
const Tick maxPeriod
Definition: hybrid_gen.hh:154
HybridGen::nbrOfBanks
unsigned int nbrOfBanks
Number of banks in DRAM.
Definition: hybrid_gen.hh:264
HybridGen::minPeriod
const Tick minPeriod
Request generation period.
Definition: hybrid_gen.hh:153
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
HybridGen::endAddrDram
const Addr endAddrDram
End of DRAM address range.
Definition: hybrid_gen.hh:135
HybridGen::isRead
bool isRead
Remember type of requests to be generated in series.
Definition: hybrid_gen.hh:227
intmath.hh
HybridGen::blocksizeDram
const Addr blocksizeDram
Blocksize and address increment for DRAM.
Definition: hybrid_gen.hh:138
HybridGen::bankBitsNvm
const unsigned int bankBitsNvm
Number of bank bits in NVM address.
Definition: hybrid_gen.hh:197
base_gen.hh
HybridGen::nbrOfBanksDram
const unsigned int nbrOfBanksDram
Number of banks in DRAM.
Definition: hybrid_gen.hh:185
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:92

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