gem5
v21.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 GPUCommandProcessor, but has not yet completed
Definition at line 129 of file hsa_packet_processor.hh.
gem5::AQLRingBuffer::AQLRingBuffer | ( | uint32_t | size, |
const std::string | name | ||
) |
Definition at line 571 of file hsa_packet_processor.cc.
References _aqlBuf, _aqlComplete, _hostDispAddresses, gem5::MipsISA::fill, and HSA_PACKET_TYPE_INVALID.
int gem5::AQLRingBuffer::allocEntry | ( | uint32_t | nBufReq | ) |
Definition at line 611 of file hsa_packet_processor.cc.
References DPRINTF, incWrIdx(), nFree(), and wrIdx().
Referenced by gem5::HSAPacketProcessor::getCommandsFromHost().
|
inline |
Definition at line 209 of file hsa_packet_processor.hh.
References _dispIdx, and _rdIdx.
Referenced by gem5::HSAPacketProcessor::RQLEntry::compltnPending().
|
inline |
Definition at line 202 of file hsa_packet_processor.hh.
References _dispIdx.
Referenced by hostDispAddr(), and gem5::HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 171 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 gem5::HSAPacketProcessor::RQLEntry::dispPending().
bool gem5::AQLRingBuffer::freeEntry | ( | void * | pkt | ) |
Definition at line 585 of file hsa_packet_processor.cc.
References _aqlBuf, _aqlComplete, DPRINTF, HSA_PACKET_TYPE_INVALID, incRdIdx(), nFree(), numObjs(), rdIdx(), and wrIdx().
|
inline |
Definition at line 165 of file hsa_packet_processor.hh.
References _hostDispAddresses, dispIdx(), and numObjs().
Referenced by gem5::HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 208 of file hsa_packet_processor.hh.
References _dispIdx.
Referenced by gem5::HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 206 of file hsa_packet_processor.hh.
References _rdIdx.
Referenced by freeEntry().
|
inline |
Definition at line 207 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 188 of file hsa_packet_processor.hh.
References _aqlBuf, _aqlComplete, _dispIdx, _rdIdx, and gem5::ArmISA::i.
Referenced by gem5::HSAPacketProcessor::RQLEntry::isLastOutstandingPkt().
|
inline |
Definition at line 141 of file hsa_packet_processor.hh.
References _name.
|
inline |
Definition at line 198 of file hsa_packet_processor.hh.
References _aqlBuf, _rdIdx, and _wrIdx.
Referenced by allocEntry(), and freeEntry().
|
inline |
Definition at line 200 of file hsa_packet_processor.hh.
References _aqlBuf.
Referenced by freeEntry(), gem5::HSAPacketProcessor::getCommandsFromHost(), hostDispAddr(), and saveHostDispAddr().
|
inline |
Definition at line 201 of file hsa_packet_processor.hh.
References AQL_PACKET_SIZE.
Referenced by saveHostDispAddr().
|
inline |
Definition at line 199 of file hsa_packet_processor.hh.
References _aqlBuf.
Referenced by gem5::HSAPacketProcessor::getCommandsFromHost(), and gem5::HSAPacketProcessor::QueueProcessEvent::process().
|
inline |
Definition at line 204 of file hsa_packet_processor.hh.
References _rdIdx.
Referenced by freeEntry(), gem5::HSAPacketProcessor::QueueProcessEvent::process(), and gem5::HSAPacketProcessor::updateReadIndex().
|
inline |
Definition at line 205 of file hsa_packet_processor.hh.
References _rdIdx.
Referenced by gem5::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 156 of file hsa_packet_processor.hh.
References _hostDispAddresses, gem5::ArmISA::i, numObjs(), and objSize().
Referenced by gem5::HSAPacketProcessor::getCommandsFromHost().
|
inline |
Definition at line 203 of file hsa_packet_processor.hh.
References _wrIdx.
Referenced by allocEntry(), freeEntry(), gem5::HSAPacketProcessor::getCommandsFromHost(), gem5::HSAPacketProcessor::QueueProcessEvent::process(), and gem5::HSAPacketProcessor::updateReadIndex().
|
private |
Definition at line 132 of file hsa_packet_processor.hh.
Referenced by AQLRingBuffer(), dispPending(), freeEntry(), isLastOutstandingPkt(), nFree(), numObjs(), and ptr().
|
private |
Definition at line 135 of file hsa_packet_processor.hh.
Referenced by AQLRingBuffer(), freeEntry(), and isLastOutstandingPkt().
|
private |
Definition at line 138 of file hsa_packet_processor.hh.
Referenced by compltnPending(), dispIdx(), dispPending(), incDispIdx(), and isLastOutstandingPkt().
|
private |
Definition at line 134 of file hsa_packet_processor.hh.
Referenced by AQLRingBuffer(), hostDispAddr(), and saveHostDispAddr().
|
private |
Definition at line 133 of file hsa_packet_processor.hh.
Referenced by name().
|
private |
Definition at line 137 of file hsa_packet_processor.hh.
Referenced by compltnPending(), incRdIdx(), isLastOutstandingPkt(), nFree(), rdIdx(), and rdIdxPtr().
|
private |
Definition at line 136 of file hsa_packet_processor.hh.
Referenced by dispPending(), incWrIdx(), nFree(), and wrIdx().