gem5  v22.1.0.0
Public Member Functions | Private Attributes | List of all members
gem5::AQLRingBuffer Class Reference

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 ()
 
void setRdIdx (uint64_t value)
 
void setWrIdx (uint64_t value)
 
void setDispIdx (uint64_t value)
 

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
 

Detailed Description

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 156 of file hsa_packet_processor.hh.

Constructor & Destructor Documentation

◆ AQLRingBuffer()

gem5::AQLRingBuffer::AQLRingBuffer ( uint32_t  size,
const std::string  name 
)

Member Function Documentation

◆ allocEntry()

int gem5::AQLRingBuffer::allocEntry ( uint32_t  nBufReq)

Definition at line 652 of file hsa_packet_processor.cc.

References DPRINTF, incWrIdx(), nFree(), and wrIdx().

Referenced by gem5::HSAPacketProcessor::getCommandsFromHost().

◆ compltnPending()

uint64_t gem5::AQLRingBuffer::compltnPending ( )
inline

Definition at line 236 of file hsa_packet_processor.hh.

References _dispIdx, and _rdIdx.

Referenced by gem5::HSAPacketProcessor::RQLEntry::compltnPending().

◆ dispIdx()

uint64_t gem5::AQLRingBuffer::dispIdx ( ) const
inline

◆ dispPending()

bool gem5::AQLRingBuffer::dispPending ( ) const
inline

◆ freeEntry()

bool gem5::AQLRingBuffer::freeEntry ( void *  pkt)

◆ hostDispAddr()

Addr gem5::AQLRingBuffer::hostDispAddr ( ) const
inline

◆ incDispIdx()

void gem5::AQLRingBuffer::incDispIdx ( uint64_t  value)
inline

Definition at line 235 of file hsa_packet_processor.hh.

References _dispIdx.

Referenced by gem5::HSAPacketProcessor::QueueProcessEvent::process().

◆ incRdIdx()

void gem5::AQLRingBuffer::incRdIdx ( uint64_t  value)
inline

Definition at line 233 of file hsa_packet_processor.hh.

References _rdIdx.

Referenced by freeEntry().

◆ incWrIdx()

void gem5::AQLRingBuffer::incWrIdx ( uint64_t  value)
inline

Definition at line 234 of file hsa_packet_processor.hh.

References _wrIdx.

Referenced by allocEntry().

◆ isLastOutstandingPkt()

bool gem5::AQLRingBuffer::isLastOutstandingPkt ( ) const
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 215 of file hsa_packet_processor.hh.

References _aqlBuf, _aqlComplete, _dispIdx, _rdIdx, and gem5::ArmISA::i.

Referenced by gem5::HSAPacketProcessor::RQLEntry::isLastOutstandingPkt().

◆ name()

std::string gem5::AQLRingBuffer::name ( )
inline

Definition at line 168 of file hsa_packet_processor.hh.

References _name.

◆ nFree()

uint32_t gem5::AQLRingBuffer::nFree ( ) const
inline

Definition at line 225 of file hsa_packet_processor.hh.

References _aqlBuf, _rdIdx, and _wrIdx.

Referenced by allocEntry(), and freeEntry().

◆ numObjs()

uint32_t gem5::AQLRingBuffer::numObjs ( ) const
inline

◆ objSize()

uint32_t gem5::AQLRingBuffer::objSize ( ) const
inline

Definition at line 228 of file hsa_packet_processor.hh.

References AQL_PACKET_SIZE.

Referenced by saveHostDispAddr().

◆ ptr()

void* gem5::AQLRingBuffer::ptr ( uint32_t  ix)
inline

◆ rdIdx()

uint64_t gem5::AQLRingBuffer::rdIdx ( ) const
inline

◆ rdIdxPtr()

uint64_t* gem5::AQLRingBuffer::rdIdxPtr ( )
inline

Definition at line 232 of file hsa_packet_processor.hh.

References _rdIdx.

Referenced by gem5::HSAPacketProcessor::updateReadIndex().

◆ saveHostDispAddr()

void gem5::AQLRingBuffer::saveHostDispAddr ( Addr  host_pkt_addr,
int  num_pkts,
int  ix 
)
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 183 of file hsa_packet_processor.hh.

References _hostDispAddresses, gem5::ArmISA::i, numObjs(), and objSize().

Referenced by gem5::HSAPacketProcessor::getCommandsFromHost().

◆ setDispIdx()

void gem5::AQLRingBuffer::setDispIdx ( uint64_t  value)

Definition at line 620 of file hsa_packet_processor.cc.

References _dispIdx.

Referenced by gem5::HWScheduler::registerNewQueue().

◆ setRdIdx()

void gem5::AQLRingBuffer::setRdIdx ( uint64_t  value)

Definition at line 608 of file hsa_packet_processor.cc.

References _rdIdx.

Referenced by gem5::HWScheduler::registerNewQueue().

◆ setWrIdx()

void gem5::AQLRingBuffer::setWrIdx ( uint64_t  value)

Definition at line 614 of file hsa_packet_processor.cc.

References _wrIdx.

Referenced by gem5::HWScheduler::registerNewQueue().

◆ wrIdx()

uint64_t gem5::AQLRingBuffer::wrIdx ( ) const
inline

Member Data Documentation

◆ _aqlBuf

std::vector<hsa_kernel_dispatch_packet_t> gem5::AQLRingBuffer::_aqlBuf
private

◆ _aqlComplete

std::vector<bool> gem5::AQLRingBuffer::_aqlComplete
private

Definition at line 162 of file hsa_packet_processor.hh.

Referenced by AQLRingBuffer(), freeEntry(), and isLastOutstandingPkt().

◆ _dispIdx

uint64_t gem5::AQLRingBuffer::_dispIdx
private

◆ _hostDispAddresses

std::vector<Addr> gem5::AQLRingBuffer::_hostDispAddresses
private

Definition at line 161 of file hsa_packet_processor.hh.

Referenced by AQLRingBuffer(), hostDispAddr(), and saveHostDispAddr().

◆ _name

std::string gem5::AQLRingBuffer::_name
private

Definition at line 160 of file hsa_packet_processor.hh.

Referenced by name().

◆ _rdIdx

uint64_t gem5::AQLRingBuffer::_rdIdx
private

◆ _wrIdx

uint64_t gem5::AQLRingBuffer::_wrIdx
private

Definition at line 163 of file hsa_packet_processor.hh.

Referenced by dispPending(), incWrIdx(), nFree(), setWrIdx(), and wrIdx().


The documentation for this class was generated from the following files:

Generated on Wed Dec 21 2022 10:23:19 for gem5 by doxygen 1.9.1