gem5  v20.1.0.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"
54 #include "debug/Checkpoint.hh"
55 #include "debug/TrafficGen.hh"
56 #include "enums/AddrMap.hh"
57 #include "params/BaseTrafficGen.hh"
58 #include "sim/sim_exit.hh"
59 #include "sim/stats.hh"
60 #include "sim/system.hh"
61 
62 #if HAVE_PROTOBUF
64 #endif
65 
66 
67 using namespace std;
68 
69 BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParams* p)
70  : ClockedObject(p),
71  system(p->system),
72  elasticReq(p->elastic_req),
73  progressCheck(p->progress_check),
74  noProgressEvent([this]{ noProgress(); }, name()),
75  nextTransitionTick(0),
76  nextPacketTick(0),
77  maxOutstandingReqs(p->max_outstanding_reqs),
78  port(name() + ".port", *this),
79  retryPkt(NULL),
80  retryPktTick(0), blockedWaitingResp(false),
81  updateEvent([this]{ update(); }, name()),
82  stats(this),
83  requestorId(system->getRequestorId(this)),
84  streamGenerator(StreamGen::create(p))
85 {
86 }
87 
89 {
90 }
91 
92 Port &
93 BaseTrafficGen::getPort(const string &if_name, PortID idx)
94 {
95  if (if_name == "port") {
96  return port;
97  } else {
98  return ClockedObject::getPort(if_name, idx);
99  }
100 }
101 
102 void
104 {
106 
107  if (!port.isConnected())
108  fatal("The port of %s is not connected!\n", name());
109 }
110 
113 {
114  if (!updateEvent.scheduled()) {
115  // no event has been scheduled yet (e.g. switched from atomic mode)
116  return DrainState::Drained;
117  }
118 
119  if (retryPkt == NULL) {
120  // shut things down
124  return DrainState::Drained;
125  } else {
126  return DrainState::Draining;
127  }
128 }
129 
130 void
132 {
133  warn("%s serialization does not keep all traffic generator"
134  " internal state\n", name());
135 
136  DPRINTF(Checkpoint, "Serializing BaseTrafficGen\n");
137 
138  // save ticks of the graph event if it is scheduled
139  Tick nextEvent = updateEvent.scheduled() ? updateEvent.when() : 0;
140 
141  DPRINTF(TrafficGen, "Saving nextEvent=%llu\n", nextEvent);
142 
143  SERIALIZE_SCALAR(nextEvent);
144 
146 
148 }
149 
150 void
152 {
153  warn("%s serialization does not restore all traffic generator"
154  " internal state\n", name());
155 
156  // restore scheduled events
157  Tick nextEvent;
158  UNSERIALIZE_SCALAR(nextEvent);
159  if (nextEvent != 0)
160  schedule(updateEvent, nextEvent);
161 
163 
165 }
166 
167 void
169 {
170  // shift our progress-tracking event forward
172 
173  // if we have reached the time for the next state transition, then
174  // perform the transition
175  if (curTick() >= nextTransitionTick) {
176  transition();
177  } else {
178  assert(curTick() >= nextPacketTick);
179  // get the next packet and try to send it
180  PacketPtr pkt = activeGenerator->getNextPacket();
181 
182  // If generating stream/substream IDs are enabled,
183  // try to pick and assign them to the new packet
184  if (streamGenerator) {
185  auto sid = streamGenerator->pickStreamID();
186  auto ssid = streamGenerator->pickSubStreamID();
187 
188  pkt->req->setStreamId(sid);
189 
190  if (streamGenerator->ssidValid()) {
191  pkt->req->setSubStreamId(ssid);
192  }
193  }
194 
195  // suppress packets that are not destined for a memory, such as
196  // device accesses that could be part of a trace
197  if (pkt && system->isMemAddr(pkt->getAddr())) {
198  stats.numPackets++;
199  // Only attempts to send if not blocked by pending responses
201  if (blockedWaitingResp || !port.sendTimingReq(pkt)) {
202  retryPkt = pkt;
203  retryPktTick = curTick();
204  }
205  } else if (pkt) {
206  DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
207  pkt->cmdString(), pkt->getAddr());
208 
210  if (!(static_cast<int>(stats.numSuppressed.value()) % 10000))
211  warn("%s suppressed %d packets with non-memory addresses\n",
213 
214  delete pkt;
215  pkt = nullptr;
216  }
217  }
218 
219  // if we are waiting for a retry or for a response, do not schedule any
220  // further events, in the case of a transition or a successful send, go
221  // ahead and determine when the next update should take place
222  if (retryPkt == NULL) {
223  nextPacketTick = activeGenerator->nextPacketTick(elasticReq, 0);
224  scheduleUpdate();
225  }
226 }
227 
228 void
230 {
231  if (activeGenerator)
232  activeGenerator->exit();
233 
235 
236  if (activeGenerator) {
237  const Tick duration = activeGenerator->duration;
238  if (duration != MaxTick && duration != 0) {
239  // we could have been delayed and not transitioned on the
240  // exact tick when we were supposed to (due to back
241  // pressure when sending a packet)
242  nextTransitionTick = curTick() + duration;
243  } else {
245  }
246 
247  activeGenerator->enter();
248  nextPacketTick = activeGenerator->nextPacketTick(elasticReq, 0);
249  } else {
252  assert(!updateEvent.scheduled());
253  }
254 }
255 
256 void
258 {
259  // Has the generator run out of work? In that case, force a
260  // transition if a transition period hasn't been configured.
261  while (activeGenerator &&
263  transition();
264  }
265 
266  if (!activeGenerator)
267  return;
268 
269  // schedule next update event based on either the next execute
270  // tick or the next transition, which ever comes first
271  const Tick nextEventTick = std::min(nextPacketTick, nextTransitionTick);
272 
273  DPRINTF(TrafficGen, "Next event scheduled at %lld\n", nextEventTick);
274 
275  // The next transition tick may be in the past if there was a
276  // retry, so ensure that we don't schedule anything in the past.
277  schedule(updateEvent, std::max(curTick(), nextEventTick));
278 }
279 
280 void
282 {
283  transition();
284  scheduleUpdate();
285 }
286 
287 void
289 {
290  DPRINTF(TrafficGen, "Received retry\n");
291  stats.numRetries++;
292  retryReq();
293 }
294 
295 void
297 {
298  assert(retryPkt != NULL);
299  assert(retryPktTick != 0);
300  assert(!blockedWaitingResp);
301 
302  // attempt to send the packet, and if we are successful start up
303  // the machinery again
304  if (port.sendTimingReq(retryPkt)) {
305  retryPkt = NULL;
306  // remember how much delay was incurred due to back-pressure
307  // when sending the request, we also use this to derive
308  // the tick for the next packet
309  Tick delay = curTick() - retryPktTick;
310  retryPktTick = 0;
311  stats.retryTicks += delay;
312 
313  if (drainState() != DrainState::Draining) {
314  // packet is sent, so find out when the next one is due
315  nextPacketTick = activeGenerator->nextPacketTick(elasticReq,
316  delay);
317  scheduleUpdate();
318  } else {
319  // shut things down
322  signalDrainDone();
323  }
324  }
325 }
326 
327 void
329 {
330  fatal("BaseTrafficGen %s spent %llu ticks without making progress",
331  name(), progressCheck);
332 }
333 
335  : Stats::Group(parent),
336  ADD_STAT(numSuppressed,
337  "Number of suppressed packets to non-memory space"),
338  ADD_STAT(numPackets, "Number of packets generated"),
339  ADD_STAT(numRetries, "Number of retries"),
340  ADD_STAT(retryTicks, "Time spent waiting due to back-pressure (ticks)"),
341  ADD_STAT(bytesRead, "Number of bytes read"),
342  ADD_STAT(bytesWritten, "Number of bytes written"),
343  ADD_STAT(totalReadLatency, "Total latency of read requests"),
344  ADD_STAT(totalWriteLatency, "Total latency of write requests"),
345  ADD_STAT(totalReads, "Total num of reads"),
346  ADD_STAT(totalWrites, "Total num of writes"),
347  ADD_STAT(avgReadLatency, "Avg latency of read requests",
348  totalReadLatency / totalReads),
349  ADD_STAT(avgWriteLatency, "Avg latency of write requests",
350  totalWriteLatency / totalWrites),
351  ADD_STAT(readBW, "Read bandwidth in bytes/s",
352  bytesRead / simSeconds),
353  ADD_STAT(writeBW, "Write bandwidth in bytes/s",
354  bytesWritten / simSeconds)
355 {
356 }
357 
358 std::shared_ptr<BaseGen>
360 {
361  return std::shared_ptr<BaseGen>(new IdleGen(*this, requestorId,
362  duration));
363 }
364 
365 std::shared_ptr<BaseGen>
367 {
368  return std::shared_ptr<BaseGen>(new ExitGen(*this, requestorId,
369  duration));
370 }
371 
372 std::shared_ptr<BaseGen>
374  Addr start_addr, Addr end_addr, Addr blocksize,
375  Tick min_period, Tick max_period,
376  uint8_t read_percent, Addr data_limit)
377 {
378  return std::shared_ptr<BaseGen>(new LinearGen(*this, requestorId,
379  duration, start_addr,
380  end_addr, blocksize,
382  min_period, max_period,
383  read_percent, data_limit));
384 }
385 
386 std::shared_ptr<BaseGen>
388  Addr start_addr, Addr end_addr, Addr blocksize,
389  Tick min_period, Tick max_period,
390  uint8_t read_percent, Addr data_limit)
391 {
392  return std::shared_ptr<BaseGen>(new RandomGen(*this, requestorId,
393  duration, start_addr,
394  end_addr, blocksize,
396  min_period, max_period,
397  read_percent, data_limit));
398 }
399 
400 std::shared_ptr<BaseGen>
402  Addr start_addr, Addr end_addr, Addr blocksize,
403  Tick min_period, Tick max_period,
404  uint8_t read_percent, Addr data_limit,
405  unsigned int num_seq_pkts, unsigned int page_size,
406  unsigned int nbr_of_banks,
407  unsigned int nbr_of_banks_util,
408  Enums::AddrMap addr_mapping,
409  unsigned int nbr_of_ranks)
410 {
411  return std::shared_ptr<BaseGen>(new DramGen(*this, requestorId,
412  duration, start_addr,
413  end_addr, blocksize,
415  min_period, max_period,
416  read_percent, data_limit,
417  num_seq_pkts, page_size,
418  nbr_of_banks,
419  nbr_of_banks_util,
420  addr_mapping,
421  nbr_of_ranks));
422 }
423 
424 std::shared_ptr<BaseGen>
426  Addr start_addr, Addr end_addr, Addr blocksize,
427  Tick min_period, Tick max_period,
428  uint8_t read_percent, Addr data_limit,
429  unsigned int num_seq_pkts,
430  unsigned int page_size,
431  unsigned int nbr_of_banks,
432  unsigned int nbr_of_banks_util,
433  Enums::AddrMap addr_mapping,
434  unsigned int nbr_of_ranks,
435  unsigned int max_seq_count_per_rank)
436 {
437  return std::shared_ptr<BaseGen>(new DramRotGen(*this, requestorId,
438  duration, start_addr,
439  end_addr, blocksize,
441  min_period, max_period,
442  read_percent, data_limit,
443  num_seq_pkts, page_size,
444  nbr_of_banks,
445  nbr_of_banks_util,
446  addr_mapping,
447  nbr_of_ranks,
448  max_seq_count_per_rank));
449 }
450 
451 std::shared_ptr<BaseGen>
453  Addr start_addr_dram, Addr end_addr_dram,
454  Addr blocksize_dram,
455  Addr start_addr_nvm, Addr end_addr_nvm,
456  Addr blocksize_nvm,
457  Tick min_period, Tick max_period,
458  uint8_t read_percent, Addr data_limit,
459  unsigned int num_seq_pkts_dram,
460  unsigned int page_size_dram,
461  unsigned int nbr_of_banks_dram,
462  unsigned int nbr_of_banks_util_dram,
463  unsigned int num_seq_pkts_nvm,
464  unsigned int buffer_size_nvm,
465  unsigned int nbr_of_banks_nvm,
466  unsigned int nbr_of_banks_util_nvm,
467  Enums::AddrMap addr_mapping,
468  unsigned int nbr_of_ranks_dram,
469  unsigned int nbr_of_ranks_nvm,
470  uint8_t nvm_percent)
471 {
472  return std::shared_ptr<BaseGen>(new HybridGen(*this, requestorId,
473  duration, start_addr_dram,
474  end_addr_dram, blocksize_dram,
475  start_addr_nvm,
476  end_addr_nvm, blocksize_nvm,
478  min_period, max_period,
479  read_percent, data_limit,
480  num_seq_pkts_dram,
481  page_size_dram,
482  nbr_of_banks_dram,
483  nbr_of_banks_util_dram,
484  num_seq_pkts_nvm,
485  buffer_size_nvm,
486  nbr_of_banks_nvm,
487  nbr_of_banks_util_nvm,
488  addr_mapping,
489  nbr_of_ranks_dram,
490  nbr_of_ranks_nvm,
491  nvm_percent));
492 }
493 
494 std::shared_ptr<BaseGen>
496  Addr start_addr, Addr end_addr, Addr blocksize,
497  Tick min_period, Tick max_period,
498  uint8_t read_percent, Addr data_limit,
499  unsigned int num_seq_pkts, unsigned int buffer_size,
500  unsigned int nbr_of_banks,
501  unsigned int nbr_of_banks_util,
502  Enums::AddrMap addr_mapping,
503  unsigned int nbr_of_ranks)
504 {
505  return std::shared_ptr<BaseGen>(new NvmGen(*this, requestorId,
506  duration, start_addr,
507  end_addr, blocksize,
509  min_period, max_period,
510  read_percent, data_limit,
511  num_seq_pkts, buffer_size,
512  nbr_of_banks,
513  nbr_of_banks_util,
514  addr_mapping,
515  nbr_of_ranks));
516 }
517 
518 std::shared_ptr<BaseGen>
520  const std::string& trace_file, Addr addr_offset)
521 {
522 #if HAVE_PROTOBUF
523  return std::shared_ptr<BaseGen>(
524  new TraceGen(*this, requestorId, duration, trace_file, addr_offset));
525 #else
526  panic("Can't instantiate trace generation without Protobuf support!\n");
527 #endif
528 }
529 
530 bool
532 {
533  auto iter = waitingResp.find(pkt->req);
534 
535  panic_if(iter == waitingResp.end(), "%s: "
536  "Received unexpected response [%s reqPtr=%x]\n",
537  pkt->print(), pkt->req);
538 
539  assert(iter->second <= curTick());
540 
541  if (pkt->isWrite()) {
542  ++stats.totalWrites;
543  stats.bytesWritten += pkt->req->getSize();
544  stats.totalWriteLatency += curTick() - iter->second;
545  } else {
546  ++stats.totalReads;
547  stats.bytesRead += pkt->req->getSize();
548  stats.totalReadLatency += curTick() - iter->second;
549  }
550 
551  waitingResp.erase(iter);
552 
553  delete pkt;
554 
555  // Sends up the request if we were blocked
556  if (blockedWaitingResp) {
557  blockedWaitingResp = false;
558  retryReq();
559  }
560 
561  return true;
562 }
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:425
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:460
NvmGen
NVM specific generator is for issuing request with variable buffer hit length and bank utilization.
Definition: nvm_gen.hh:60
warn
#define warn(...)
Definition: logging.hh:239
BaseTrafficGen::retryReq
void retryReq()
Definition: base.cc:296
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:797
Packet::getAddr
Addr getAddr() const
Definition: packet.hh:754
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:288
EventManager::reschedule
void reschedule(Event &event, Tick when, bool always=false)
Definition: eventq.hh:1023
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:387
BaseTrafficGen::activeGenerator
std::shared_ptr< BaseGen > activeGenerator
Currently active generator.
Definition: base.hh:332
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:93
BaseTrafficGen::transition
void transition()
Transition to the next generator.
Definition: base.cc:229
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
linear_gen.hh
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
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:237
HybridGen
Hybrid NVM + DRAM specific generator is for issuing request with variable buffer hit length and bank ...
Definition: hybrid_gen.hh:60
Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:340
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:1014
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:503
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:401
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:328
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
BaseTrafficGen::BaseTrafficGen
BaseTrafficGen(const BaseTrafficGenParams *p)
Definition: base.cc:69
cp
Definition: cprintf.cc:40
EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1005
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:452
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:698
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:123
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
ADD_STAT
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition: group.hh:67
simSeconds
Stats::Formula simSeconds
Definition: stat_control.cc:61
Packet::cmdString
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition: packet.hh:551
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:373
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:112
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:103
BaseTrafficGen::createTrace
std::shared_ptr< BaseGen > createTrace(Tick duration, const std::string &trace_file, Addr addr_offset)
Definition: base.cc:519
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
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:335
BaseTrafficGen::StatGroup::numPackets
Stats::Scalar numPackets
Count the number of generated packets.
Definition: base.hh:201
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:142
name
const std::string & name()
Definition: trace.cc:50
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:790
StreamGen::create
static StreamGen * create(const BaseTrafficGenParams *p)
Factory method for constructing a Stream generator.
Definition: stream_gen.cc:43
BaseTrafficGen::waitingResp
std::unordered_map< RequestPtr, Tick > waitingResp
Reqs waiting for response.
Definition: base.hh:192
BaseTrafficGen::start
void start()
Definition: base.cc:281
BaseTrafficGen::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: base.cc:131
Drainable::drainState
DrainState drainState() const
Return the current drain state of an object.
Definition: drain.hh:320
stream_gen.hh
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:133
BaseTrafficGen::StatGroup::numSuppressed
Stats::Scalar numSuppressed
Count the number of dropped requests.
Definition: base.hh:198
BaseTrafficGen::StatGroup::StatGroup
StatGroup(Stats::Group *parent)
Definition: base.cc:334
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:257
BaseTrafficGen::nextPacketTick
Tick nextPacketTick
Time of the next packet.
Definition: base.hh:121
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
BaseTrafficGen::requestorId
const RequestorID requestorId
RequestorID used in generated requests.
Definition: base.hh:329
BaseTrafficGen::StatGroup::totalReads
Stats::Scalar totalReads
Count the number reads.
Definition: base.hh:222
BaseTrafficGen::~BaseTrafficGen
~BaseTrafficGen()
Definition: base.cc:88
idle_gen.hh
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
Stats::Group
Statistics container.
Definition: group.hh:83
BaseTrafficGen::recvTimingResp
bool recvTimingResp(PacketPtr pkt)
Definition: base.cc:531
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:73
Packet::isWrite
bool isWrite() const
Definition: packet.hh:557
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
BaseTrafficGen::createIdle
std::shared_ptr< BaseGen > createIdle(Tick duration)
Definition: base.cc:359
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:61
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:307
CheckpointIn
Definition: serialize.hh:67
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:417
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:65
BaseTrafficGen::createExit
std::shared_ptr< BaseGen > createExit(Tick duration)
Definition: base.cc:366
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:168
BaseTrafficGen::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: base.cc:151
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:495
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
curTick
Tick curTick()
The current simulated tick.
Definition: core.hh:45
nvm_gen.hh

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