gem5  v21.0.1.0
base.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2013, 2016-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 hereunder. 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  */
38 
39 #include <sstream>
40 
41 #include "base/intmath.hh"
42 #include "base/random.hh"
43 #include "config/have_protobuf.hh"
55 #include "debug/Checkpoint.hh"
56 #include "debug/TrafficGen.hh"
57 #include "enums/AddrMap.hh"
58 #include "params/BaseTrafficGen.hh"
59 #include "sim/sim_exit.hh"
60 #include "sim/stats.hh"
61 #include "sim/system.hh"
62 
63 #if HAVE_PROTOBUF
65 #endif
66 
67 
68 BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParams &p)
69  : ClockedObject(p),
70  system(p.system),
71  elasticReq(p.elastic_req),
72  progressCheck(p.progress_check),
73  noProgressEvent([this]{ noProgress(); }, name()),
74  nextTransitionTick(0),
75  nextPacketTick(0),
76  maxOutstandingReqs(p.max_outstanding_reqs),
77  port(name() + ".port", *this),
78  retryPkt(NULL),
79  retryPktTick(0), blockedWaitingResp(false),
80  updateEvent([this]{ update(); }, name()),
81  stats(this),
82  requestorId(system->getRequestorId(this)),
83  streamGenerator(StreamGen::create(p))
84 {
85 }
86 
88 {
89 }
90 
91 Port &
92 BaseTrafficGen::getPort(const std::string &if_name, PortID idx)
93 {
94  if (if_name == "port") {
95  return port;
96  } else {
97  return ClockedObject::getPort(if_name, idx);
98  }
99 }
100 
101 void
103 {
105 
106  if (!port.isConnected())
107  fatal("The port of %s is not connected!\n", name());
108 }
109 
112 {
113  if (!updateEvent.scheduled()) {
114  // no event has been scheduled yet (e.g. switched from atomic mode)
115  return DrainState::Drained;
116  }
117 
118  if (retryPkt == NULL) {
119  // shut things down
123  return DrainState::Drained;
124  } else {
125  return DrainState::Draining;
126  }
127 }
128 
129 void
131 {
132  warn("%s serialization does not keep all traffic generator"
133  " internal state\n", name());
134 
135  DPRINTF(Checkpoint, "Serializing BaseTrafficGen\n");
136 
137  // save ticks of the graph event if it is scheduled
138  Tick nextEvent = updateEvent.scheduled() ? updateEvent.when() : 0;
139 
140  DPRINTF(TrafficGen, "Saving nextEvent=%llu\n", nextEvent);
141 
142  SERIALIZE_SCALAR(nextEvent);
143 
145 
147 }
148 
149 void
151 {
152  warn("%s serialization does not restore all traffic generator"
153  " internal state\n", name());
154 
155  // restore scheduled events
156  Tick nextEvent;
157  UNSERIALIZE_SCALAR(nextEvent);
158  if (nextEvent != 0)
159  schedule(updateEvent, nextEvent);
160 
162 
164 }
165 
166 void
168 {
169  // shift our progress-tracking event forward
171 
172  // if we have reached the time for the next state transition, then
173  // perform the transition
174  if (curTick() >= nextTransitionTick) {
175  transition();
176  } else {
177  assert(curTick() >= nextPacketTick);
178  // get the next packet and try to send it
179  PacketPtr pkt = activeGenerator->getNextPacket();
180 
181  // If generating stream/substream IDs are enabled,
182  // try to pick and assign them to the new packet
183  if (streamGenerator) {
184  auto sid = streamGenerator->pickStreamID();
185  auto ssid = streamGenerator->pickSubstreamID();
186 
187  pkt->req->setStreamId(sid);
188 
189  if (streamGenerator->ssidValid()) {
190  pkt->req->setSubstreamId(ssid);
191  }
192  }
193 
194  // suppress packets that are not destined for a memory, such as
195  // device accesses that could be part of a trace
196  if (pkt && system->isMemAddr(pkt->getAddr())) {
197  stats.numPackets++;
198  // Only attempts to send if not blocked by pending responses
200  if (blockedWaitingResp || !port.sendTimingReq(pkt)) {
201  retryPkt = pkt;
202  retryPktTick = curTick();
203  }
204  } else if (pkt) {
205  DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
206  pkt->cmdString(), pkt->getAddr());
207 
209  if (!(static_cast<int>(stats.numSuppressed.value()) % 10000))
210  warn("%s suppressed %d packets with non-memory addresses\n",
212 
213  delete pkt;
214  pkt = nullptr;
215  }
216  }
217 
218  // if we are waiting for a retry or for a response, do not schedule any
219  // further events, in the case of a transition or a successful send, go
220  // ahead and determine when the next update should take place
221  if (retryPkt == NULL) {
222  nextPacketTick = activeGenerator->nextPacketTick(elasticReq, 0);
223  scheduleUpdate();
224  }
225 }
226 
227 void
229 {
230  if (activeGenerator)
231  activeGenerator->exit();
232 
234 
235  if (activeGenerator) {
236  const Tick duration = activeGenerator->duration;
237  if (duration != MaxTick && duration != 0) {
238  // we could have been delayed and not transitioned on the
239  // exact tick when we were supposed to (due to back
240  // pressure when sending a packet)
241  nextTransitionTick = curTick() + duration;
242  } else {
244  }
245 
246  activeGenerator->enter();
247  nextPacketTick = activeGenerator->nextPacketTick(elasticReq, 0);
248  } else {
251  assert(!updateEvent.scheduled());
252  }
253 }
254 
255 void
257 {
258  // Has the generator run out of work? In that case, force a
259  // transition if a transition period hasn't been configured.
260  while (activeGenerator &&
262  transition();
263  }
264 
265  if (!activeGenerator)
266  return;
267 
268  // schedule next update event based on either the next execute
269  // tick or the next transition, which ever comes first
270  const Tick nextEventTick = std::min(nextPacketTick, nextTransitionTick);
271 
272  DPRINTF(TrafficGen, "Next event scheduled at %lld\n", nextEventTick);
273 
274  // The next transition tick may be in the past if there was a
275  // retry, so ensure that we don't schedule anything in the past.
276  schedule(updateEvent, std::max(curTick(), nextEventTick));
277 }
278 
279 void
281 {
282  transition();
283  scheduleUpdate();
284 }
285 
286 void
288 {
289  DPRINTF(TrafficGen, "Received retry\n");
290  stats.numRetries++;
291  retryReq();
292 }
293 
294 void
296 {
297  assert(retryPkt != NULL);
298  assert(retryPktTick != 0);
299  assert(!blockedWaitingResp);
300 
301  // attempt to send the packet, and if we are successful start up
302  // the machinery again
303  if (port.sendTimingReq(retryPkt)) {
304  retryPkt = NULL;
305  // remember how much delay was incurred due to back-pressure
306  // when sending the request, we also use this to derive
307  // the tick for the next packet
308  Tick delay = curTick() - retryPktTick;
309  retryPktTick = 0;
310  stats.retryTicks += delay;
311 
312  if (drainState() != DrainState::Draining) {
313  // packet is sent, so find out when the next one is due
314  nextPacketTick = activeGenerator->nextPacketTick(elasticReq,
315  delay);
316  scheduleUpdate();
317  } else {
318  // shut things down
321  signalDrainDone();
322  }
323  }
324 }
325 
326 void
328 {
329  fatal("BaseTrafficGen %s spent %llu ticks without making progress",
330  name(), progressCheck);
331 }
332 
334  : Stats::Group(parent),
335  ADD_STAT(numSuppressed, UNIT_COUNT,
336  "Number of suppressed packets to non-memory space"),
337  ADD_STAT(numPackets, UNIT_COUNT, "Number of packets generated"),
338  ADD_STAT(numRetries, UNIT_COUNT, "Number of retries"),
339  ADD_STAT(retryTicks, UNIT_TICK,
340  "Time spent waiting due to back-pressure"),
341  ADD_STAT(bytesRead, UNIT_BYTE, "Number of bytes read"),
342  ADD_STAT(bytesWritten, UNIT_BYTE, "Number of bytes written"),
343  ADD_STAT(totalReadLatency, UNIT_TICK,
344  "Total latency of read requests"),
345  ADD_STAT(totalWriteLatency, UNIT_TICK,
346  "Total latency of write requests"),
347  ADD_STAT(totalReads, UNIT_COUNT, "Total num of reads"),
348  ADD_STAT(totalWrites, UNIT_COUNT, "Total num of writes"),
349  ADD_STAT(avgReadLatency,
350  UNIT_RATE(Stats::Units::Tick, Stats::Units::Count),
351  "Avg latency of read requests", totalReadLatency / totalReads),
352  ADD_STAT(avgWriteLatency,
353  UNIT_RATE(Stats::Units::Tick, Stats::Units::Count),
354  "Avg latency of write requests",
355  totalWriteLatency / totalWrites),
356  ADD_STAT(readBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second),
357  "Read bandwidth", bytesRead / simSeconds),
358  ADD_STAT(writeBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second),
359  "Write bandwidth", bytesWritten / simSeconds)
360 {
361 }
362 
363 std::shared_ptr<BaseGen>
365 {
366  return std::shared_ptr<BaseGen>(new IdleGen(*this, requestorId,
367  duration));
368 }
369 
370 std::shared_ptr<BaseGen>
372 {
373  return std::shared_ptr<BaseGen>(new ExitGen(*this, requestorId,
374  duration));
375 }
376 
377 std::shared_ptr<BaseGen>
379  Addr start_addr, Addr end_addr, Addr blocksize,
380  Tick min_period, Tick max_period,
381  uint8_t read_percent, Addr data_limit)
382 {
383  return std::shared_ptr<BaseGen>(new LinearGen(*this, requestorId,
384  duration, start_addr,
385  end_addr, blocksize,
387  min_period, max_period,
388  read_percent, data_limit));
389 }
390 
391 std::shared_ptr<BaseGen>
393  Addr start_addr, Addr end_addr, Addr blocksize,
394  Tick min_period, Tick max_period,
395  uint8_t read_percent, Addr data_limit)
396 {
397  return std::shared_ptr<BaseGen>(new RandomGen(*this, requestorId,
398  duration, start_addr,
399  end_addr, blocksize,
401  min_period, max_period,
402  read_percent, data_limit));
403 }
404 
405 std::shared_ptr<BaseGen>
407  Addr start_addr, Addr end_addr, Addr blocksize,
408  Tick min_period, Tick max_period,
409  uint8_t read_percent, Addr data_limit,
410  unsigned int num_seq_pkts, unsigned int page_size,
411  unsigned int nbr_of_banks,
412  unsigned int nbr_of_banks_util,
413  Enums::AddrMap addr_mapping,
414  unsigned int nbr_of_ranks)
415 {
416  return std::shared_ptr<BaseGen>(new DramGen(*this, requestorId,
417  duration, start_addr,
418  end_addr, blocksize,
420  min_period, max_period,
421  read_percent, data_limit,
422  num_seq_pkts, page_size,
423  nbr_of_banks,
424  nbr_of_banks_util,
425  addr_mapping,
426  nbr_of_ranks));
427 }
428 
429 std::shared_ptr<BaseGen>
431  Addr start_addr, Addr end_addr, Addr blocksize,
432  Tick min_period, Tick max_period,
433  uint8_t read_percent, Addr data_limit,
434  unsigned int num_seq_pkts,
435  unsigned int page_size,
436  unsigned int nbr_of_banks,
437  unsigned int nbr_of_banks_util,
438  Enums::AddrMap addr_mapping,
439  unsigned int nbr_of_ranks,
440  unsigned int max_seq_count_per_rank)
441 {
442  return std::shared_ptr<BaseGen>(new DramRotGen(*this, requestorId,
443  duration, start_addr,
444  end_addr, blocksize,
446  min_period, max_period,
447  read_percent, data_limit,
448  num_seq_pkts, page_size,
449  nbr_of_banks,
450  nbr_of_banks_util,
451  addr_mapping,
452  nbr_of_ranks,
453  max_seq_count_per_rank));
454 }
455 
456 std::shared_ptr<BaseGen>
458  Addr start_addr_dram, Addr end_addr_dram,
459  Addr blocksize_dram,
460  Addr start_addr_nvm, Addr end_addr_nvm,
461  Addr blocksize_nvm,
462  Tick min_period, Tick max_period,
463  uint8_t read_percent, Addr data_limit,
464  unsigned int num_seq_pkts_dram,
465  unsigned int page_size_dram,
466  unsigned int nbr_of_banks_dram,
467  unsigned int nbr_of_banks_util_dram,
468  unsigned int num_seq_pkts_nvm,
469  unsigned int buffer_size_nvm,
470  unsigned int nbr_of_banks_nvm,
471  unsigned int nbr_of_banks_util_nvm,
472  Enums::AddrMap addr_mapping,
473  unsigned int nbr_of_ranks_dram,
474  unsigned int nbr_of_ranks_nvm,
475  uint8_t nvm_percent)
476 {
477  return std::shared_ptr<BaseGen>(new HybridGen(*this, requestorId,
478  duration, start_addr_dram,
479  end_addr_dram, blocksize_dram,
480  start_addr_nvm,
481  end_addr_nvm, blocksize_nvm,
483  min_period, max_period,
484  read_percent, data_limit,
485  num_seq_pkts_dram,
486  page_size_dram,
487  nbr_of_banks_dram,
488  nbr_of_banks_util_dram,
489  num_seq_pkts_nvm,
490  buffer_size_nvm,
491  nbr_of_banks_nvm,
492  nbr_of_banks_util_nvm,
493  addr_mapping,
494  nbr_of_ranks_dram,
495  nbr_of_ranks_nvm,
496  nvm_percent));
497 }
498 
499 std::shared_ptr<BaseGen>
501  Addr start_addr, Addr end_addr, Addr blocksize,
502  Tick min_period, Tick max_period,
503  uint8_t read_percent, Addr data_limit,
504  unsigned int num_seq_pkts, unsigned int buffer_size,
505  unsigned int nbr_of_banks,
506  unsigned int nbr_of_banks_util,
507  Enums::AddrMap addr_mapping,
508  unsigned int nbr_of_ranks)
509 {
510  return std::shared_ptr<BaseGen>(new NvmGen(*this, requestorId,
511  duration, start_addr,
512  end_addr, blocksize,
514  min_period, max_period,
515  read_percent, data_limit,
516  num_seq_pkts, buffer_size,
517  nbr_of_banks,
518  nbr_of_banks_util,
519  addr_mapping,
520  nbr_of_ranks));
521 }
522 
523 std::shared_ptr<BaseGen>
525  Addr start_addr, Addr end_addr, Addr blocksize,
526  Addr stride_size, int gen_id,
527  Tick min_period, Tick max_period,
528  uint8_t read_percent, Addr data_limit)
529 {
530  return std::shared_ptr<BaseGen>(new StridedGen(*this, requestorId,
531  duration, start_addr,
532  end_addr, blocksize,
534  stride_size, gen_id,
535  min_period, max_period,
536  read_percent, data_limit));
537 }
538 
539 std::shared_ptr<BaseGen>
541  const std::string& trace_file, Addr addr_offset)
542 {
543 #if HAVE_PROTOBUF
544  return std::shared_ptr<BaseGen>(
545  new TraceGen(*this, requestorId, duration, trace_file, addr_offset));
546 #else
547  panic("Can't instantiate trace generation without Protobuf support!\n");
548 #endif
549 }
550 
551 bool
553 {
554  auto iter = waitingResp.find(pkt->req);
555 
556  panic_if(iter == waitingResp.end(), "%s: "
557  "Received unexpected response [%s reqPtr=%x]\n",
558  pkt->print(), pkt->req);
559 
560  assert(iter->second <= curTick());
561 
562  if (pkt->isWrite()) {
563  ++stats.totalWrites;
564  stats.bytesWritten += pkt->req->getSize();
565  stats.totalWriteLatency += curTick() - iter->second;
566  } else {
567  ++stats.totalReads;
568  stats.bytesRead += pkt->req->getSize();
569  stats.totalReadLatency += curTick() - iter->second;
570  }
571 
572  waitingResp.erase(iter);
573 
574  delete pkt;
575 
576  // Sends up the request if we were blocked
577  if (blockedWaitingResp) {
578  blockedWaitingResp = false;
579  retryReq();
580  }
581 
582  return true;
583 }
BaseTrafficGen::StatGroup::totalReadLatency
Stats::Scalar totalReadLatency
Total num of ticks read reqs took to complete
Definition: base.hh:216
BaseTrafficGen::createDramRot
std::shared_ptr< BaseGen > createDramRot(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, unsigned int nbr_of_banks_util, Enums::AddrMap addr_mapping, unsigned int nbr_of_ranks, unsigned int max_seq_count_per_rank)
Definition: base.cc:430
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:462
UNIT_BYTE
#define UNIT_BYTE
Definition: units.hh:43
NvmGen
NVM specific generator is for issuing request with variable buffer hit length and bank utilization.
Definition: nvm_gen.hh:58
warn
#define warn(...)
Definition: logging.hh:239
BaseTrafficGen::retryReq
void retryReq()
Definition: base.cc:295
system.hh
IdleGen
The idle generator does nothing.
Definition: idle_gen.hh:54
dram_gen.hh
UNSERIALIZE_SCALAR
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:591
Packet::getAddr
Addr getAddr() const
Definition: packet.hh:755
BaseTrafficGen::port
TrafficGenPort port
The instance of request port used by the traffic generator.
Definition: base.hh:161
BaseTrafficGen::recvReqRetry
void recvReqRetry()
Receive a retry from the neighbouring port and attempt to resend the waiting packet.
Definition: base.cc:287
EventManager::reschedule
void reschedule(Event &event, Tick when, bool always=false)
Definition: eventq.hh:1034
BaseTrafficGen::createRandom
std::shared_ptr< BaseGen > createRandom(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
Definition: base.cc:392
BaseTrafficGen::activeGenerator
std::shared_ptr< BaseGen > activeGenerator
Currently active generator.
Definition: base.hh:339
BaseTrafficGen::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: base.cc:92
BaseTrafficGen::transition
void transition()
Transition to the next generator.
Definition: base.cc:228
random.hh
BaseTrafficGen::allocateWaitingRespSlot
bool allocateWaitingRespSlot(PacketPtr pkt)
Puts this packet in the waitingResp list and returns true if we are above the maximum number of ousta...
Definition: base.hh:176
UNIT_TICK
#define UNIT_TICK
Definition: units.hh:40
linear_gen.hh
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:59
DramGen
DRAM specific generator is for issuing request with variable page hit length and bank utilization.
Definition: dram_gen.hh:58
PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:243
HybridGen
Hybrid NVM + DRAM specific generator is for issuing request with variable buffer hit length and bank ...
Definition: hybrid_gen.hh:58
Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:341
trace_gen.hh
BaseTrafficGen::progressCheck
const Tick progressCheck
Time to tolerate waiting for retries (not making progress), until we declare things broken.
Definition: base.hh:85
EventManager::deschedule
void deschedule(Event &event)
Definition: eventq.hh:1025
StridedGen
The strided generator generates sequential requests from a start to an end address,...
Definition: strided_gen.hh:59
BaseTrafficGen::noProgressEvent
EventFunctionWrapper noProgressEvent
Event to keep track of our progress, or lack thereof.
Definition: base.hh:115
Event::when
Tick when() const
Get the time that the event is scheduled.
Definition: eventq.hh:505
sim_exit.hh
BaseTrafficGen::createDram
std::shared_ptr< BaseGen > createDram(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, unsigned int nbr_of_banks_util, Enums::AddrMap addr_mapping, unsigned int nbr_of_ranks)
Definition: base.cc:406
Packet::print
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
Definition: packet.cc:389
ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:231
BaseTrafficGen::StatGroup::totalWrites
Stats::Scalar totalWrites
Count the number writes.
Definition: base.hh:225
BaseTrafficGen::StatGroup::bytesRead
Stats::Scalar bytesRead
Count the number of bytes read.
Definition: base.hh:210
DrainState::Drained
@ Drained
Buffers drained, ready for serialization/handover.
BaseTrafficGen::noProgress
void noProgress()
Method to inform the user we have made no progress.
Definition: base.cc:327
DrainState
DrainState
Object drain/handover states.
Definition: drain.hh:71
exit_gen.hh
stats.hh
X86ISA::system
Bitfield< 15 > system
Definition: misc.hh:997
LinearGen
The linear generator generates sequential requests from a start to an end address,...
Definition: linear_gen.hh:59
cp
Definition: cprintf.cc:37
EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1016
BaseTrafficGen::createHybrid
std::shared_ptr< BaseGen > createHybrid(Tick duration, Addr start_addr_dram, Addr end_addr_dram, Addr blocksize_dram, Addr start_addr_nvm, Addr end_addr_nvm, Addr blocksize_nvm, 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)
Definition: base.cc:457
hybrid_gen.hh
BaseTrafficGen::nextTransitionTick
Tick nextTransitionTick
Time of next transition.
Definition: base.hh:118
Stats::ScalarBase::value
Counter value() const
Return the current value of this stat as its base type.
Definition: statistics.hh:603
strided_gen.hh
RequestPort::sendTimingReq
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
Definition: port.hh:492
BaseTrafficGen::retryPkt
PacketPtr retryPkt
Packet waiting to be sent.
Definition: base.hh:164
SimObject::getPort
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Definition: sim_object.cc:120
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
ADD_STAT
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition: group.hh:71
Packet::cmdString
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition: packet.hh:552
BaseTrafficGen::createLinear
std::shared_ptr< BaseGen > createLinear(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
Definition: base.cc:378
DramRotGen
Definition: dram_rot_gen.hh:53
BaseTrafficGen::drain
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Definition: base.cc:111
Port
Ports are used to interface objects to each other.
Definition: port.hh:56
BaseTrafficGen::StatGroup::numRetries
Stats::Scalar numRetries
Count the number of retries.
Definition: base.hh:204
BaseTrafficGen::nextGenerator
virtual std::shared_ptr< BaseGen > nextGenerator()=0
BaseTrafficGen::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: base.cc:102
BaseTrafficGen::createTrace
std::shared_ptr< BaseGen > createTrace(Tick duration, const std::string &trace_file, Addr addr_offset)
Definition: base.cc:540
BaseTrafficGen::StatGroup::totalWriteLatency
Stats::Scalar totalWriteLatency
Total num of ticks write reqs took to complete
Definition: base.hh:219
Drainable::signalDrainDone
void signalDrainDone() const
Signal that an object is drained.
Definition: drain.hh:301
StreamGen::create
static StreamGen * create(const BaseTrafficGenParams &p)
Factory method for constructing a Stream generator.
Definition: stream_gen.cc:43
BaseTrafficGen::blockedWaitingResp
bool blockedWaitingResp
Set when we blocked waiting for outstanding reqs.
Definition: base.hh:170
BaseTrafficGen::streamGenerator
std::unique_ptr< StreamGen > streamGenerator
Stream/SubstreamID Generator.
Definition: base.hh:342
BaseTrafficGen::createStrided
std::shared_ptr< BaseGen > createStrided(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Addr stride_size, int gen_id, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
Definition: base.cc:524
BaseTrafficGen::StatGroup::numPackets
Stats::Scalar numPackets
Count the number of generated packets.
Definition: base.hh:201
UNIT_COUNT
#define UNIT_COUNT
Definition: units.hh:49
base.hh
dram_rot_gen.hh
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
simSeconds
Stats::Formula & simSeconds
Definition: stats.cc:42
name
const std::string & name()
Definition: trace.cc:48
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:584
BaseTrafficGen::waitingResp
std::unordered_map< RequestPtr, Tick > waitingResp
Reqs waiting for response.
Definition: base.hh:192
BaseTrafficGen::start
void start()
Definition: base.cc:280
LaneSize::Byte
@ Byte
BaseTrafficGen::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: base.cc:130
Drainable::drainState
DrainState drainState() const
Return the current drain state of an object.
Definition: drain.hh:320
BaseTrafficGen::BaseTrafficGen
BaseTrafficGen(const BaseTrafficGenParams &p)
Definition: base.cc:68
stream_gen.hh
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:182
BaseTrafficGen::StatGroup::numSuppressed
Stats::Scalar numSuppressed
Count the number of dropped requests.
Definition: base.hh:198
UNIT_RATE
#define UNIT_RATE(T1, T2)
Definition: units.hh:47
BaseTrafficGen::StatGroup::StatGroup
StatGroup(Stats::Group *parent)
Definition: base.cc:333
ExitGen
The exit generator exits from the simulation once entered.
Definition: exit_gen.hh:52
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:197
random_gen.hh
BaseTrafficGen::scheduleUpdate
void scheduleUpdate()
Schedule the update event based on nextPacketTick and nextTransitionTick.
Definition: base.cc:256
BaseTrafficGen::nextPacketTick
Tick nextPacketTick
Time of the next packet.
Definition: base.hh:121
BaseTrafficGen::requestorId
const RequestorID requestorId
RequestorID used in generated requests.
Definition: base.hh:336
BaseTrafficGen::StatGroup::totalReads
Stats::Scalar totalReads
Count the number reads.
Definition: base.hh:222
BaseTrafficGen::~BaseTrafficGen
~BaseTrafficGen()
Definition: base.cc:87
idle_gen.hh
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:258
Stats::Group
Statistics container.
Definition: group.hh:87
BaseTrafficGen::recvTimingResp
bool recvTimingResp(PacketPtr pkt)
Definition: base.cc:552
BaseTrafficGen::updateEvent
EventFunctionWrapper updateEvent
Event for scheduling updates.
Definition: base.hh:188
Port::isConnected
bool isConnected() const
Is this port currently connected to a peer?
Definition: port.hh:128
BaseTrafficGen::stats
BaseTrafficGen::StatGroup stats
SimObject::init
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: sim_object.cc:70
Packet::isWrite
bool isWrite() const
Definition: packet.hh:558
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:64
BaseTrafficGen::createIdle
std::shared_ptr< BaseGen > createIdle(Tick duration)
Definition: base.cc:364
RandomGen
The random generator is similar to the linear one, but does not generate sequential addresses.
Definition: random_gen.hh:57
Stats
Definition: statistics.cc:53
curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:43
BaseTrafficGen::retryPktTick
Tick retryPktTick
Tick when the stalled packet was meant to be sent.
Definition: base.hh:167
BaseTrafficGen::elasticReq
const bool elasticReq
Determine whether to add elasticity in the request injection, thus responding to backpressure by slow...
Definition: base.hh:79
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
intmath.hh
BaseTrafficGen::StatGroup::retryTicks
Stats::Scalar retryTicks
Count the time incurred from back-pressure.
Definition: base.hh:207
System::cacheLineSize
unsigned int cacheLineSize() const
Get the cache line size of the system.
Definition: system.hh:302
CheckpointIn
Definition: serialize.hh:68
System::isMemAddr
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
Definition: system.cc:407
TraceGen
The trace replay generator reads a trace file and plays back the transactions.
Definition: trace_gen.hh:58
MaxTick
const Tick MaxTick
Definition: types.hh:61
BaseTrafficGen::createExit
std::shared_ptr< BaseGen > createExit(Tick duration)
Definition: base.cc:371
TrafficGen
The traffic generator is a module that generates stimuli for the memory system, based on a collection...
Definition: traffic_gen.hh:67
base_gen.hh
BaseTrafficGen::system
System *const system
The system used to determine which mode we are currently operating in.
Definition: base.hh:73
DrainState::Draining
@ Draining
Draining buffers pending serialization/handover.
BaseTrafficGen::update
void update()
Schedules event for next update and generates a new packet or requests a new generatoir depending on ...
Definition: base.cc:167
BaseTrafficGen::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: base.cc:150
BaseTrafficGen::createNvm
std::shared_ptr< BaseGen > createNvm(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 buffer_size, unsigned int nbr_of_banks, unsigned int nbr_of_banks_util, Enums::AddrMap addr_mapping, unsigned int nbr_of_ranks)
Definition: base.cc:500
BaseTrafficGen::StatGroup::bytesWritten
Stats::Scalar bytesWritten
Count the number of bytes written.
Definition: base.hh:213
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
nvm_gen.hh

Generated on Tue Jun 22 2021 15:28:25 for gem5 by doxygen 1.8.17