gem5  v21.0.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fetch_unit.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * For use for simulation and test purposes only
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from this
19  * software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
35 
36 #include "base/bitfield.hh"
37 #include "debug/GPUFetch.hh"
38 #include "debug/GPUPort.hh"
39 #include "debug/GPUTLB.hh"
43 #include "gpu-compute/shader.hh"
44 #include "gpu-compute/wavefront.hh"
46 
48 
49 FetchUnit::FetchUnit(const ComputeUnitParams &p, ComputeUnit &cu)
50  : timingSim(true), computeUnit(cu), fetchScheduler(p),
51  waveList(nullptr), fetchDepth(p.fetch_depth)
52 {
53 }
54 
56 {
57  fetchQueue.clear();
58  fetchStatusQueue.clear();
59 }
60 
61 void
63 {
65  fetchQueue.clear();
68 
69  for (int i = 0; i < computeUnit.shader->n_wf; ++i) {
70  Wavefront *wf = waveList->at(i);
71  assert(wf->wfSlotId == i);
72  fetchStatusQueue[i] = std::make_pair(wf, false);
73  fetchBuf[i].allocateBuf(fetchDepth, computeUnit.cacheLineSize(), wf);
74  fetchBuf[i].decoder(&decoder);
75  }
76 
78 }
79 
80 void
82 {
91  for (auto &fetch_buf : fetchBuf) {
92  if (!fetch_buf.hasFreeSpace()) {
93  fetch_buf.checkWaveReleaseBuf();
94  }
95  if (fetch_buf.hasFetchDataToProcess()) {
96  fetch_buf.decodeInsts();
97  }
98  }
99 
100  // re-evaluate waves which are marked as not ready for fetch
101  for (int j = 0; j < computeUnit.shader->n_wf; ++j) {
102  // Following code assumes 64-bit opertaion and all insts are
103  // represented by 64-bit pointers to inst objects.
104  Wavefront *curWave = fetchStatusQueue[j].first;
105  assert (curWave);
106 
107  // The wavefront has to be active, the IB occupancy has to be
108  // 4 or less instructions and it can not have any branches to
109  // prevent speculative instruction fetches
110  if (!fetchStatusQueue[j].second) {
111  if ((curWave->getStatus() == Wavefront::S_RUNNING ||
112  curWave->getStatus() == Wavefront::S_WAITCNT) &&
113  fetchBuf[j].hasFreeSpace() &&
114  !curWave->stopFetch() &&
115  !curWave->pendingFetch) {
116  fetchQueue.push_back(curWave);
117  fetchStatusQueue[j].second = true;
118  }
119  }
120  }
121 
122  // Fetch only if there is some wave ready to be fetched
123  // An empty fetchQueue will cause the schedular to panic
124  if (fetchQueue.size()) {
125  Wavefront *waveToBeFetched = fetchScheduler.chooseWave();
126  waveToBeFetched->pendingFetch = true;
127  fetchStatusQueue[waveToBeFetched->wfSlotId].second = false;
128  initiateFetch(waveToBeFetched);
129  }
130 }
131 
132 void
134 {
135  assert(fetchBuf.at(wavefront->wfSlotId).hasFreeSpace());
136 
143  Addr vaddr = fetchBuf.at(wavefront->wfSlotId).nextFetchAddr();
144 
145  // this should already be aligned to a cache line
146  assert(vaddr == makeLineAddress(vaddr,
148 
149  // shouldn't be fetching a line that is already buffered
150  assert(!fetchBuf.at(wavefront->wfSlotId).pcBuffered(vaddr));
151 
152  fetchBuf.at(wavefront->wfSlotId).reserveBuf(vaddr);
153 
154  DPRINTF(GPUFetch, "CU%d: WF[%d][%d]: Id%d: Initiate fetch "
155  "from pc: %d %#x\n", computeUnit.cu_id, wavefront->simdId,
156  wavefront->wfSlotId, wavefront->wfDynId, wavefront->pc(), vaddr);
157 
158  DPRINTF(GPUTLB, "CU%d: WF[%d][%d]: Initiating fetch translation: %#x\n",
159  computeUnit.cu_id, wavefront->simdId, wavefront->wfSlotId, vaddr);
160 
161  // set up virtual request
162  RequestPtr req = std::make_shared<Request>(
164  computeUnit.requestorId(), 0, 0, nullptr);
165 
166  PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
167 
168  if (timingSim) {
169  // SenderState needed on Return
170  pkt->senderState = new ComputeUnit::ITLBPort::SenderState(wavefront);
171 
172  // Sender State needed by TLB hierarchy
173  pkt->senderState =
174  new TheISA::GpuTLB::TranslationState(BaseTLB::Execute,
176  false, pkt->senderState);
177 
179  assert(computeUnit.sqcTLBPort.retries.size() > 0);
180 
181  DPRINTF(GPUTLB, "Failed to send TLB req for FETCH addr %#x\n",
182  vaddr);
183 
184  computeUnit.sqcTLBPort.retries.push_back(pkt);
185  } else if (!computeUnit.sqcTLBPort.sendTimingReq(pkt)) {
186  // Stall the data port;
187  // No more packet is issued till
188  // ruby indicates resources are freed by
189  // a recvReqRetry() call back on this port.
191 
192  DPRINTF(GPUTLB, "Failed to send TLB req for FETCH addr %#x\n",
193  vaddr);
194 
195  computeUnit.sqcTLBPort.retries.push_back(pkt);
196  } else {
197  DPRINTF(GPUTLB, "sent FETCH translation request for %#x\n", vaddr);
198  }
199  } else {
200  pkt->senderState =
201  new TheISA::GpuTLB::TranslationState(BaseTLB::Execute,
203 
205 
206  TheISA::GpuTLB::TranslationState *sender_state =
207  safe_cast<TheISA::GpuTLB::TranslationState*>(pkt->senderState);
208 
209  delete sender_state->tlbEntry;
210  delete sender_state;
211  // fetch the instructions from the SQC when we operate in
212  // functional mode only
213  fetch(pkt, wavefront);
214  }
215 }
216 
217 void
219 {
220  assert(pkt->req->hasPaddr());
221  assert(pkt->req->hasSize());
222 
223  DPRINTF(GPUFetch, "CU%d: WF[%d][%d]: Fetch Access: %#x\n",
224  computeUnit.cu_id, wavefront->simdId, wavefront->wfSlotId,
225  pkt->req->getPaddr());
226 
233  PacketPtr oldPkt = pkt;
234  pkt = new Packet(oldPkt->req, oldPkt->cmd);
235  delete oldPkt;
236 
243  if (!fetchBuf.at(wavefront->wfSlotId).isReserved(pkt->req->getVaddr())) {
244  wavefront->dropFetch = false;
245  wavefront->pendingFetch = false;
246  return;
247  }
248 
254  pkt->dataStatic(fetchBuf.at(wavefront->wfSlotId)
255  .reservedBuf(pkt->req->getVaddr()));
256 
257  // New SenderState for the memory access
258  pkt->senderState = new ComputeUnit::SQCPort::SenderState(wavefront);
259 
260  if (timingSim) {
261  // translation is done. Send the appropriate timing memory request.
262 
263  if (!computeUnit.sqcPort.sendTimingReq(pkt)) {
264  computeUnit.sqcPort.retries.push_back(std::make_pair(pkt,
265  wavefront));
266 
267  DPRINTF(GPUPort, "CU%d: WF[%d][%d]: Fetch addr %#x failed!\n",
268  computeUnit.cu_id, wavefront->simdId, wavefront->wfSlotId,
269  pkt->req->getPaddr());
270  } else {
271  DPRINTF(GPUPort, "CU%d: WF[%d][%d]: Fetch addr %#x sent!\n",
272  computeUnit.cu_id, wavefront->simdId, wavefront->wfSlotId,
273  pkt->req->getPaddr());
274  }
275  } else {
277  processFetchReturn(pkt);
278  }
279 }
280 
281 void
283 {
284  ComputeUnit::SQCPort::SenderState *sender_state =
285  safe_cast<ComputeUnit::SQCPort::SenderState*>(pkt->senderState);
286 
287  Wavefront *wavefront = sender_state->wavefront;
288 
289  DPRINTF(GPUFetch, "CU%d: WF[%d][%d]: Fetch addr %#x returned "
290  "%d bytes!\n", computeUnit.cu_id, wavefront->simdId,
291  wavefront->wfSlotId, pkt->req->getPaddr(), pkt->req->getSize());
292 
293  if (wavefront->dropFetch) {
294  assert(wavefront->instructionBuffer.empty());
295  assert(!fetchBuf.at(wavefront->wfSlotId).hasFetchDataToProcess());
296  wavefront->dropFetch = false;
297  } else {
298  fetchBuf.at(wavefront->wfSlotId).fetchDone(pkt->req->getVaddr());
299  }
300 
301  wavefront->pendingFetch = false;
302 
303  delete pkt->senderState;
304  delete pkt;
305 }
306 
307 void
308 FetchUnit::flushBuf(int wfSlotId)
309 {
310  fetchBuf.at(wfSlotId).flushBuf();
311 }
312 
313 void
315 {
316  waveList = wave_list;
317 }
318 
320 void
321 FetchUnit::FetchBufDesc::allocateBuf(int fetch_depth, int cache_line_size,
322  Wavefront *wf)
323 {
324  wavefront = wf;
325  fetchDepth = fetch_depth;
327  cacheLineSize = cache_line_size;
329 
330  // Calculate the number of bits to address a cache line
332  "Cache line size should be a power of two.");
334 
335  bufStart = new uint8_t[maxFbSize];
336  readPtr = bufStart;
338 
339  for (int i = 0; i < fetchDepth; ++i) {
340  freeList.emplace_back(readPtr + i * cacheLineSize);
341  }
342 }
343 
344 void
346 {
347  restartFromBranch = true;
352  freeList.clear();
353  bufferedPCs.clear();
354  reservedPCs.clear();
355  readPtr = bufStart;
356 
357  for (int i = 0; i < fetchDepth; ++i) {
358  freeList.push_back(bufStart + i * cacheLineSize);
359  }
360 
361  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d Fetch dropped, flushing fetch "
362  "buffer\n", wavefront->simdId, wavefront->wfSlotId,
363  wavefront->wfDynId);
364 }
365 
366 Addr
368 {
369  Addr next_line = 0;
370 
371  if (bufferedAndReservedLines()) {
372  Addr last_line_fetched = 0;
373  if (!reservedLines()) {
378  last_line_fetched = bufferedPCs.rbegin()->first;
379  } else {
380  last_line_fetched = reservedPCs.rbegin()->first;
381  }
382 
383  next_line = last_line_fetched + cacheLineSize;
384 
389  assert(bufferedPCs.find(next_line) == bufferedPCs.end());
390  assert(reservedPCs.find(next_line) == reservedPCs.end());
391  } else {
400  next_line = makeLineAddress(wavefront->pc(), cacheLineBits);
401  readPtr = bufStart;
402 
409  if (restartFromBranch) {
410  restartFromBranch = false;
411  int byte_offset
412  = wavefront->pc() - makeLineAddress(wavefront->pc(),
413  cacheLineBits);
414  readPtr += byte_offset;
415  }
416  }
417 
418  return next_line;
419 }
420 
421 void
423 {
424  // we should have free buffer space, and the line
425  // at vaddr should not already be cached.
426  assert(hasFreeSpace());
427  assert(bufferedPCs.find(vaddr) == bufferedPCs.end());
428  assert(reservedPCs.find(vaddr) == reservedPCs.end());
429  assert(bufferedAndReservedLines() < fetchDepth);
430 
431  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d reserved fetch buffer entry "
432  "for PC = %#x\n", wavefront->simdId, wavefront->wfSlotId,
433  wavefront->wfDynId, vaddr);
434 
441  uint8_t *inst_buf = freeList.front();
442  reservedPCs.emplace(vaddr, inst_buf);
443  freeList.pop_front();
444 }
445 
446 void
448 {
449  assert(bufferedPCs.find(vaddr) == bufferedPCs.end());
450  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d done fetching for addr %#x\n",
451  wavefront->simdId, wavefront->wfSlotId,
452  wavefront->wfDynId, vaddr);
453 
459  auto reserved_pc = reservedPCs.find(vaddr);
460  assert(reserved_pc != reservedPCs.end());
461  bufferedPCs.emplace(vaddr, reserved_pc->second);
462 
463  if (readPtr == bufEnd) {
464  readPtr = bufStart;
465  }
466 
467  reserved_pc->second = nullptr;
468  reservedPCs.erase(reserved_pc);
469 }
470 
471 bool
473 {
474  return fetchBytesRemaining() >= sizeof(TheGpuISA::RawMachInst);
475 }
476 
477 void
479 {
480  Addr cur_wave_pc = roundDown(wavefront->pc(),
481  wavefront->computeUnit->cacheLineSize());
482  if (reservedPCs.find(cur_wave_pc) != reservedPCs.end()) {
483  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d current wave PC(%#x) still "
484  "being fetched.\n", wavefront->simdId, wavefront->wfSlotId,
485  wavefront->wfDynId, cur_wave_pc);
486 
487  // should be reserved, but not buffered yet
488  assert(bufferedPCs.find(cur_wave_pc) == bufferedPCs.end());
489 
490  return;
491  }
492 
493  auto current_buffered_pc = bufferedPCs.find(cur_wave_pc);
494  auto oldest_buffered_pc = bufferedPCs.begin();
495 
496  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d checking if PC block addr = %#x"
497  "(PC = %#x) can be released.\n", wavefront->simdId,
498  wavefront->wfSlotId, wavefront->wfDynId, cur_wave_pc,
499  wavefront->pc());
500 
501 #ifdef DEBUG
502  int idx = 0;
503  for (const auto &buf_pc : bufferedPCs) {
504  DPRINTF(GPUFetch, "PC[%d] = %#x\n", idx, buf_pc.first);
505  ++idx;
506  }
507 #endif
508 
509  // if we haven't buffered data for this PC, we shouldn't
510  // be fetching from it.
511  assert(current_buffered_pc != bufferedPCs.end());
512 
519  if (current_buffered_pc != oldest_buffered_pc) {
520  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d done fetching for PC = %#x, "
521  "removing it from the fetch buffer.\n", wavefront->simdId,
522  wavefront->wfSlotId, wavefront->wfDynId,
523  oldest_buffered_pc->first);
524 
525  freeList.emplace_back(oldest_buffered_pc->second);
526  oldest_buffered_pc->second = nullptr;
527  bufferedPCs.erase(oldest_buffered_pc);
528  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d has %d lines buffered.\n",
529  wavefront->simdId, wavefront->wfSlotId, wavefront->wfDynId,
530  bufferedLines());
531  }
532 }
533 
534 void
536 {
537  assert(readPtr);
538 
539  if (splitDecode()) {
540  decodeSplitInst();
541  }
542 
543  while (wavefront->instructionBuffer.size() < maxIbSize
544  && hasFetchDataToProcess()) {
545  if (splitDecode()) {
546  decodeSplitInst();
547  } else {
548  TheGpuISA::MachInst mach_inst
549  = reinterpret_cast<TheGpuISA::MachInst>(readPtr);
550  GPUStaticInst *gpu_static_inst = _decoder->decode(mach_inst);
551  readPtr += gpu_static_inst->instSize();
552 
553  assert(readPtr <= bufEnd);
554 
555  GPUDynInstPtr gpu_dyn_inst
556  = std::make_shared<GPUDynInst>(wavefront->computeUnit,
557  wavefront, gpu_static_inst,
558  wavefront->computeUnit->
559  getAndIncSeqNum());
560  wavefront->instructionBuffer.push_back(gpu_dyn_inst);
561 
562  DPRINTF(GPUFetch, "WF[%d][%d]: Id%ld decoded %s (%d bytes). "
563  "%d bytes remain.\n", wavefront->simdId,
564  wavefront->wfSlotId, wavefront->wfDynId,
565  gpu_static_inst->disassemble(),
566  gpu_static_inst->instSize(),
567  fetchBytesRemaining());
568  }
569  }
570 }
571 
572 void
574 {
575  TheGpuISA::RawMachInst split_inst = 0;
576  int dword_size = sizeof(uint32_t);
577  int num_dwords = sizeof(TheGpuISA::RawMachInst) / dword_size;
578 
579  for (int i = 0; i < num_dwords; ++i) {
580  replaceBits(split_inst, 32*(i+1)-1, 32*i,
581  *reinterpret_cast<uint32_t*>(readPtr));
582  if (readPtr + dword_size >= bufEnd) {
583  readPtr = bufStart;
584  }
585  }
586 
587  assert(readPtr == bufStart);
588 
589  TheGpuISA::MachInst mach_inst
590  = reinterpret_cast<TheGpuISA::MachInst>(&split_inst);
591  GPUStaticInst *gpu_static_inst = _decoder->decode(mach_inst);
592  readPtr += (gpu_static_inst->instSize() - dword_size);
593  assert(readPtr < bufEnd);
594 
595  GPUDynInstPtr gpu_dyn_inst
596  = std::make_shared<GPUDynInst>(wavefront->computeUnit,
597  wavefront, gpu_static_inst,
598  wavefront->computeUnit->
599  getAndIncSeqNum());
600  wavefront->instructionBuffer.push_back(gpu_dyn_inst);
601 
602  DPRINTF(GPUFetch, "WF[%d][%d]: Id%d decoded split inst %s (%#x) "
603  "(%d bytes). %d bytes remain in %d buffered lines.\n",
604  wavefront->simdId, wavefront->wfSlotId, wavefront->wfDynId,
605  gpu_static_inst->disassemble(), split_inst,
606  gpu_static_inst->instSize(), fetchBytesRemaining(),
607  bufferedLines());
608 }
609 
610 bool
612 {
617  bool is_split = (readPtr + sizeof(TheGpuISA::RawMachInst)) > bufEnd;
618 
619  return is_split;
620 }
621 
622 int
624 {
625  int bytes_remaining = 0;
626 
627  if (bufferedLines() && readPtr != bufEnd) {
628  auto last_buf_pc = bufferedPCs.rbegin();
629  uint8_t *end_ptr = last_buf_pc->second + cacheLineSize;
630  int byte_diff = end_ptr - readPtr;
631 
632  if (end_ptr > readPtr) {
633  bytes_remaining = byte_diff;
634  } else if (end_ptr < readPtr) {
635  bytes_remaining = bufferedBytes() + byte_diff;
636  }
637  }
638 
639  assert(bytes_remaining <= bufferedBytes());
640  return bytes_remaining;
641 }
ComputeUnit::ITLBPort::isStalled
bool isStalled()
Definition: compute_unit.hh:725
ComputeUnit::SQCPort::retries
std::deque< std::pair< PacketPtr, Wavefront * > > retries
Definition: compute_unit.hh:623
roundDown
T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:150
FetchUnit::computeUnit
ComputeUnit & computeUnit
Definition: fetch_unit.hh:241
FetchUnit::FetchBufDesc::fetchBytesRemaining
int fetchBytesRemaining() const
calculates the number of fetched bytes that have yet to be decoded.
Definition: fetch_unit.cc:623
Wavefront::maxIbSize
int maxIbSize
Definition: wavefront.hh:105
shader.hh
makeLineAddress
Addr makeLineAddress(Addr addr)
Definition: Address.cc:54
FetchUnit::initiateFetch
void initiateFetch(Wavefront *wavefront)
Definition: fetch_unit.cc:133
FetchUnit::fetchBuf
std::vector< FetchBufDesc > fetchBuf
Definition: fetch_unit.hh:262
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
FetchUnit::fetchScheduler
Scheduler fetchScheduler
Definition: fetch_unit.hh:248
FetchUnit::bindWaveList
void bindWaveList(std::vector< Wavefront * > *list)
Definition: fetch_unit.cc:314
ArmISA::MachInst
uint32_t MachInst
Definition: types.hh:52
Shader::timingSim
bool timingSim
Definition: shader.hh:194
Wavefront::S_RUNNING
@ S_RUNNING
Definition: wavefront.hh:68
compute_unit.hh
ComputeUnit::ITLBPort::retries
std::deque< PacketPtr > retries
here we queue all the translation requests that were not successfully sent.
Definition: compute_unit.hh:733
gpu_static_inst.hh
ComputeUnit::SQCPort::SenderState::wavefront
Wavefront * wavefront
Definition: compute_unit.hh:612
MemCmd::ReadReq
@ ReadReq
Definition: packet.hh:83
Shader::n_wf
int n_wf
Definition: shader.hh:208
ComputeUnit::cu_id
int cu_id
Definition: compute_unit.hh:291
RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:86
Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:341
FetchUnit::fetchDepth
int fetchDepth
number of cache lines we can fetch and buffer.
Definition: fetch_unit.hh:269
Wavefront::pc
Addr pc() const
Definition: wavefront.cc:1365
std::vector< Wavefront * >
fetch_unit.hh
RequestPort::sendFunctional
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
Definition: port.hh:482
FetchUnit::FetchBufDesc::cacheLineBits
int cacheLineBits
Definition: fetch_unit.hh:233
Wavefront::dropFetch
bool dropFetch
Definition: wavefront.hh:110
FetchUnit::~FetchUnit
~FetchUnit()
Definition: fetch_unit.cc:55
GPUStaticInst::disassemble
const std::string & disassemble()
Definition: gpu_static_inst.cc:44
wavefront.hh
Shader::gpuTc
ThreadContext * gpuTc
Definition: shader.hh:113
Wavefront::wfSlotId
const int wfSlotId
Definition: wavefront.hh:94
FetchUnit::FetchBufDesc::readPtr
uint8_t * readPtr
pointer that points to the next chunk of inst data to be decoded.
Definition: fetch_unit.hh:225
FetchUnit::FetchBufDesc::maxFbSize
int maxFbSize
Definition: fetch_unit.hh:231
FetchUnit::FetchBufDesc::nextFetchAddr
Addr nextFetchAddr()
Definition: fetch_unit.cc:367
ComputeUnit
Definition: compute_unit.hh:200
Wavefront::getStatus
status_e getStatus()
Definition: wavefront.hh:135
Scheduler::bindList
void bindList(std::vector< Wavefront * > *sched_list)
Definition: scheduler.cc:58
ArmISA::j
Bitfield< 24 > j
Definition: miscregs_types.hh:54
FetchUnit::flushBuf
void flushBuf(int wfSlotId)
Definition: fetch_unit.cc:308
FetchUnit::FetchBufDesc::wavefront
Wavefront * wavefront
Definition: fetch_unit.hh:236
FetchUnit::FetchBufDesc::cacheLineSize
int cacheLineSize
Definition: fetch_unit.hh:232
bitfield.hh
RequestPort::sendTimingReq
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
Definition: port.hh:492
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
FetchUnit::FetchBufDesc::bufEnd
uint8_t * bufEnd
Definition: fetch_unit.hh:220
SenderState
RubyTester::SenderState SenderState
Definition: Check.cc:37
MipsISA::vaddr
vaddr
Definition: pra_constants.hh:275
FetchUnit::FetchBufDesc::freeList
std::deque< uint8_t * > freeList
represents the fetch buffer free list.
Definition: fetch_unit.hh:213
Wavefront::S_WAITCNT
@ S_WAITCNT
wavefront has unsatisfied wait counts
Definition: wavefront.hh:86
FetchUnit::FetchBufDesc::reserveBuf
void reserveBuf(Addr vaddr)
reserve an entry in the fetch buffer for PC = vaddr,
Definition: fetch_unit.cc:422
gpu_dyn_inst.hh
Scheduler::chooseWave
Wavefront * chooseWave()
Definition: scheduler.cc:52
GPUStaticInst
Definition: gpu_static_inst.hh:58
RubySystem.hh
Wavefront::simdId
const int simdId
Definition: wavefront.hh:97
ProbePoints::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:103
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
FetchUnit::FetchBufDesc::maxIbSize
int maxIbSize
Definition: fetch_unit.hh:229
FetchUnit::init
void init()
Definition: fetch_unit.cc:62
Request::INST_FETCH
@ INST_FETCH
The request was an instruction fetch.
Definition: request.hh:108
FetchUnit::exec
void exec()
Definition: fetch_unit.cc:81
Wavefront::pendingFetch
bool pendingFetch
Definition: wavefront.hh:109
FetchUnit::FetchBufDesc::flushBuf
void flushBuf()
Definition: fetch_unit.cc:345
ComputeUnit::cacheLineSize
int cacheLineSize() const
Definition: compute_unit.hh:410
FetchUnit::fetch
void fetch(PacketPtr pkt, Wavefront *wavefront)
Definition: fetch_unit.cc:218
FetchUnit::FetchBufDesc::fetchDepth
int fetchDepth
Definition: fetch_unit.hh:227
Packet::cmd
MemCmd cmd
The command field of the packet.
Definition: packet.hh:336
FetchUnit::FetchBufDesc::decodeSplitInst
void decodeSplitInst()
Definition: fetch_unit.cc:573
floorLog2
std::enable_if_t< std::is_integral< T >::value, int > floorLog2(T x)
Definition: intmath.hh:63
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:197
ComputeUnit::sqcPort
SQCPort sqcPort
Definition: compute_unit.hh:852
Packet::dataStatic
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1108
Wavefront
Definition: wavefront.hh:59
FetchUnit::FetchBufDesc::decodeInsts
void decodeInsts()
each time the fetch stage is ticked, we check if there are any data in the fetch buffer that may be d...
Definition: fetch_unit.cc:535
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:258
GPUDynInstPtr
std::shared_ptr< GPUDynInst > GPUDynInstPtr
Definition: misc.hh:48
Wavefront::instructionBuffer
std::deque< GPUDynInstPtr > instructionBuffer
Definition: wavefront.hh:107
GPUStaticInst::instSize
virtual int instSize() const =0
FetchUnit::FetchBufDesc::bufStart
uint8_t * bufStart
raw instruction buffer.
Definition: fetch_unit.hh:219
ComputeUnit::getCacheLineBits
int getCacheLineBits() const
Definition: compute_unit.hh:411
FetchUnit::FetchBufDesc::hasFetchDataToProcess
bool hasFetchDataToProcess() const
checks if the buffer contains valid data.
Definition: fetch_unit.cc:472
FetchUnit::fetchQueue
std::vector< Wavefront * > fetchQueue
Definition: fetch_unit.hh:252
FetchUnit::decoder
TheGpuISA::Decoder decoder
Definition: fetch_unit.hh:242
FetchUnit::FetchBufDesc::fetchDone
void fetchDone(Addr vaddr)
Definition: fetch_unit.cc:447
Gcn3ISA::RawMachInst
uint64_t RawMachInst
used to represnt a GPU inst in its raw format.
Definition: gpu_types.hh:41
Packet::senderState
SenderState * senderState
This packet's sender state.
Definition: packet.hh:509
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
FetchUnit::processFetchReturn
void processFetchReturn(PacketPtr pkt)
Definition: fetch_unit.cc:282
Wavefront::stopFetch
bool stopFetch()
Definition: wavefront.cc:726
BaseTLB::Execute
@ Execute
Definition: tlb.hh:57
FetchUnit::FetchBufDesc
fetch buffer descriptor.
Definition: fetch_unit.hh:72
FetchUnit::FetchBufDesc::splitDecode
bool splitDecode() const
check if the next instruction to be processed out of the fetch buffer is split across the end/beginni...
Definition: fetch_unit.cc:611
ComputeUnit::SQCPort::SenderState
Definition: compute_unit.hh:610
FetchUnit::FetchBufDesc::allocateBuf
void allocateBuf(int fetch_depth, int cache_line_size, Wavefront *wf)
allocate the fetch buffer space, and set the fetch depth (number of lines that may be buffered),...
Definition: fetch_unit.cc:321
isPowerOf2
bool isPowerOf2(const T &n)
Definition: intmath.hh:102
ComputeUnit::sqcTLBPort
ITLBPort sqcTLBPort
Definition: compute_unit.hh:854
ComputeUnit::requestorId
RequestorID requestorId()
Definition: compute_unit.hh:459
FetchUnit::fetchStatusQueue
std::vector< std::pair< Wavefront *, bool > > fetchStatusQueue
Definition: fetch_unit.hh:257
FetchUnit::waveList
std::vector< Wavefront * > * waveList
Definition: fetch_unit.hh:260
FetchUnit::timingSim
bool timingSim
Definition: fetch_unit.hh:240
ComputeUnit::shader
Shader * shader
Definition: compute_unit.hh:352
replaceBits
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition: bitfield.hh:174
FetchUnit::globalFetchUnitID
static uint32_t globalFetchUnitID
Definition: fetch_unit.hh:65
FetchUnit::FetchBufDesc::checkWaveReleaseBuf
void checkWaveReleaseBuf()
checks if the wavefront can release any of its fetch buffer entries.
Definition: fetch_unit.cc:478
ComputeUnit::ITLBPort::stallPort
void stallPort()
Definition: compute_unit.hh:726
FetchUnit::FetchUnit
FetchUnit(const ComputeUnitParams &p, ComputeUnit &cu)
Definition: fetch_unit.cc:49
Wavefront::wfDynId
uint64_t wfDynId
Definition: wavefront.hh:224

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