gem5
v20.1.0.0
|
Internal ring buffer which is used to prefetch/store copies of the in-memory HSA ring buffer. More...
#include <hsa_packet_processor.hh>
Public Member Functions | |
std::string | name () |
AQLRingBuffer (uint32_t size, const std::string name) | |
int | allocEntry (uint32_t nBufReq) |
bool | freeEntry (void *pkt) |
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 corresponds to each of the dispatch packets this AQL buffer is storing. More... | |
Addr | hostDispAddr () const |
bool | dispPending () const |
bool | isLastOutstandingPkt () const |
Packets aren't guaranteed to be completed in-order, and we need to know when the last packet is finished in order to un-set the barrier bit. More... | |
uint32_t | nFree () const |
void * | ptr (uint32_t ix) |
uint32_t | numObjs () const |
uint32_t | objSize () const |
uint64_t | dispIdx () const |
uint64_t | wrIdx () const |
uint64_t | rdIdx () const |
uint64_t * | rdIdxPtr () |
void | incRdIdx (uint64_t value) |
void | incWrIdx (uint64_t value) |
void | incDispIdx (uint64_t value) |
uint64_t | compltnPending () |
Private Attributes | |
std::vector< hsa_kernel_dispatch_packet_t > | _aqlBuf |
std::string | _name |
std::vector< Addr > | _hostDispAddresses |
std::vector< bool > | _aqlComplete |
uint64_t | _wrIdx |
uint64_t | _rdIdx |
uint64_t | _dispIdx |
Internal ring buffer which is used to prefetch/store copies of the in-memory HSA ring buffer.
Each packet in the queue has three implicit states tracked by a packet's relative location to the write, read, and dispatch pointers.
FREE: Entry is empty ALLOCATED: Entry has been allocated for a packet, but the DMA has not yet completed SUBMITTED: Packet has been submitted to the HSADevice, but has not yet completed
Definition at line 117 of file hsa_packet_processor.hh.
AQLRingBuffer::AQLRingBuffer | ( | uint32_t | size, |
const std::string | name | ||
) |
Definition at line 602 of file hsa_packet_processor.cc.
References _aqlBuf, _aqlComplete, _hostDispAddresses, MipsISA::fill, and HSA_PACKET_TYPE_INVALID.
int AQLRingBuffer::allocEntry | ( | uint32_t | nBufReq | ) |
Definition at line 642 of file hsa_packet_processor.cc.
References DPRINTF, incWrIdx(), nFree(), and wrIdx().
Referenced by HSAPacketProcessor::getCommandsFromHost().
|
inline |
Definition at line 197 of file hsa_packet_processor.hh.
References _dispIdx, and _rdIdx.
Referenced by HSAPacketProcessor::RQLEntry::compltnPending().
|
inline |
Definition at line 190 of file hsa_packet_processor.hh.
References _dispIdx.
Referenced by hostDispAddr(), HWScheduler::isRLQIdle(), and HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 159 of file hsa_packet_processor.hh.
References _aqlBuf, _dispIdx, _wrIdx, HSA_PACKET_HEADER_TYPE, HSA_PACKET_HEADER_WIDTH_TYPE, and HSA_PACKET_TYPE_INVALID.
Referenced by HSAPacketProcessor::RQLEntry::dispPending().
bool AQLRingBuffer::freeEntry | ( | void * | pkt | ) |
Definition at line 616 of file hsa_packet_processor.cc.
References _aqlBuf, _aqlComplete, DPRINTF, HSA_PACKET_TYPE_INVALID, incRdIdx(), nFree(), numObjs(), rdIdx(), and wrIdx().
|
inline |
Definition at line 153 of file hsa_packet_processor.hh.
References _hostDispAddresses, dispIdx(), and numObjs().
Referenced by HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 196 of file hsa_packet_processor.hh.
References _dispIdx.
Referenced by HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 194 of file hsa_packet_processor.hh.
References _rdIdx.
Referenced by freeEntry().
|
inline |
Definition at line 195 of file hsa_packet_processor.hh.
References _wrIdx.
Referenced by allocEntry().
|
inline |
Packets aren't guaranteed to be completed in-order, and we need to know when the last packet is finished in order to un-set the barrier bit.
In order to confirm if the packet at _rdIdx is the last packet, we check if the packets ahead of _rdIdx are finished. If they are, _rdIdx is the last packet. If not, there are other outstanding packets.
Definition at line 176 of file hsa_packet_processor.hh.
References _aqlBuf, _aqlComplete, _dispIdx, _rdIdx, and ArmISA::i.
Referenced by HSAPacketProcessor::RQLEntry::isLastOutstandingPkt().
|
inline |
Definition at line 129 of file hsa_packet_processor.hh.
References _name.
|
inline |
Definition at line 186 of file hsa_packet_processor.hh.
References _aqlBuf, _rdIdx, and _wrIdx.
Referenced by allocEntry(), and freeEntry().
|
inline |
Definition at line 188 of file hsa_packet_processor.hh.
References _aqlBuf.
Referenced by freeEntry(), HSAPacketProcessor::getCommandsFromHost(), hostDispAddr(), and saveHostDispAddr().
|
inline |
Definition at line 189 of file hsa_packet_processor.hh.
References AQL_PACKET_SIZE.
Referenced by saveHostDispAddr().
|
inline |
Definition at line 187 of file hsa_packet_processor.hh.
References _aqlBuf.
Referenced by HSAPacketProcessor::getCommandsFromHost(), and HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 192 of file hsa_packet_processor.hh.
References _rdIdx.
Referenced by freeEntry(), HWScheduler::isRLQIdle(), HSAPacketProcessor::QueueProcessEvent::process(), and HSAPacketProcessor::updateReadIndex().
|
inline |
Definition at line 193 of file hsa_packet_processor.hh.
References _rdIdx.
Referenced by HSAPacketProcessor::updateReadIndex().
|
inline |
the kernel may try to read from the dispatch packet, so we need to keep the host address that corresponds to each of the dispatch packets this AQL buffer is storing.
when we call submitPkt(), we send along the corresponding host address for the packet so the wavefront can properly initialize its SGPRs - which may include a pointer to the dispatch packet
Definition at line 144 of file hsa_packet_processor.hh.
References _hostDispAddresses, ArmISA::i, numObjs(), and objSize().
Referenced by HSAPacketProcessor::getCommandsFromHost().
|
inline |
Definition at line 191 of file hsa_packet_processor.hh.
References _wrIdx.
Referenced by allocEntry(), freeEntry(), HSAPacketProcessor::getCommandsFromHost(), HSAPacketProcessor::QueueProcessEvent::process(), and HSAPacketProcessor::updateReadIndex().
|
private |
Definition at line 120 of file hsa_packet_processor.hh.
Referenced by AQLRingBuffer(), dispPending(), freeEntry(), isLastOutstandingPkt(), nFree(), numObjs(), and ptr().
|
private |
Definition at line 123 of file hsa_packet_processor.hh.
Referenced by AQLRingBuffer(), freeEntry(), and isLastOutstandingPkt().
|
private |
Definition at line 126 of file hsa_packet_processor.hh.
Referenced by compltnPending(), dispIdx(), dispPending(), incDispIdx(), and isLastOutstandingPkt().
|
private |
Definition at line 122 of file hsa_packet_processor.hh.
Referenced by AQLRingBuffer(), hostDispAddr(), and saveHostDispAddr().
|
private |
Definition at line 121 of file hsa_packet_processor.hh.
Referenced by name().
|
private |
Definition at line 125 of file hsa_packet_processor.hh.
Referenced by compltnPending(), incRdIdx(), isLastOutstandingPkt(), nFree(), rdIdx(), and rdIdxPtr().
|
private |
Definition at line 124 of file hsa_packet_processor.hh.
Referenced by dispPending(), incWrIdx(), nFree(), and wrIdx().