Go to the documentation of this file.
34 #ifndef __DEV_HSA_HSA_PACKET_PROCESSOR__
35 #define __DEV_HSA_HSA_PACKET_PROCESSOR__
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
72 class GPUCommandProcessor;
89 uint64_t hri_ptr, uint32_t size)
158 for (
int i = 0;
i < num_pkts; ++
i) {
300 return regdQList.at(queId)->qCntxt.qDesc;
311 auto aqlBuf =
regdQList.at(queId)->qCntxt.aqlBuf;
312 return aqlBuf->dispIdx() - aqlBuf->rdIdx();
326 uint64_t basePointer,
328 uint32_t size,
int doorbellSize);
338 void finishPkt(
void *pkt, uint32_t rl_idx);
370 uint32_t ix_start,
unsigned num_pkts,
371 dma_series_ctx *series_ctx,
void *dest_4debug);
377 #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)
HSAPacketProcessor * hsaPP
Q_STATE processPkt(void *pkt, uint32_t rl_idx, Addr host_pkt_addr)
uint64_t hostReadIndexPtr
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)
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)
bool isLastOutstandingPkt() const
@ HSA_PACKET_HEADER_WIDTH_TYPE
HSAQueueDescriptor(uint64_t base_ptr, uint64_t db_ptr, uint64_t hri_ptr, uint32_t size)
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.
void translateOrDie(Addr vaddr, Addr &paddr) override
Function used to translate from virtual to physical addresses.
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.
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
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)
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...
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)
QueueProcessEvent aqlProcessEvent
Generated on Tue Sep 21 2021 12:25:15 for gem5 by doxygen 1.8.17