Go to the documentation of this file.
32 #ifndef __DEV_HSA_HSA_PACKET_PROCESSOR__
33 #define __DEV_HSA_HSA_PACKET_PROCESSOR__
40 #include "debug/HSAPacketProcessor.hh"
44 #include "enums/GfxVersion.hh"
45 #include "params/HSAPacketProcessor.hh"
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)
53 #define NumSignalsPerBarrier 5
74 class GPUCommandProcessor;
92 uint64_t hri_ptr, uint32_t size,
125 uint64_t retAddr = 0ll;
130 "index: 0x%x, numElts: 0x%x, numElts/2: 0x%x, "
136 "index: 0x%x, numElts: 0x%x, objSize: 0x%x, "
185 for (
int i = 0;
i < num_pkts; ++
i) {
332 return regdQList.at(queId)->qCntxt.qDesc;
343 auto aqlBuf =
regdQList.at(queId)->qCntxt.aqlBuf;
344 return aqlBuf->dispIdx() - aqlBuf->rdIdx();
358 uint64_t basePointer,
360 uint32_t size,
int doorbellSize,
361 GfxVersion gfxVersion,
374 void finishPkt(
void *pkt, uint32_t rl_idx);
406 uint32_t ix_start,
unsigned num_pkts,
407 dma_series_ctx *series_ctx,
void *dest_4debug);
413 #endif // __DEV_HSA_HSA_PACKET_PROCESSOR__
AQLRingBuffer(uint32_t size, const std::string name)
void schedAQLProcessing(uint32_t rl_idx)
int allocEntry(uint32_t nBufReq)
void setGPUDevice(AMDGPUDevice *gpu_device)
HSAPacketProcessor * hsaPP
Q_STATE processPkt(void *pkt, uint32_t rl_idx, Addr host_pkt_addr)
uint64_t hostReadIndexPtr
void setWrIdx(uint64_t value)
int32_t hsa_signal_value_t
Signal value.
uint64_t compltnPending()
void unsetDeviceQueueDesc(uint64_t queue_id, int doorbellSize)
HSAQueueDescriptor * getQueueDesc(uint32_t queId)
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...
#define NumSignalsPerBarrier
uint64_t inFlightPkts(uint32_t queId)
void setBarrierBit(bool set_val)
uint64_t ptr(uint64_t ix)
TranslationGenPtr translate(Addr vaddr, Addr size) override
Function used to translate a range of addresses from virtual to physical addresses.
Addr hostDispAddr() const
void getCommandsFromHost(int pid, uint32_t rl_idx)
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)
bool isLastOutstandingPkt() const
@ HSA_PACKET_HEADER_WIDTH_TYPE
bool freeEntry(void *pkt)
GPUCommandProcessor * gpu_device
void cmdQueueCmdDma(HSAPacketProcessor *hsaPP, int pid, bool isRead, uint32_t ix_start, unsigned num_pkts, dma_series_ctx *series_ctx, void *dest_4debug)
virtual Tick read(Packet *) override
uint64_t compltnPending()
void finishPkt(void *pkt)
QCntxt(HSAQueueDescriptor *q_desc, AQLRingBuffer *aql_buf)
void finishPkt(void *pkt, uint32_t rl_idx)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Calls getCurrentEntry once the queueEntry has been dmaRead.
class RQLEntry * getRegdListEntry(uint32_t queId)
void incWrIdx(uint64_t value)
std::vector< hsa_kernel_dispatch_packet_t > _aqlBuf
uint64_t spaceRemaining()
uint64_t Tick
Tick count type.
SignalState depSignalRdState
HSAPacketProcessor(const Params &p)
bool stalledOnDmaBufAvailability
dma_series_ctx(uint32_t _pkts_ttl, uint32_t _pkts_2_go, uint32_t _start_ix, uint32_t _rl_idx)
@ HSA_PACKET_HEADER_TYPE
Packet type.
Device model for an AMD GPU.
void sendCompletionSignal(hsa_signal_value_t signal)
RQLEntry(HSAPacketProcessor *hsaPP, uint32_t rqIdx)
void displayQueueDescriptor(int pid, uint32_t rl_idx)
void updateReadIndex(int, uint32_t)
bool getBarrierBit() const
void setDispIdx(uint64_t value)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void incDispIdx(uint64_t value)
@ HSA_PACKET_TYPE_INVALID
The packet has been processed in the past, but has not been reassigned to the packet processor.
bool isLastOutstandingPkt() const
Packets aren't guaranteed to be completed in-order, and we need to know when the last packet is finis...
void sendAgentDispatchCompletionSignal(void *pkt, hsa_signal_value_t signal)
std::vector< Addr > _hostDispAddresses
std::vector< class RQLEntry * > regdQList
const Tick pktProcessDelay
void setDevice(GPUCommandProcessor *dev)
void incRdIdx(uint64_t value)
HWScheduler * hwScheduler()
QueueProcessEvent(HSAPacketProcessor *_hsaPP, uint32_t _rqIdx)
Internal ring buffer which is used to prefetch/store copies of the in-memory HSA ring buffer.
HSAQueueDescriptor * qDesc
virtual const char * description() const
Return a C string describing the event.
HSAPacketProcessorParams Params
virtual AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
HSAQueueDescriptor(uint64_t base_ptr, uint64_t db_ptr, uint64_t hri_ptr, uint32_t size, GfxVersion gfxVersion)
std::vector< hsa_signal_value_t > values
std::vector< bool > _aqlComplete
void updateReadDispIdDma()
this event is used to update the read_disp_id field (the read pointer) of the MQD,...
static const Priority Default_Pri
Default is zero for historical reasons.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
virtual Tick write(Packet *) override
void(DmaDevice::* DmaFnPtr)(Addr, int, Event *, uint8_t *, Tick)
std::unique_ptr< TranslationGen > TranslationGenPtr
void setRdIdx(uint64_t value)
QueueProcessEvent aqlProcessEvent
Generated on Sun Jul 30 2023 01:56:55 for gem5 by doxygen 1.8.17