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

Generated on Tue Sep 21 2021 12:25:00 for gem5 by doxygen 1.8.17