gem5  v22.0.0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tlb_coalescer.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from this
17  * software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
33 
34 #include <cstring>
35 
38 #include "arch/generic/mmu.hh"
39 #include "base/logging.hh"
40 #include "debug/GPUTLB.hh"
41 #include "sim/process.hh"
42 
43 namespace gem5
44 {
45 
46 VegaTLBCoalescer::VegaTLBCoalescer(const VegaTLBCoalescerParams &p)
47  : ClockedObject(p),
48  TLBProbesPerCycle(p.probesPerCycle),
49  coalescingWindow(p.coalescingWindow),
50  disableCoalescing(p.disableCoalescing),
51  probeTLBEvent([this]{ processProbeTLBEvent(); },
52  "Probe the TLB below",
53  false, Event::CPU_Tick_Pri),
54  cleanupEvent([this]{ processCleanupEvent(); },
55  "Cleanup issuedTranslationsTable hashmap",
56  false, Event::Maximum_Pri),
57  tlb_level(p.tlb_level),
58  maxDownstream(p.maxDownstream),
59  numDownstream(0)
60 {
61  // create the response ports based on the number of connected ports
62  for (size_t i = 0; i < p.port_cpu_side_ports_connection_count; ++i) {
63  cpuSidePort.push_back(new CpuSidePort(csprintf("%s-port%d", name(), i),
64  this, i));
65  }
66 
67  // create the request ports based on the number of connected ports
68  for (size_t i = 0; i < p.port_mem_side_ports_connection_count; ++i) {
69  memSidePort.push_back(new MemSidePort(csprintf("%s-port%d", name(), i),
70  this, i));
71  }
72 }
73 
74 Port &
75 VegaTLBCoalescer::getPort(const std::string &if_name, PortID idx)
76 {
77  if (if_name == "cpu_side_ports") {
78  if (idx >= static_cast<PortID>(cpuSidePort.size())) {
79  panic("VegaTLBCoalescer::getPort: unknown index %d\n", idx);
80  }
81 
82  return *cpuSidePort[idx];
83  } else if (if_name == "mem_side_ports") {
84  if (idx >= static_cast<PortID>(memSidePort.size())) {
85  panic("VegaTLBCoalescer::getPort: unknown index %d\n", idx);
86  }
87 
88  return *memSidePort[idx];
89  } else {
90  panic("VegaTLBCoalescer::getPort: unknown port %s\n", if_name);
91  }
92 }
93 
94 /*
95  * This method returns true if the <incoming_pkt>
96  * can be coalesced with <coalesced_pkt> and false otherwise.
97  * A given set of rules is checked.
98  * The rules can potentially be modified based on the TLB level.
99  */
100 bool
102 {
103  if (disableCoalescing)
104  return false;
105 
106  GpuTranslationState *incoming_state =
107  safe_cast<GpuTranslationState*>(incoming_pkt->senderState);
108 
109  GpuTranslationState *coalesced_state =
110  safe_cast<GpuTranslationState*>(coalesced_pkt->senderState);
111 
112  // Rule 1: Coalesce requests only if they
113  // fall within the same virtual page
114  Addr incoming_virt_page_addr = roundDown(incoming_pkt->req->getVaddr(),
116 
117  Addr coalesced_virt_page_addr = roundDown(coalesced_pkt->req->getVaddr(),
119 
120  if (incoming_virt_page_addr != coalesced_virt_page_addr)
121  return false;
122 
123  //* Rule 2: Coalesce requests only if they
124  // share a TLB Mode, i.e. they are both read
125  // or write requests.
126  BaseMMU::Mode incoming_mode = incoming_state->tlbMode;
127  BaseMMU::Mode coalesced_mode = coalesced_state->tlbMode;
128 
129  if (incoming_mode != coalesced_mode)
130  return false;
131 
132  // when we can coalesce a packet update the reqCnt
133  // that is the number of packets represented by
134  // this coalesced packet
135  if (!incoming_state->isPrefetch)
136  coalesced_state->reqCnt.back() += incoming_state->reqCnt.back();
137 
138  return true;
139 }
140 
141 /*
142  * We need to update the physical addresses of all the translation requests
143  * that were coalesced into the one that just returned.
144  */
145 void
147 {
148  Addr virt_page_addr = roundDown(pkt->req->getVaddr(), VegaISA::PageBytes);
149 
150  DPRINTF(GPUTLB, "Update phys. addr. for %d coalesced reqs for page %#x\n",
151  issuedTranslationsTable[virt_page_addr].size(), virt_page_addr);
152 
153  GpuTranslationState *sender_state =
154  safe_cast<GpuTranslationState*>(pkt->senderState);
155 
156  // Make a copy. This gets deleted after the first is sent back on the port
157  assert(sender_state->tlbEntry);
158  VegaISA::VegaTlbEntry tlb_entry =
159  *safe_cast<VegaISA::VegaTlbEntry *>(sender_state->tlbEntry);
160  Addr first_entry_vaddr = tlb_entry.vaddr;
161  Addr first_entry_paddr = tlb_entry.paddr;
162  int page_size = tlb_entry.size();
163  bool uncacheable = tlb_entry.uncacheable();
164  int first_hit_level = sender_state->hitLevel;
165 
166  // Get the physical page address of the translated request
167  // Using the page_size specified in the TLBEntry allows us
168  // to support different page sizes.
169  Addr phys_page_paddr = pkt->req->getPaddr();
170  phys_page_paddr &= ~(page_size - 1);
171 
172  bool is_system = pkt->req->systemReq();
173 
174  for (int i = 0; i < issuedTranslationsTable[virt_page_addr].size(); ++i) {
175  PacketPtr local_pkt = issuedTranslationsTable[virt_page_addr][i];
176  GpuTranslationState *sender_state =
177  safe_cast<GpuTranslationState*>(local_pkt->senderState);
178 
179  // we are sending the packet back, so pop the reqCnt associated
180  // with this level in the TLB hiearchy
181  if (!sender_state->isPrefetch) {
182  sender_state->reqCnt.pop_back();
183  localCycles += curCycle();
184  }
185 
186  /*
187  * Only the first packet from this coalesced request has been
188  * translated. Grab the translated phys. page addr and update the
189  * physical addresses of the remaining packets with the appropriate
190  * page offsets.
191  */
192  if (i) {
193  Addr paddr = phys_page_paddr;
194  paddr |= (local_pkt->req->getVaddr() & (page_size - 1));
195  local_pkt->req->setPaddr(paddr);
196 
197  if (uncacheable)
198  local_pkt->req->setFlags(Request::UNCACHEABLE);
199 
200  // update senderState->tlbEntry, so we can insert
201  // the correct TLBEentry in the TLBs above.
202 
203  //auto p = sender_state->tc->getProcessPtr();
204  if (sender_state->tlbEntry == NULL) {
205  // not set by lower(l2) coalescer
206  sender_state->tlbEntry =
207  new VegaISA::VegaTlbEntry(1 /* VMID TODO */,
208  first_entry_vaddr,
209  first_entry_paddr,
210  tlb_entry.logBytes,
211  tlb_entry.pte);
212  }
213 
214  // update the hitLevel for all uncoalesced reqs
215  // so that each packet knows where it hit
216  // (used for statistics in the CUs)
217  sender_state->hitLevel = first_hit_level;
218  }
219 
220  // Copy PTE system bit information to coalesced requests
221  local_pkt->req->setSystemReq(is_system);
222 
223  ResponsePort *return_port = sender_state->ports.back();
224  sender_state->ports.pop_back();
225 
226  // Translation is done - Convert to a response pkt if necessary and
227  // send the translation back
228  if (local_pkt->isRequest()) {
229  local_pkt->makeTimingResponse();
230  }
231 
232  return_port->sendTimingResp(local_pkt);
233  }
234 
235  // schedule clean up for end of this cycle
236  // This is a maximum priority event and must be on
237  // the same cycle as GPUTLB cleanup event to prevent
238  // race conditions with an IssueProbeEvent caused by
239  // MemSidePort::recvReqRetry
240  cleanupQueue.push(virt_page_addr);
241 
242  if (!cleanupEvent.scheduled())
244 }
245 
246 // Receive translation requests, create a coalesced request,
247 // and send them to the TLB (TLBProbesPerCycle)
248 bool
250 {
251  // first packet of a coalesced request
252  PacketPtr first_packet = nullptr;
253  // true if we are able to do coalescing
254  bool didCoalesce = false;
255  // number of coalesced reqs for a given window
256  int coalescedReq_cnt = 0;
257 
258  GpuTranslationState *sender_state =
259  safe_cast<GpuTranslationState*>(pkt->senderState);
260 
261  bool update_stats = !sender_state->isPrefetch;
262 
263  if (coalescer->tlb_level == 1 && coalescer->mustStallCUPort(this))
264  return false;
265 
266  // push back the port to remember the path back
267  sender_state->ports.push_back(this);
268 
269  if (update_stats) {
270  // if reqCnt is empty then this packet does not represent
271  // multiple uncoalesced reqs(pkts) but just a single pkt.
272  // If it does though then the reqCnt for each level in the
273  // hierarchy accumulates the total number of reqs this packet
274  // represents
275  int req_cnt = 1;
276 
277  if (!sender_state->reqCnt.empty())
278  req_cnt = sender_state->reqCnt.back();
279 
280  sender_state->reqCnt.push_back(req_cnt);
281 
282  // update statistics
284  req_cnt = sender_state->reqCnt.back();
285  DPRINTF(GPUTLB, "receiving pkt w/ req_cnt %d\n", req_cnt);
286  coalescer->queuingCycles -= (coalescer->curCycle() * req_cnt);
289  }
290 
291  // Coalesce based on the time the packet arrives at the coalescer (here).
292  if (!sender_state->issueTime)
293  sender_state->issueTime = curTick();
294 
295  // The tick index is used as a key to the coalescerFIFO hashmap.
296  // It is shared by all candidates that fall within the
297  // given coalescingWindow.
298  Tick tick_index = sender_state->issueTime / coalescer->coalescingWindow;
299 
300  if (coalescer->coalescerFIFO.count(tick_index)) {
301  coalescedReq_cnt = coalescer->coalescerFIFO[tick_index].size();
302  }
303 
304  // see if we can coalesce the incoming pkt with another
305  // coalesced request with the same tick_index
306  for (int i = 0; i < coalescedReq_cnt; ++i) {
307  first_packet = coalescer->coalescerFIFO[tick_index][i][0];
308 
309  if (coalescer->canCoalesce(pkt, first_packet)) {
310  coalescer->coalescerFIFO[tick_index][i].push_back(pkt);
311 
312  DPRINTF(GPUTLB, "Coalesced req %i w/ tick_index %d has %d reqs\n",
313  i, tick_index,
314  coalescer->coalescerFIFO[tick_index][i].size());
315 
316  didCoalesce = true;
317  break;
318  }
319  }
320 
321  // if this is the first request for this tick_index
322  // or we did not manage to coalesce, update stats
323  // and make necessary allocations.
324  if (!coalescedReq_cnt || !didCoalesce) {
325  if (update_stats)
327 
328  std::vector<PacketPtr> new_array;
329  new_array.push_back(pkt);
330  coalescer->coalescerFIFO[tick_index].push_back(new_array);
331 
332  DPRINTF(GPUTLB, "coalescerFIFO[%d] now has %d coalesced reqs after "
333  "push\n", tick_index,
334  coalescer->coalescerFIFO[tick_index].size());
335  }
336 
337  //schedule probeTLBEvent next cycle to send the
338  //coalesced requests to the TLB
341  curTick() + coalescer->clockPeriod());
342  }
343 
344  return true;
345 }
346 
347 void
349 {
350  panic("recvReqRetry called");
351 }
352 
353 void
355 {
356 
357  GpuTranslationState *sender_state =
358  safe_cast<GpuTranslationState*>(pkt->senderState);
359 
360  bool update_stats = !sender_state->isPrefetch;
361 
362  if (update_stats)
363  coalescer->uncoalescedAccesses++;
364 
365  Addr virt_page_addr = roundDown(pkt->req->getVaddr(), VegaISA::PageBytes);
366  int map_count = coalescer->issuedTranslationsTable.count(virt_page_addr);
367 
368  if (map_count) {
369  DPRINTF(GPUTLB, "Warning! Functional access to addr %#x sees timing "
370  "req. pending\n", virt_page_addr);
371  }
372 
373  coalescer->memSidePort[0]->sendFunctional(pkt);
374 }
375 
378 {
379  // currently not checked by the requestor
380  AddrRangeList ranges;
381 
382  return ranges;
383 }
384 
385 /*
386  * a translation completed and returned
387  */
388 bool
390 {
391  coalescer->updatePhysAddresses(pkt);
392 
393  if (coalescer->tlb_level != 1)
394  return true;
395 
396 
397  coalescer->decrementNumDownstream();
398 
399  DPRINTF(GPUTLB,
400  "recvTimingReq: clscr = %p, numDownstream = %d, max = %d\n",
401  coalescer, coalescer->numDownstream, coalescer->maxDownstream);
402 
403  coalescer->unstallPorts();
404  return true;
405 }
406 
407 void
409 {
410  //we've receeived a retry. Schedule a probeTLBEvent
411  if (!coalescer->probeTLBEvent.scheduled())
412  coalescer->schedule(coalescer->probeTLBEvent,
413  curTick() + coalescer->clockPeriod());
414 }
415 
416 void
418 {
419  fatal("Memory side recvFunctional() not implemented in TLB coalescer.\n");
420 }
421 
422 /*
423  * Here we scan the coalescer FIFO and issue the max
424  * number of permitted probes to the TLB below. We
425  * permit bypassing of coalesced requests for the same
426  * tick_index.
427  *
428  * We do not access the next tick_index unless we've
429  * drained the previous one. The coalesced requests
430  * that are successfully sent are moved to the
431  * issuedTranslationsTable table (the table which keeps
432  * track of the outstanding reqs)
433  */
434 void
436 {
437  // number of TLB probes sent so far
438  int sent_probes = 0;
439 
440  // It is set to true either when the recvTiming of the TLB below
441  // returns false or when there is another outstanding request for the
442  // same virt. page.
443 
444  DPRINTF(GPUTLB, "triggered VegaTLBCoalescer %s\n", __func__);
445 
446  if ((tlb_level == 1)
447  && (availDownstreamSlots() == 0)) {
448  DPRINTF(GPUTLB, "IssueProbeEvent - no downstream slots, bail out\n");
449  return;
450  }
451 
452  for (auto iter = coalescerFIFO.begin();
453  iter != coalescerFIFO.end();) {
454  int coalescedReq_cnt = iter->second.size();
455  int i = 0;
456  int vector_index = 0;
457 
458  DPRINTF(GPUTLB, "coalescedReq_cnt is %d for tick_index %d\n",
459  coalescedReq_cnt, iter->first);
460 
461  while (i < coalescedReq_cnt) {
462  ++i;
463  PacketPtr first_packet = iter->second[vector_index][0];
464  //The request to coalescer is origanized as follows.
465  //The coalescerFIFO is a map which is indexed by coalescingWindow
466  // cycle. Only requests that falls in the same coalescingWindow
467  // considered for coalescing. Each entry of a coalescerFIFO is a
468  // vector of vectors. There is one entry for each different virtual
469  // page number and it contains vector of all request that are
470  // coalesced for the same virtual page address
471 
472  // compute virtual page address for this request
473  Addr virt_page_addr = roundDown(first_packet->req->getVaddr(),
475 
476  // is there another outstanding request for the same page addr?
477  int pending_reqs =
478  issuedTranslationsTable.count(virt_page_addr);
479 
480  if (pending_reqs) {
481  DPRINTF(GPUTLB, "Cannot issue - There are pending reqs for "
482  "page %#x\n", virt_page_addr);
483 
484  ++vector_index;
485  continue;
486  }
487 
488  // send the coalesced request for virt_page_addr
489  if (!memSidePort[0]->sendTimingReq(first_packet)) {
490  DPRINTF(GPUTLB,
491  "Failed to send TLB request for page %#x",
492  virt_page_addr);
493 
494  // No need for a retries queue since we are already
495  // buffering the coalesced request in coalescerFIFO.
496  // Arka:: No point trying to send other requests to TLB at
497  // this point since it is busy. Retries will be called later
498  // by the TLB below
499  return;
500  } else {
501 
502  if (tlb_level == 1)
504 
505  GpuTranslationState *tmp_sender_state =
506  safe_cast<GpuTranslationState*>(first_packet->senderState);
507 
508  bool update_stats = !tmp_sender_state->isPrefetch;
509 
510  if (update_stats) {
511  // req_cnt is total number of packets represented
512  // by the one we just sent counting all the way from
513  // the top of TLB hiearchy (i.e., from the CU)
514  int req_cnt = tmp_sender_state->reqCnt.back();
515  queuingCycles += (curCycle() * req_cnt);
516 
517  DPRINTF(GPUTLB, "%s sending pkt w/ req_cnt %d\n",
518  name(), req_cnt);
519 
520  // pkt_cnt is number of packets we coalesced into the one
521  // we just sent but only at this coalescer level
522  int pkt_cnt = iter->second[vector_index].size();
523  localqueuingCycles += (curCycle() * pkt_cnt);
524  }
525 
526  DPRINTF(GPUTLB, "Successfully sent TLB request for page %#x\n",
527  virt_page_addr);
528 
529  //copy coalescedReq to issuedTranslationsTable
530  issuedTranslationsTable[virt_page_addr]
531  = iter->second[vector_index];
532 
533  //erase the entry of this coalesced req
534  iter->second.erase(iter->second.begin() + vector_index);
535 
536  if (iter->second.empty())
537  assert( i == coalescedReq_cnt );
538 
539  sent_probes++;
540 
541  if (sent_probes == TLBProbesPerCycle ||
542  ((tlb_level == 1) && (!availDownstreamSlots()))) {
543  //Before returning make sure that empty vectors are taken
544  // out. Not a big issue though since a later invocation
545  // will take it out anyway.
546  if (iter->second.empty())
547  coalescerFIFO.erase(iter);
548 
549  //schedule probeTLBEvent next cycle to send the
550  //coalesced requests to the TLB
551  if (!probeTLBEvent.scheduled()) {
553  cyclesToTicks(curCycle() + Cycles(1)));
554  }
555  return;
556  }
557  }
558  }
559 
560  //if there are no more coalesced reqs for this tick_index
561  //erase the hash_map with the first iterator
562  if (iter->second.empty()) {
563  coalescerFIFO.erase(iter++);
564  } else {
565  ++iter;
566  }
567  }
568 }
569 
570 void
572 {
573  while (!cleanupQueue.empty()) {
574  Addr cleanup_addr = cleanupQueue.front();
575  cleanupQueue.pop();
576  issuedTranslationsTable.erase(cleanup_addr);
577 
578  DPRINTF(GPUTLB, "Cleanup - Delete coalescer entry with key %#x\n",
579  cleanup_addr);
580  }
581 }
582 
583 void
585 {
587 
589  .name(name() + ".uncoalesced_accesses")
590  .desc("Number of uncoalesced TLB accesses")
591  ;
592 
594  .name(name() + ".coalesced_accesses")
595  .desc("Number of coalesced TLB accesses")
596  ;
597 
599  .name(name() + ".queuing_cycles")
600  .desc("Number of cycles spent in queue")
601  ;
602 
604  .name(name() + ".local_queuing_cycles")
605  .desc("Number of cycles spent in queue for all incoming reqs")
606  ;
607 
609  .name(name() + ".local_cycles")
610  .desc("Number of cycles spent in queue for all incoming reqs")
611  ;
612 
614  .name(name() + ".local_latency")
615  .desc("Avg. latency over all incoming pkts")
616  ;
617 
618  latency
619  .name(name() + ".latency")
620  .desc("Avg. latency over all incoming pkts")
621  ;
622 
625 }
626 
627 void
629 {
630  assert(tlb_level == 1);
631  if (stalledPortsMap.count(port) != 0)
632  return; // we already know this port is stalled
633 
634  stalledPortsMap[port] = port;
635  stalledPortsQueue.push(port);
636  DPRINTF(GPUTLB,
637  "insertStalledPortIfNotMapped: port %p, mapSz = %d, qsz = %d\n",
638  port, stalledPortsMap.size(), stalledPortsQueue.size());
639 }
640 
641 bool
643 {
644  assert(tlb_level == 1);
645 
646  DPRINTF(GPUTLB, "mustStallCUPort: downstream = %d, max = %d\n",
648 
650  warn("RED ALERT - VegaTLBCoalescer::mustStallCUPort\n");
652  return true;
653  }
654  else
655  return false;
656 }
657 
658 void
660 {
661  assert(tlb_level == 1);
662  if (!stalledPorts() || availDownstreamSlots() == 0)
663  return;
664 
665  DPRINTF(GPUTLB, "unstallPorts()\n");
666  /*
667  * this check is needed because we can be called from recvTiiningResponse()
668  * or, synchronously due to having called sendRetry, from recvTimingReq()
669  */
670  if (availDownstreamSlots() == 0) // can happen if retry sent 1 downstream
671  return;
672  /*
673  * Consider this scenario
674  * 1) max downstream is reached
675  * 2) port1 tries to send a req, cant => stalledPortsQueue = [port1]
676  * 3) port2 tries to send a req, cant => stalledPortsQueue = [port1,
677  * port2]
678  * 4) a request completes and we remove port1 from both data
679  * structures & call
680  * sendRetry => stalledPortsQueue = [port2]
681  * 5) port1 sends one req downstream and a second is rejected
682  * => stalledPortsQueue = [port2, port1]
683  *
684  * so we round robin and each stalled port can send 1 req on retry
685  */
686  assert(availDownstreamSlots() == 1);
687  auto port = stalledPortsQueue.front();
688  DPRINTF(GPUTLB, "sending retry for port = %p(%s)\n", port, port->name());
689  stalledPortsQueue.pop();
690  auto iter = stalledPortsMap.find(port);
691  assert(iter != stalledPortsMap.end());
692  stalledPortsMap.erase(iter);
693  port->sendRetryReq(); // cu will synchronously call recvTimingReq
694 }
695 
696 } // namespace gem5
gem5::VegaTLBCoalescer::mustStallCUPort
bool mustStallCUPort(CpuSidePort *)
Definition: tlb_coalescer.cc:642
gem5::VegaTLBCoalescer::regStats
void regStats() override
Callback to set stat parameters.
Definition: tlb_coalescer.cc:584
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:190
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:245
gem5::VegaTLBCoalescer::queuingCycles
statistics::Scalar queuingCycles
Definition: tlb_coalescer.hh:120
gem5::VegaTLBCoalescer::stalledPortsMap
std::map< CpuSidePort *, CpuSidePort * > stalledPortsMap
Definition: tlb_coalescer.hh:214
gem5::Packet::isRequest
bool isRequest() const
Definition: packet.hh:594
warn
#define warn(...)
Definition: logging.hh:246
gem5::Clocked::curCycle
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
Definition: clocked_object.hh:195
gem5::VegaTLBCoalescer::tlb_level
int tlb_level
Definition: tlb_coalescer.hh:208
gem5::GpuTranslationState
GPU TranslationState: this currently is a somewhat bastardization of the usage of SenderState,...
Definition: gpu_translation_state.hh:58
gem5::GpuTranslationState::ports
std::vector< ResponsePort * > ports
Definition: gpu_translation_state.hh:79
gem5::VegaTLBCoalescer::VegaTLBCoalescer
VegaTLBCoalescer(const VegaTLBCoalescerParams &p)
Definition: tlb_coalescer.cc:46
gem5::VegaTLBCoalescer::processCleanupEvent
void processCleanupEvent()
Definition: tlb_coalescer.cc:571
gem5::BaseMMU::Mode
Mode
Definition: mmu.hh:56
gem5::Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:374
gem5::VegaTLBCoalescer::coalescedAccesses
statistics::Scalar coalescedAccesses
Definition: tlb_coalescer.hh:115
gem5::VegaTLBCoalescer::issuedTranslationsTable
CoalescingTable issuedTranslationsTable
Definition: tlb_coalescer.hh:110
gem5::VegaTLBCoalescer::stalledPorts
bool stalledPorts()
Definition: tlb_coalescer.hh:224
gem5::VegaTLBCoalescer::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: tlb_coalescer.cc:75
gem5::VegaTLBCoalescer::stalledPortsQueue
std::queue< CpuSidePort * > stalledPortsQueue
Definition: tlb_coalescer.hh:212
gem5::VegaTLBCoalescer::localqueuingCycles
statistics::Scalar localqueuingCycles
Definition: tlb_coalescer.hh:125
gem5::EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1019
std::vector
STL vector class.
Definition: stl.hh:37
gem5::VegaTLBCoalescer::TLBProbesPerCycle
int TLBProbesPerCycle
Definition: tlb_coalescer.hh:68
gem5::csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:161
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::VegaTLBCoalescer::CpuSidePort::coalescer
VegaTLBCoalescer * coalescer
Definition: tlb_coalescer.hh:145
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
gem5::VegaTLBCoalescer::incrementNumDownstream
void incrementNumDownstream()
Definition: tlb_coalescer.hh:235
gem5::VegaTLBCoalescer::availDownstreamSlots
unsigned int availDownstreamSlots()
Definition: tlb_coalescer.hh:216
gem5::Request::UNCACHEABLE
@ UNCACHEABLE
The request is to an uncacheable address.
Definition: request.hh:125
gem5::statistics::DataWrap::name
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Definition: statistics.hh:289
gem5::Named::name
virtual std::string name() const
Definition: named.hh:47
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::Clocked::cyclesToTicks
Tick cyclesToTicks(Cycles c) const
Definition: clocked_object.hh:227
gem5::VegaISA::PageBytes
const Addr PageBytes
Definition: page_size.hh:42
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:186
gem5::VegaTLBCoalescer::disableCoalescing
bool disableCoalescing
Definition: tlb_coalescer.hh:79
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:291
gem5::VegaTLBCoalescer::CpuSidePort::getAddrRanges
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
Definition: tlb_coalescer.cc:377
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::EventBase::Maximum_Pri
static const Priority Maximum_Pri
Maximum priority.
Definition: eventq.hh:241
gem5::GpuTranslationState::issueTime
uint64_t issueTime
Definition: gpu_translation_state.hh:77
process.hh
gem5::VegaTLBCoalescer::insertStalledPortIfNotMapped
void insertStalledPortIfNotMapped(CpuSidePort *)
Definition: tlb_coalescer.cc:628
mmu.hh
gem5::GpuTranslationState::tlbEntry
Serializable * tlbEntry
Definition: gpu_translation_state.hh:73
gem5::VegaTLBCoalescer::MemSidePort::recvFunctional
virtual void recvFunctional(PacketPtr pkt)
Definition: tlb_coalescer.cc:417
gem5::ResponsePort::sendTimingResp
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
Definition: port.hh:370
gem5::GpuTranslationState::hitLevel
int hitLevel
Definition: gpu_translation_state.hh:85
gem5::VegaTLBCoalescer::probeTLBEvent
EventFunctionWrapper probeTLBEvent
This event issues the TLB probes.
Definition: tlb_coalescer.hh:201
gem5::VegaTLBCoalescer::coalescerFIFO
CoalescingFIFO coalescerFIFO
Definition: tlb_coalescer.hh:97
gem5::VegaTLBCoalescer::CpuSidePort::recvReqRetry
virtual void recvReqRetry()
Definition: tlb_coalescer.cc:348
gem5::roundDown
static constexpr T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:279
gpu_translation_state.hh
gem5::GpuTranslationState::reqCnt
std::vector< int > reqCnt
Definition: gpu_translation_state.hh:83
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::Packet::senderState
SenderState * senderState
This packet's sender state.
Definition: packet.hh:542
name
const std::string & name()
Definition: trace.cc:49
gem5::statistics::Group::regStats
virtual void regStats()
Callback to set stat parameters.
Definition: group.cc:69
gem5::ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:234
gem5::VegaTLBCoalescer::canCoalesce
bool canCoalesce(PacketPtr pkt1, PacketPtr pkt2)
Definition: tlb_coalescer.cc:101
gem5::VegaTLBCoalescer::unstallPorts
void unstallPorts()
Definition: tlb_coalescer.cc:659
gem5::ResponsePort
A ResponsePort is a specialization of a port.
Definition: port.hh:268
gem5::VegaTLBCoalescer::uncoalescedAccesses
statistics::Scalar uncoalescedAccesses
Definition: tlb_coalescer.hh:113
gem5::VegaTLBCoalescer::MemSidePort::recvReqRetry
virtual void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: tlb_coalescer.cc:408
gem5::Packet::makeTimingResponse
void makeTimingResponse()
Definition: packet.hh:1062
gem5::statistics::DataWrap::desc
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Definition: statistics.hh:334
gem5::VegaTLBCoalescer::localCycles
statistics::Scalar localCycles
Definition: tlb_coalescer.hh:126
gem5::VegaTLBCoalescer::numDownstream
unsigned int numDownstream
Definition: tlb_coalescer.hh:210
pagetable.hh
gem5::GpuTranslationState::tlbMode
BaseMMU::Mode tlbMode
Definition: gpu_translation_state.hh:61
gem5::VegaTLBCoalescer::cleanupQueue
std::queue< Addr > cleanupQueue
Definition: tlb_coalescer.hh:246
gem5::VegaTLBCoalescer::maxDownstream
int maxDownstream
Definition: tlb_coalescer.hh:209
logging.hh
tlb_coalescer.hh
gem5::VegaTLBCoalescer::cleanupEvent
EventFunctionWrapper cleanupEvent
The cleanupEvent is scheduled after a TLBEvent triggers in order to free memory and do the required c...
Definition: tlb_coalescer.hh:206
gem5::VegaTLBCoalescer::CpuSidePort::recvFunctional
virtual void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
Definition: tlb_coalescer.cc:354
gem5::VegaTLBCoalescer::CpuSidePort
Definition: tlb_coalescer.hh:136
gem5::GpuTranslationState::isPrefetch
bool isPrefetch
Definition: gpu_translation_state.hh:75
std::list< AddrRange >
gem5::EventBase::CPU_Tick_Pri
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Definition: eventq.hh:204
gem5::VegaTLBCoalescer::localLatency
statistics::Formula localLatency
Definition: tlb_coalescer.hh:128
gem5::VegaTLBCoalescer::latency
statistics::Formula latency
Definition: tlb_coalescer.hh:130
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::VegaTLBCoalescer::cpuSidePort
std::vector< CpuSidePort * > cpuSidePort
Definition: tlb_coalescer.hh:192
gem5::VegaTLBCoalescer::MemSidePort::recvTimingResp
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
Definition: tlb_coalescer.cc:389
gem5::VegaTLBCoalescer::processProbeTLBEvent
void processProbeTLBEvent()
Definition: tlb_coalescer.cc:435
gem5::VegaTLBCoalescer::coalescingWindow
int coalescingWindow
Definition: tlb_coalescer.hh:72
gem5::VegaTLBCoalescer::CpuSidePort::recvTimingReq
virtual bool recvTimingReq(PacketPtr pkt)
Receive a timing request from the peer.
Definition: tlb_coalescer.cc:249
gem5::Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:465
gem5::VegaTLBCoalescer::updatePhysAddresses
void updatePhysAddresses(PacketPtr pkt)
Definition: tlb_coalescer.cc:146
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
gem5::Clocked::clockPeriod
Tick clockPeriod() const
Definition: clocked_object.hh:217
gem5::VegaTLBCoalescer::memSidePort
std::vector< MemSidePort * > memSidePort
Definition: tlb_coalescer.hh:194

Generated on Wed Jul 13 2022 10:38:55 for gem5 by doxygen 1.8.17