gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
hsa_packet_processor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2018 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 
32 #ifndef __DEV_HSA_HSA_PACKET_PROCESSOR__
33 #define __DEV_HSA_HSA_PACKET_PROCESSOR__
34 
35 #include <algorithm>
36 #include <cstdint>
37 #include <vector>
38 
39 #include "base/types.hh"
40 #include "debug/HSAPacketProcessor.hh"
41 #include "dev/dma_virt_device.hh"
42 #include "dev/hsa/hsa.h"
43 #include "dev/hsa/hsa_queue.hh"
44 #include "enums/GfxVersion.hh"
45 #include "params/HSAPacketProcessor.hh"
46 #include "sim/eventq.hh"
47 
48 #define AQL_PACKET_SIZE 64
49 #define PAGE_SIZE 4096
50 #define NUM_DMA_BUFS 16
51 #define DMA_BUF_SIZE (AQL_PACKET_SIZE * NUM_DMA_BUFS)
52 // HSA runtime supports only 5 signals per barrier packet
53 #define NumSignalsPerBarrier 5
54 
55 namespace gem5
56 {
57 
58 class AMDGPUDevice;
59 
60 // Ideally, each queue should store this status and
61 // the processPkt() should make decisions based on that
62 // status variable.
63 enum Q_STATE
64 {
65  UNBLOCKED = 0, // Unblocked queue, can submit packets.
66  BLOCKED_BBIT, // Queue blocked by barrier bit.
67  // Can submit packet packets after
68  // previous packet completes.
69  BLOCKED_BPKT, // Queue blocked by barrier packet.
70  // Can submit packet packets after
71  // barrier packet completes.
72 };
73 
74 class GPUCommandProcessor;
75 class HWScheduler;
76 
77 // Our internal representation of an HSA queue
79 {
80  public:
81  uint64_t basePointer;
82  uint64_t doorbellPointer;
83  uint64_t writeIndex;
84  uint64_t readIndex;
85  uint32_t numElts;
86  uint64_t hostReadIndexPtr;
89  GfxVersion gfxVersion;
90 
91  HSAQueueDescriptor(uint64_t base_ptr, uint64_t db_ptr,
92  uint64_t hri_ptr, uint32_t size,
93  GfxVersion gfxVersion)
94  : basePointer(base_ptr), doorbellPointer(db_ptr),
95  writeIndex(0), readIndex(0),
96  numElts(size / AQL_PACKET_SIZE), hostReadIndexPtr(hri_ptr),
99  { }
100  uint64_t spaceRemaining() { return numElts - (writeIndex - readIndex); }
101  uint64_t spaceUsed() { return writeIndex - readIndex; }
102  uint32_t objSize() { return AQL_PACKET_SIZE; }
103  uint32_t numObjs() { return numElts; }
104  bool isFull() { return spaceRemaining() == 0; }
105  bool isEmpty() { return spaceRemaining() == numElts; }
106 
107  uint64_t ptr(uint64_t ix)
108  {
109  /*
110  * Based on ROCm Documentation:
111  * - https://github.com/RadeonOpenCompute/ROCm_Documentation/blob/
112  10ca0a99bbd0252f5bf6f08d1503e59f1129df4a/ROCm_Libraries/
113  rocr/src/core/runtime/amd_aql_queue.cpp#L99
114  * - https://github.com/RadeonOpenCompute/ROCm_Documentation/blob/
115  10ca0a99bbd0252f5bf6f08d1503e59f1129df4a/ROCm_Libraries/
116  rocr/src/core/runtime/amd_aql_queue.cpp#L624
117  *
118  * GFX7 and GFX8 will allocate twice as much space for their HSA
119  * queues as they actually access (using mod operations to map the
120  * virtual addresses from the upper half of the queue to the same
121  * virtual addresses as the lower half). Thus, we need to check if
122  * the ISA is GFX8 and mod the address by half of the queue size if
123  * so.
124  */
125  uint64_t retAddr = 0ll;
126  if ((gfxVersion == GfxVersion::gfx801) ||
127  (gfxVersion == GfxVersion::gfx803)) {
128  retAddr = basePointer + ((ix % (numElts/2)) * objSize());
129  DPRINTF(HSAPacketProcessor, "ptr() gfx8: base: 0x%x, "
130  "index: 0x%x, numElts: 0x%x, numElts/2: 0x%x, "
131  "objSize: 0x%x, retAddr: 0x%x\n", basePointer, ix,
132  numElts, numElts/2, objSize(), retAddr);
133  } else {
134  retAddr = basePointer + ((ix % numElts) * objSize());
135  DPRINTF(HSAPacketProcessor, "ptr() gfx9: base: 0x%x, "
136  "index: 0x%x, numElts: 0x%x, objSize: 0x%x, "
137  "retAddr: 0x%x\n", basePointer, ix, numElts, objSize(),
138  retAddr);
139  }
140  return retAddr;
141  }
142 };
143 
157 {
158  private:
160  std::string _name;
163  uint64_t _wrIdx; // Points to next write location
164  uint64_t _rdIdx; // Read pointer of AQL buffer
165  uint64_t _dispIdx; // Dispatch pointer of AQL buffer
166 
167  public:
168  std::string name() {return _name;}
169  AQLRingBuffer(uint32_t size, const std::string name);
170  int allocEntry(uint32_t nBufReq);
171  bool freeEntry(void *pkt);
172 
182  void
183  saveHostDispAddr(Addr host_pkt_addr, int num_pkts, int ix)
184  {
185  for (int i = 0; i < num_pkts; ++i) {
186  _hostDispAddresses[ix % numObjs()] = host_pkt_addr + i * objSize();
187  ++ix;
188  }
189  }
190 
191  Addr
192  hostDispAddr() const
193  {
194  return _hostDispAddresses[dispIdx() % numObjs()];
195  }
196 
197  bool
198  dispPending() const
199  {
200  int packet_type = (_aqlBuf[_dispIdx % _aqlBuf.size()].header
202  ((1 << HSA_PACKET_HEADER_WIDTH_TYPE) - 1);
203  return (_dispIdx < _wrIdx) && packet_type != HSA_PACKET_TYPE_INVALID;
204  }
205 
214  bool
216  {
217  for (int i = _rdIdx + 1; i < _dispIdx; i++) {
218  if (!_aqlComplete[i % _aqlBuf.size()]) {
219  return false;
220  }
221  }
222  return !_aqlComplete[_rdIdx % _aqlBuf.size()] && _rdIdx != _dispIdx;
223  }
224 
225  uint32_t nFree() const { return _aqlBuf.size() - (_wrIdx - _rdIdx); }
226  void *ptr(uint32_t ix) { return _aqlBuf.data() + (ix % _aqlBuf.size()); }
227  uint32_t numObjs() const { return _aqlBuf.size(); };
228  uint32_t objSize() const { return AQL_PACKET_SIZE; }
229  uint64_t dispIdx() const { return _dispIdx; }
230  uint64_t wrIdx() const { return _wrIdx; }
231  uint64_t rdIdx() const { return _rdIdx; }
232  uint64_t* rdIdxPtr() { return &_rdIdx; }
233  void incRdIdx(uint64_t value) { _rdIdx += value; }
234  void incWrIdx(uint64_t value) { _wrIdx += value; }
235  void incDispIdx(uint64_t value) { _dispIdx += value; }
236  uint64_t compltnPending() { return (_dispIdx - _rdIdx); }
237  void setRdIdx(uint64_t value);
238  void setWrIdx(uint64_t value);
239  void setDispIdx(uint64_t value);
240 };
241 
242 struct QCntxt
243 {
246  // used for HSA packets that enforce synchronization with barrier bit
249  qDesc(q_desc), aqlBuf(aql_buf), barrierBit(false)
250  {}
251  QCntxt() : qDesc(NULL), aqlBuf(NULL), barrierBit(false) {}
252 };
253 
255 {
256  friend class HWScheduler;
257  protected:
258  typedef void (DmaDevice::*DmaFnPtr)(Addr, int, Event*, uint8_t*, Tick);
263 
264  // Structure to store the read values of dependency signals
265  // from shared memory. Also used for tracking the status of
266  // those reads while they are in progress
268  {
269  public:
271  : pendingReads(0), allRead(false), discardRead(false)
272  {
274  }
275  void handleReadDMA();
277  bool allRead;
278  // If this queue is unmapped when there are pending reads, then
279  // the pending reads has to be discarded.
281  // values stores the value of already read dependency signal
283  void
285  {
286  std::fill(values.begin(), values.end(), 1);
287  }
288  };
289 
290  class QueueProcessEvent : public Event
291  {
292  private:
294  uint32_t rqIdx;
295  public:
296  QueueProcessEvent(HSAPacketProcessor *_hsaPP, uint32_t _rqIdx)
297  : Event(Default_Pri), hsaPP(_hsaPP), rqIdx(_rqIdx)
298  {}
299  virtual void process();
300  virtual const char *description() const;
301  };
302 
303  // Registered queue list entry; each entry has one queueDescriptor and
304  // associated AQL buffer
305  class RQLEntry
306  {
307  public:
308  RQLEntry(HSAPacketProcessor *hsaPP, uint32_t rqIdx)
309  : aqlProcessEvent(hsaPP, rqIdx) {}
311  bool dispPending() { return qCntxt.aqlBuf->dispPending() > 0; }
312  uint64_t compltnPending() { return qCntxt.aqlBuf->compltnPending(); }
315  void setBarrierBit(bool set_val) { qCntxt.barrierBit = set_val; }
316  bool getBarrierBit() const { return qCntxt.barrierBit; }
317  bool isLastOutstandingPkt() const
318  {
320  }
321  };
322  // Keeps track of queueDescriptors of registered queues
324 
325  Q_STATE processPkt(void* pkt, uint32_t rl_idx, Addr host_pkt_addr);
326  void displayQueueDescriptor(int pid, uint32_t rl_idx);
327 
328  public:
330  getQueueDesc(uint32_t queId)
331  {
332  return regdQList.at(queId)->qCntxt.qDesc;
333  }
334  class RQLEntry*
335  getRegdListEntry(uint32_t queId)
336  {
337  return regdQList.at(queId);
338  }
339 
340  uint64_t
341  inFlightPkts(uint32_t queId)
342  {
343  auto aqlBuf = regdQList.at(queId)->qCntxt.aqlBuf;
344  return aqlBuf->dispIdx() - aqlBuf->rdIdx();
345  }
346 
352 
353  typedef HSAPacketProcessorParams Params;
354  HSAPacketProcessor(const Params &p);
356  TranslationGenPtr translate(Addr vaddr, Addr size) override;
357  void setDeviceQueueDesc(uint64_t hostReadIndexPointer,
358  uint64_t basePointer,
359  uint64_t queue_id,
360  uint32_t size, int doorbellSize,
361  GfxVersion gfxVersion,
362  Addr offset = 0, uint64_t rd_idx = 0);
363  void unsetDeviceQueueDesc(uint64_t queue_id, int doorbellSize);
364  void setDevice(GPUCommandProcessor * dev);
366  void updateReadIndex(int, uint32_t);
367  void getCommandsFromHost(int pid, uint32_t rl_idx);
369 
370  // PIO interface
371  virtual Tick read(Packet*) override;
372  virtual Tick write(Packet*) override;
373  virtual AddrRangeList getAddrRanges() const override;
374  void finishPkt(void *pkt, uint32_t rl_idx);
375  void finishPkt(void *pkt) { finishPkt(pkt, 0); }
376  void schedAQLProcessing(uint32_t rl_idx);
377  void schedAQLProcessing(uint32_t rl_idx, Tick delay);
378 
379  void sendAgentDispatchCompletionSignal(void *pkt,
380  hsa_signal_value_t signal);
382 
387  {
388  // deal with the fact dma ops can complete out of issue order
389  uint32_t pkts_ttl;
390  uint32_t pkts_2_go;
391  uint32_t start_ix;
392  uint32_t rl_idx;
393 
394  dma_series_ctx(uint32_t _pkts_ttl,
395  uint32_t _pkts_2_go,
396  uint32_t _start_ix,
397  uint32_t _rl_idx)
398  : pkts_ttl(_pkts_2_go), pkts_2_go(_pkts_2_go),
399  start_ix(_start_ix), rl_idx(_rl_idx)
400  {};
402  };
403 
404  void updateReadDispIdDma();
405  void cmdQueueCmdDma(HSAPacketProcessor *hsaPP, int pid, bool isRead,
406  uint32_t ix_start, unsigned num_pkts,
407  dma_series_ctx *series_ctx, void *dest_4debug);
408  void handleReadDMA();
409 };
410 
411 } // namespace gem5
412 
413 #endif // __DEV_HSA_HSA_PACKET_PROCESSOR__
gem5::HSAPacketProcessor::pioDelay
Tick pioDelay
Definition: hsa_packet_processor.hh:350
gem5::MipsISA::fill
fill
Definition: pra_constants.hh:57
gem5::HSAPacketProcessor::dma_series_ctx::~dma_series_ctx
~dma_series_ctx()
Definition: hsa_packet_processor.hh:401
gem5::HSAPacketProcessor::pioAddr
Addr pioAddr
Definition: hsa_packet_processor.hh:348
gem5::AQLRingBuffer::AQLRingBuffer
AQLRingBuffer(uint32_t size, const std::string name)
Definition: hsa_packet_processor.cc:594
gem5::HSAPacketProcessor::schedAQLProcessing
void schedAQLProcessing(uint32_t rl_idx)
Definition: hsa_packet_processor.cc:277
gem5::AQLRingBuffer::name
std::string name()
Definition: hsa_packet_processor.hh:168
gem5::AQLRingBuffer::allocEntry
int allocEntry(uint32_t nBufReq)
Definition: hsa_packet_processor.cc:652
gem5::HSAPacketProcessor::setGPUDevice
void setGPUDevice(AMDGPUDevice *gpu_device)
Definition: hsa_packet_processor.cc:97
gem5::HSAPacketProcessor::QueueProcessEvent::hsaPP
HSAPacketProcessor * hsaPP
Definition: hsa_packet_processor.hh:293
gem5::HSAPacketProcessor::processPkt
Q_STATE processPkt(void *pkt, uint32_t rl_idx, Addr host_pkt_addr)
Definition: hsa_packet_processor.cc:283
gem5::HSAPacketProcessor::SignalState::SignalState
SignalState()
Definition: hsa_packet_processor.hh:270
gem5::HSAQueueDescriptor::readIndex
uint64_t readIndex
Definition: hsa_packet_processor.hh:84
gem5::HSAPacketProcessor::RQLEntry::qCntxt
QCntxt qCntxt
Definition: hsa_packet_processor.hh:310
gem5::HSAPacketProcessor::SignalState::resetSigVals
void resetSigVals()
Definition: hsa_packet_processor.hh:284
gem5::HSAQueueDescriptor::hostReadIndexPtr
uint64_t hostReadIndexPtr
Definition: hsa_packet_processor.hh:86
gem5::AQLRingBuffer::_wrIdx
uint64_t _wrIdx
Definition: hsa_packet_processor.hh:163
gem5::AQLRingBuffer::setWrIdx
void setWrIdx(uint64_t value)
Definition: hsa_packet_processor.cc:614
gem5::AQLRingBuffer::numObjs
uint32_t numObjs() const
Definition: hsa_packet_processor.hh:227
gem5::HSAPacketProcessor::dma_series_ctx::start_ix
uint32_t start_ix
Definition: hsa_packet_processor.hh:391
hsa_signal_value_t
int32_t hsa_signal_value_t
Signal value.
Definition: hsa.h:1322
gem5::HSAPacketProcessor::QueueProcessEvent
Definition: hsa_packet_processor.hh:290
gem5::HSAPacketProcessor::RQLEntry::compltnPending
uint64_t compltnPending()
Definition: hsa_packet_processor.hh:312
gem5::HSAPacketProcessor::unsetDeviceQueueDesc
void unsetDeviceQueueDesc(uint64_t queue_id, int doorbellSize)
Definition: hsa_packet_processor.cc:106
gem5::HSAQueueDescriptor::isEmpty
bool isEmpty()
Definition: hsa_packet_processor.hh:105
gem5::HSAQueueDescriptor::numObjs
uint32_t numObjs()
Definition: hsa_packet_processor.hh:103
gem5::HSAPacketProcessor::getQueueDesc
HSAQueueDescriptor * getQueueDesc(uint32_t queId)
Definition: hsa_packet_processor.hh:330
gem5::HSAQueueDescriptor::basePointer
uint64_t basePointer
Definition: hsa_packet_processor.hh:81
gem5::AQLRingBuffer::saveHostDispAddr
void saveHostDispAddr(Addr host_pkt_addr, int num_pkts, int ix)
the kernel may try to read from the dispatch packet, so we need to keep the host address that corresp...
Definition: hsa_packet_processor.hh:183
gem5::HSAQueueDescriptor::gfxVersion
GfxVersion gfxVersion
Definition: hsa_packet_processor.hh:89
NumSignalsPerBarrier
#define NumSignalsPerBarrier
Definition: hsa_packet_processor.hh:53
gem5::HSAPacketProcessor::inFlightPkts
uint64_t inFlightPkts(uint32_t queId)
Definition: hsa_packet_processor.hh:341
gem5::HSAPacketProcessor::RQLEntry::setBarrierBit
void setBarrierBit(bool set_val)
Definition: hsa_packet_processor.hh:315
gem5::HSAPacketProcessor::QueueProcessEvent::rqIdx
uint32_t rqIdx
Definition: hsa_packet_processor.hh:294
std::vector
STL vector class.
Definition: stl.hh:37
AQL_PACKET_SIZE
#define AQL_PACKET_SIZE
Definition: hsa_packet_processor.hh:48
gem5::HSAQueueDescriptor::ptr
uint64_t ptr(uint64_t ix)
Definition: hsa_packet_processor.hh:107
gem5::HSAPacketProcessor::translate
TranslationGenPtr translate(Addr vaddr, Addr size) override
Function used to translate a range of addresses from virtual to physical addresses.
Definition: hsa_packet_processor.cc:178
gem5::AQLRingBuffer::hostDispAddr
Addr hostDispAddr() const
Definition: hsa_packet_processor.hh:192
gem5::Q_STATE
Q_STATE
Definition: hsa_packet_processor.hh:63
gem5::HSAPacketProcessor::SignalState::discardRead
bool discardRead
Definition: hsa_packet_processor.hh:280
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::HSAPacketProcessor::pioSize
Addr pioSize
Definition: hsa_packet_processor.hh:349
gem5::HSAPacketProcessor::getCommandsFromHost
void getCommandsFromHost(int pid, uint32_t rl_idx)
Definition: hsa_packet_processor.cc:500
gem5::HSAPacketProcessor::dma_series_ctx::pkts_2_go
uint32_t pkts_2_go
Definition: hsa_packet_processor.hh:390
hsa_queue.hh
gem5::HSAPacketProcessor::walker
VegaISA::Walker * walker
Definition: hsa_packet_processor.hh:262
gem5::HSAPacketProcessor::setDeviceQueueDesc
void setDeviceQueueDesc(uint64_t hostReadIndexPointer, uint64_t basePointer, uint64_t queue_id, uint32_t size, int doorbellSize, GfxVersion gfxVersion, Addr offset=0, uint64_t rd_idx=0)
Definition: hsa_packet_processor.cc:112
hsa.h
gem5::HSAPacketProcessor::RQLEntry::isLastOutstandingPkt
bool isLastOutstandingPkt() const
Definition: hsa_packet_processor.hh:317
gem5::HSAPacketProcessor::SignalState::pendingReads
int pendingReads
Definition: hsa_packet_processor.hh:276
HSA_PACKET_HEADER_WIDTH_TYPE
@ HSA_PACKET_HEADER_WIDTH_TYPE
Definition: hsa.h:2858
gem5::HSAQueueDescriptor::spaceUsed
uint64_t spaceUsed()
Definition: hsa_packet_processor.hh:101
gem5::AQLRingBuffer::freeEntry
bool freeEntry(void *pkt)
Definition: hsa_packet_processor.cc:626
gem5::HSAPacketProcessor::gpu_device
GPUCommandProcessor * gpu_device
Definition: hsa_packet_processor.hh:259
gem5::QCntxt::barrierBit
bool barrierBit
Definition: hsa_packet_processor.hh:247
gem5::HSAPacketProcessor::cmdQueueCmdDma
void cmdQueueCmdDma(HSAPacketProcessor *hsaPP, int pid, bool isRead, uint32_t ix_start, unsigned num_pkts, dma_series_ctx *series_ctx, void *dest_4debug)
Definition: hsa_packet_processor.cc:232
gem5::HSAPacketProcessor::read
virtual Tick read(Packet *) override
Definition: hsa_packet_processor.cc:170
gem5::AQLRingBuffer::compltnPending
uint64_t compltnPending()
Definition: hsa_packet_processor.hh:236
gem5::AQLRingBuffer::ptr
void * ptr(uint32_t ix)
Definition: hsa_packet_processor.hh:226
gem5::HSAPacketProcessor::gpuDevice
AMDGPUDevice * gpuDevice
Definition: hsa_packet_processor.hh:261
gem5::HSAPacketProcessor::finishPkt
void finishPkt(void *pkt)
Definition: hsa_packet_processor.hh:375
gem5::HSAQueueDescriptor::dmaInProgress
bool dmaInProgress
Definition: hsa_packet_processor.hh:88
gem5::QCntxt::QCntxt
QCntxt(HSAQueueDescriptor *q_desc, AQLRingBuffer *aql_buf)
Definition: hsa_packet_processor.hh:248
gem5::GPUCommandProcessor
Definition: gpu_command_processor.hh:70
gem5::HSAPacketProcessor::finishPkt
void finishPkt(void *pkt, uint32_t rl_idx)
Definition: hsa_packet_processor.cc:671
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::HSAPacketProcessor
Definition: hsa_packet_processor.hh:254
gem5::HSAPacketProcessor::handleReadDMA
void handleReadDMA()
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:210
gem5::Event
Definition: eventq.hh:254
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::HSAPacketProcessor::dma_series_ctx
Calls getCurrentEntry once the queueEntry has been dmaRead.
Definition: hsa_packet_processor.hh:386
gem5::HSAQueueDescriptor::isFull
bool isFull()
Definition: hsa_packet_processor.hh:104
gem5::HSAPacketProcessor::getRegdListEntry
class RQLEntry * getRegdListEntry(uint32_t queId)
Definition: hsa_packet_processor.hh:335
gem5::AQLRingBuffer::incWrIdx
void incWrIdx(uint64_t value)
Definition: hsa_packet_processor.hh:234
gem5::AQLRingBuffer::rdIdx
uint64_t rdIdx() const
Definition: hsa_packet_processor.hh:231
gem5::AQLRingBuffer::_aqlBuf
std::vector< hsa_kernel_dispatch_packet_t > _aqlBuf
Definition: hsa_packet_processor.hh:159
gem5::BLOCKED_BBIT
@ BLOCKED_BBIT
Definition: hsa_packet_processor.hh:66
gem5::HSAQueueDescriptor::spaceRemaining
uint64_t spaceRemaining()
Definition: hsa_packet_processor.hh:100
gem5::QCntxt
Definition: hsa_packet_processor.hh:242
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::DmaDevice
Definition: dma_device.hh:218
gem5::HSAPacketProcessor::hwSchdlr
HWScheduler * hwSchdlr
Definition: hsa_packet_processor.hh:260
gem5::AQLRingBuffer::dispPending
bool dispPending() const
Definition: hsa_packet_processor.hh:198
gem5::HSAPacketProcessor::RQLEntry::depSignalRdState
SignalState depSignalRdState
Definition: hsa_packet_processor.hh:313
gem5::HSAPacketProcessor::HSAPacketProcessor
HSAPacketProcessor(const Params &p)
Definition: hsa_packet_processor.cc:76
gem5::HSAQueueDescriptor::stalledOnDmaBufAvailability
bool stalledOnDmaBufAvailability
Definition: hsa_packet_processor.hh:87
gem5::HSAPacketProcessor::dma_series_ctx::dma_series_ctx
dma_series_ctx(uint32_t _pkts_ttl, uint32_t _pkts_2_go, uint32_t _start_ix, uint32_t _rl_idx)
Definition: hsa_packet_processor.hh:394
HSA_PACKET_HEADER_TYPE
@ HSA_PACKET_HEADER_TYPE
Packet type.
Definition: hsa.h:2816
gem5::HSAQueueDescriptor
Definition: hsa_packet_processor.hh:78
gem5::AQLRingBuffer::_name
std::string _name
Definition: hsa_packet_processor.hh:160
gem5::AQLRingBuffer::_dispIdx
uint64_t _dispIdx
Definition: hsa_packet_processor.hh:165
gem5::ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:144
gem5::DmaDevice::Params
DmaDeviceParams Params
Definition: dma_device.hh:224
gem5::AMDGPUDevice
Device model for an AMD GPU.
Definition: amdgpu_device.hh:62
gem5::BLOCKED_BPKT
@ BLOCKED_BPKT
Definition: hsa_packet_processor.hh:69
gem5::HSAPacketProcessor::sendCompletionSignal
void sendCompletionSignal(hsa_signal_value_t signal)
Definition: hsa_packet_processor.cc:743
gem5::HSAPacketProcessor::numHWQueues
int numHWQueues
Definition: hsa_packet_processor.hh:347
gem5::HSAPacketProcessor::RQLEntry::dispPending
bool dispPending()
Definition: hsa_packet_processor.hh:311
gem5::HSAPacketProcessor::RQLEntry::RQLEntry
RQLEntry(HSAPacketProcessor *hsaPP, uint32_t rqIdx)
Definition: hsa_packet_processor.hh:308
gem5::HSAPacketProcessor::displayQueueDescriptor
void displayQueueDescriptor(int pid, uint32_t rl_idx)
Definition: hsa_packet_processor.cc:582
gem5::HSAQueueDescriptor::doorbellPointer
uint64_t doorbellPointer
Definition: hsa_packet_processor.hh:82
gem5::HSAPacketProcessor::updateReadIndex
void updateReadIndex(int, uint32_t)
Definition: hsa_packet_processor.cc:208
gem5::HSAPacketProcessor::RQLEntry::getBarrierBit
bool getBarrierBit() const
Definition: hsa_packet_processor.hh:316
gem5::AQLRingBuffer::setDispIdx
void setDispIdx(uint64_t value)
Definition: hsa_packet_processor.cc:620
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::AQLRingBuffer::_rdIdx
uint64_t _rdIdx
Definition: hsa_packet_processor.hh:164
gem5::HWScheduler
Definition: hw_scheduler.hh:50
gem5::AQLRingBuffer::incDispIdx
void incDispIdx(uint64_t value)
Definition: hsa_packet_processor.hh:235
HSA_PACKET_TYPE_INVALID
@ HSA_PACKET_TYPE_INVALID
The packet has been processed in the past, but has not been reassigned to the packet processor.
Definition: hsa.h:2756
gem5::HSAPacketProcessor::SignalState::handleReadDMA
void handleReadDMA()
Definition: hsa_packet_processor.cc:487
gem5::HSAPacketProcessor::SignalState
Definition: hsa_packet_processor.hh:267
gem5::AQLRingBuffer::isLastOutstandingPkt
bool isLastOutstandingPkt() const
Packets aren't guaranteed to be completed in-order, and we need to know when the last packet is finis...
Definition: hsa_packet_processor.hh:215
gem5::HSAPacketProcessor::sendAgentDispatchCompletionSignal
void sendAgentDispatchCompletionSignal(void *pkt, hsa_signal_value_t signal)
Definition: hsa_packet_processor.cc:713
gem5::QCntxt::aqlBuf
AQLRingBuffer * aqlBuf
Definition: hsa_packet_processor.hh:245
gem5::QCntxt::QCntxt
QCntxt()
Definition: hsa_packet_processor.hh:251
gem5::AQLRingBuffer::wrIdx
uint64_t wrIdx() const
Definition: hsa_packet_processor.hh:230
gem5::AQLRingBuffer::_hostDispAddresses
std::vector< Addr > _hostDispAddresses
Definition: hsa_packet_processor.hh:161
gem5::HSAPacketProcessor::regdQList
std::vector< class RQLEntry * > regdQList
Definition: hsa_packet_processor.hh:323
gem5::HSAPacketProcessor::pktProcessDelay
const Tick pktProcessDelay
Definition: hsa_packet_processor.hh:351
gem5::HSAPacketProcessor::setDevice
void setDevice(GPUCommandProcessor *dev)
Definition: hsa_packet_processor.cc:646
gem5::AQLRingBuffer::incRdIdx
void incRdIdx(uint64_t value)
Definition: hsa_packet_processor.hh:233
gem5::HSAPacketProcessor::dma_series_ctx::pkts_ttl
uint32_t pkts_ttl
Definition: hsa_packet_processor.hh:389
types.hh
gem5::HSAPacketProcessor::hwScheduler
HWScheduler * hwScheduler()
Definition: hsa_packet_processor.hh:368
gem5::HSAPacketProcessor::QueueProcessEvent::QueueProcessEvent
QueueProcessEvent(HSAPacketProcessor *_hsaPP, uint32_t _rqIdx)
Definition: hsa_packet_processor.hh:296
gem5::HSAQueueDescriptor::numElts
uint32_t numElts
Definition: hsa_packet_processor.hh:85
gem5::AQLRingBuffer
Internal ring buffer which is used to prefetch/store copies of the in-memory HSA ring buffer.
Definition: hsa_packet_processor.hh:156
gem5::QCntxt::qDesc
HSAQueueDescriptor * qDesc
Definition: hsa_packet_processor.hh:244
gem5::HSAPacketProcessor::SignalState::allRead
bool allRead
Definition: hsa_packet_processor.hh:277
gem5::AQLRingBuffer::rdIdxPtr
uint64_t * rdIdxPtr()
Definition: hsa_packet_processor.hh:232
gem5::HSAPacketProcessor::QueueProcessEvent::description
virtual const char * description() const
Return a C string describing the event.
gem5::HSAPacketProcessor::Params
HSAPacketProcessorParams Params
Definition: hsa_packet_processor.hh:353
gem5::HSAQueueDescriptor::objSize
uint32_t objSize()
Definition: hsa_packet_processor.hh:102
gem5::HSAPacketProcessor::getAddrRanges
virtual AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Definition: hsa_packet_processor.cc:128
gem5::HSAQueueDescriptor::HSAQueueDescriptor
HSAQueueDescriptor(uint64_t base_ptr, uint64_t db_ptr, uint64_t hri_ptr, uint32_t size, GfxVersion gfxVersion)
Definition: hsa_packet_processor.hh:91
dma_virt_device.hh
gem5::HSAPacketProcessor::~HSAPacketProcessor
~HSAPacketProcessor()
Definition: hsa_packet_processor.cc:89
gem5::HSAPacketProcessor::SignalState::values
std::vector< hsa_signal_value_t > values
Definition: hsa_packet_processor.hh:282
gem5::HSAPacketProcessor::RQLEntry
Definition: hsa_packet_processor.hh:305
gem5::AQLRingBuffer::nFree
uint32_t nFree() const
Definition: hsa_packet_processor.hh:225
gem5::AQLRingBuffer::_aqlComplete
std::vector< bool > _aqlComplete
Definition: hsa_packet_processor.hh:162
gem5::DmaVirtDevice
Definition: dma_virt_device.hh:41
gem5::MipsISA::vaddr
vaddr
Definition: pra_constants.hh:278
std::list< AddrRange >
gem5::HSAPacketProcessor::updateReadDispIdDma
void updateReadDispIdDma()
this event is used to update the read_disp_id field (the read pointer) of the MQD,...
Definition: hsa_packet_processor.cc:202
gem5::EventBase::Default_Pri
static const Priority Default_Pri
Default is zero for historical reasons.
Definition: eventq.hh:182
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::AQLRingBuffer::objSize
uint32_t objSize() const
Definition: hsa_packet_processor.hh:228
gem5::HSAPacketProcessor::QueueProcessEvent::process
virtual void process()
Definition: hsa_packet_processor.cc:435
gem5::HSAPacketProcessor::write
virtual Tick write(Packet *) override
Definition: hsa_packet_processor.cc:140
gem5::UNBLOCKED
@ UNBLOCKED
Definition: hsa_packet_processor.hh:65
gem5::HSAPacketProcessor::DmaFnPtr
void(DmaDevice::* DmaFnPtr)(Addr, int, Event *, uint8_t *, Tick)
Definition: hsa_packet_processor.hh:258
gem5::HSAPacketProcessor::dma_series_ctx::rl_idx
uint32_t rl_idx
Definition: hsa_packet_processor.hh:392
gem5::TranslationGenPtr
std::unique_ptr< TranslationGen > TranslationGenPtr
Definition: translation_gen.hh:128
gem5::HSAQueueDescriptor::writeIndex
uint64_t writeIndex
Definition: hsa_packet_processor.hh:83
gem5::AQLRingBuffer::setRdIdx
void setRdIdx(uint64_t value)
Definition: hsa_packet_processor.cc:608
gem5::VegaISA::Walker
Definition: pagetable_walker.hh:54
gem5::AQLRingBuffer::dispIdx
uint64_t dispIdx() const
Definition: hsa_packet_processor.hh:229
gem5::HSAPacketProcessor::RQLEntry::aqlProcessEvent
QueueProcessEvent aqlProcessEvent
Definition: hsa_packet_processor.hh:314
eventq.hh

Generated on Sun Jul 30 2023 01:56:55 for gem5 by doxygen 1.8.17