gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
67namespace gem5
68{
69
70BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParams &p)
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
92
93Port &
94BaseTrafficGen::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
103void
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 {
128 }
129}
130
131void
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
151void
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
168void
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())) {
200 // Only attempts to send if not blocked by pending responses
203 retryPkt = pkt;
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);
226 }
227}
228
229void
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
257void
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
281void
287
288void
290{
291 DPRINTF(TrafficGen, "Received retry\n");
293 retryReq();
294}
295
296void
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
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
315 // packet is sent, so find out when the next one is due
316 nextPacketTick = activeGenerator->nextPacketTick(elasticReq,
317 delay);
319 } else {
320 // shut things down
324 }
325 }
326}
327
328void
330{
331 fatal("BaseTrafficGen %s spent %llu ticks without making progress",
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
369std::shared_ptr<BaseGen>
371{
372 return std::shared_ptr<BaseGen>(new IdleGen(*this, requestorId,
373 duration));
374}
375
376std::shared_ptr<BaseGen>
378{
379 return std::shared_ptr<BaseGen>(new ExitGen(*this, requestorId,
380 duration));
381}
382
383std::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
397std::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
411std::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
435std::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
462std::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
505std::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
529std::shared_ptr<BaseGen>
531 Tick duration,
532 Addr start_addr, Addr end_addr, Addr offset,
533 Addr block_size, Addr superblock_size, Addr stride_size,
534 Tick min_period, Tick max_period,
535 uint8_t read_percent, Addr data_limit)
536{
537 return std::shared_ptr<BaseGen>(new StridedGen(
538 *this, requestorId, duration,
540 start_addr, end_addr, offset,
541 block_size, superblock_size, stride_size,
542 min_period, max_period,
543 read_percent, data_limit));
544}
545
546std::shared_ptr<BaseGen>
548 const std::string& trace_file, Addr addr_offset)
549{
550#if HAVE_PROTOBUF
551 return std::shared_ptr<BaseGen>(
552 new TraceGen(*this, requestorId, duration, trace_file, addr_offset));
553#else
554 panic("Can't instantiate trace generation without Protobuf support!\n");
555#endif
556}
557
558bool
560{
561 auto iter = waitingResp.find(pkt->req);
562
563 panic_if(iter == waitingResp.end(), "%s: "
564 "Received unexpected response [%s reqPtr=%x]\n",
565 pkt->print(), pkt->req);
566
567 assert(iter->second <= curTick());
568
569 if (pkt->isWrite()) {
571 stats.bytesWritten += pkt->req->getSize();
572 stats.totalWriteLatency += curTick() - iter->second;
573 } else {
575 stats.bytesRead += pkt->req->getSize();
576 stats.totalReadLatency += curTick() - iter->second;
577 }
578
579 waitingResp.erase(iter);
580
581 delete pkt;
582
583 // Sends up the request if we were blocked
584 if (blockedWaitingResp) {
585 blockedWaitingResp = false;
586 retryReq();
587 }
588
589 return true;
590}
591
592} // namespace gem5
#define DPRINTF(x,...)
Definition trace.hh:210
Declaration of the base generator class for all generators.
void update()
Schedules event for next update and generates a new packet or requests a new generatoir depending on ...
Definition base.cc:169
Tick nextPacketTick
Time of the next packet.
Definition base.hh:124
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition base.cc:104
std::shared_ptr< BaseGen > createIdle(Tick duration)
Definition base.cc:370
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
std::shared_ptr< BaseGen > createTrace(Tick duration, const std::string &trace_file, Addr addr_offset)
Definition base.cc:547
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
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
const bool elasticReq
Determine whether to add elasticity in the request injection, thus responding to backpressure by slow...
Definition base.hh:82
std::unordered_map< RequestPtr, Tick > waitingResp
Reqs waiting for response.
Definition base.hh:195
std::shared_ptr< BaseGen > createStrided(Tick duration, Addr start_addr, Addr end_addr, Addr offset, Addr block_size, Addr superblock_size, Addr stride_size, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
Definition base.cc:530
void scheduleUpdate()
Schedule the update event based on nextPacketTick and nextTransitionTick.
Definition base.cc:258
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
void transition()
Transition to the next generator.
Definition base.cc:230
virtual std::shared_ptr< BaseGen > nextGenerator()=0
bool blockedWaitingResp
Set when we blocked waiting for outstanding reqs.
Definition base.hh:173
Tick retryPktTick
Tick when the stalled packet was meant to be sent.
Definition base.hh:170
void recvReqRetry()
Receive a retry from the neighbouring port and attempt to resend the waiting packet.
Definition base.cc:289
gem5::BaseTrafficGen::StatGroup stats
System *const system
The system used to determine which mode we are currently operating in.
Definition base.hh:76
std::shared_ptr< BaseGen > activeGenerator
Currently active generator.
Definition base.hh:343
BaseTrafficGen(const BaseTrafficGenParams &p)
Definition base.cc:70
Tick nextTransitionTick
Time of next transition.
Definition base.hh:121
TrafficGenPort port
The instance of request port used by the traffic generator.
Definition base.hh:164
const Tick progressCheck
Time to tolerate waiting for retries (not making progress), until we declare things broken.
Definition base.hh:88
bool recvTimingResp(PacketPtr pkt)
Definition base.cc:559
std::shared_ptr< BaseGen > createExit(Tick duration)
Definition base.cc:377
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
EventFunctionWrapper noProgressEvent
Event to keep track of our progress, or lack thereof.
Definition base.hh:118
const RequestorID requestorId
RequestorID used in generated requests.
Definition base.hh:340
EventFunctionWrapper updateEvent
Event for scheduling updates.
Definition base.hh:191
void noProgress()
Method to inform the user we have made no progress.
Definition base.cc:329
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
PacketPtr retryPkt
Packet waiting to be sent.
Definition base.hh:167
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
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition base.cc:132
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition base.cc:94
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition base.cc:152
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
std::unique_ptr< StreamGen > streamGenerator
Stream/SubstreamID Generator.
Definition base.hh:346
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
DRAM specific generator is for issuing request with variable page hit length and bank utilization.
Definition dram_gen.hh:62
The exit generator exits from the simulation once entered.
Definition exit_gen.hh:56
Hybrid NVM + DRAM specific generator is for issuing request with variable buffer hit length and bank ...
Definition hybrid_gen.hh:62
The idle generator does nothing.
Definition idle_gen.hh:58
The linear generator generates sequential requests from a start to an end address,...
Definition linear_gen.hh:63
virtual std::string name() const
Definition named.hh:47
NVM specific generator is for issuing request with variable buffer hit length and bank utilization.
Definition nvm_gen.hh:62
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
Addr getAddr() const
Definition packet.hh:807
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition packet.hh:588
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
Definition packet.cc:368
bool isWrite() const
Definition packet.hh:594
RequestPtr req
A pointer to the original request.
Definition packet.hh:377
Ports are used to interface objects to each other.
Definition port.hh:62
bool isConnected() const
Is this port currently connected to a peer?
Definition port.hh:133
The random generator is similar to the linear one, but does not generate sequential addresses.
Definition random_gen.hh:61
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
Definition port.hh:603
static StreamGen * create(const BaseTrafficGenParams &p)
Factory method for constructing a Stream generator.
Definition stream_gen.cc:46
The strided generator generates sequential requests from a start to an end address,...
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:288
Addr cacheLineSize() const
Get the cache line size of the system.
Definition system.hh:308
The trace replay generator reads a trace file and plays back the transactions.
Definition trace_gen.hh:62
The traffic generator is a module that generates stimuli for the memory system, based on a collection...
Statistics container.
Definition group.hh:93
Counter value() const
Return the current value of this stat as its base type.
Declaration of the DRAM generator for issuing variable page hit length requests and bank utilisation.
Declaration of DRAM rotation generator that rotates through each rank.
Declaration of the exit generator that ends the simulation.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition group.hh:75
void signalDrainDone() const
Signal that an object is drained.
Definition drain.hh:305
DrainState drainState() const
Return the current drain state of an object.
Definition drain.hh:324
DrainState
Object drain/handover states.
Definition drain.hh:75
@ Draining
Draining buffers pending serialization/handover.
@ Drained
Buffers drained, ready for serialization/handover.
void deschedule(Event &event)
Definition eventq.hh:1021
bool scheduled() const
Determine if the current event is scheduled.
Definition eventq.hh:458
void schedule(Event &event, Tick when)
Definition eventq.hh:1012
void reschedule(Event &event, Tick when, bool always=false)
Definition eventq.hh:1030
Tick when() const
Get the time that the event is scheduled.
Definition eventq.hh:501
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
#define fatal(...)
This implements a cprintf based fatal() function.
Definition logging.hh:200
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition logging.hh:214
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition sim_object.cc:73
Declaration of the NVM generator for issuing variable buffer hit length requests and bank utilisation...
Declaration of the idle generator that does nothing.
Declaration of the linear generator that generates sequential requests.
#define warn(...)
Definition logging.hh:256
Bitfield< 23, 0 > offset
Definition types.hh:144
Bitfield< 0 > p
Bitfield< 15 > system
Definition misc.hh:1032
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Tick curTick()
The universal simulation clock.
Definition cur_tick.hh:46
std::ostream CheckpointOut
Definition serialize.hh:66
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition types.hh:245
uint64_t Tick
Tick count type.
Definition types.hh:58
const Tick MaxTick
Definition types.hh:60
statistics::Formula & simSeconds
Definition stats.cc:45
Declaration of the NVM generator for issuing variable buffer hit length requests and bank utilisation...
Declaration of the random generator that randomly selects addresses within a range.
#define UNSERIALIZE_SCALAR(scalar)
Definition serialize.hh:575
#define SERIALIZE_SCALAR(scalar)
Definition serialize.hh:568
Declaration of the Stream generator for issuing memory requests with variable/fixed stream and substr...
Declaration of the strided generator that generates sequential requests.
statistics::Scalar totalReads
Count the number reads.
Definition base.hh:226
statistics::Scalar numRetries
Count the number of retries.
Definition base.hh:208
statistics::Scalar retryTicks
Count the time incurred from back-pressure.
Definition base.hh:211
statistics::Scalar totalReadLatency
Total num of ticks read reqs took to complete
Definition base.hh:220
statistics::Scalar bytesWritten
Count the number of bytes written.
Definition base.hh:217
statistics::Scalar numSuppressed
Count the number of dropped requests.
Definition base.hh:202
statistics::Scalar bytesRead
Count the number of bytes read.
Definition base.hh:214
statistics::Scalar totalWrites
Count the number writes.
Definition base.hh:229
statistics::Scalar totalWriteLatency
Total num of ticks write reqs took to complete
Definition base.hh:223
StatGroup(statistics::Group *parent)
Definition base.cc:335
statistics::Scalar numPackets
Count the number of generated packets.
Definition base.hh:205
const std::string & name()
Definition trace.cc:48
Declaration of the trace generator that reads a trace file and plays the transactions.

Generated on Tue Jun 18 2024 16:24:01 for gem5 by doxygen 1.11.0