| gem5
    v21.1.0.2
    | 
#include <hsa_queue_entry.hh>
| Public Member Functions | |
| HSAQueueEntry (std::string kernel_name, uint32_t queue_id, int dispatch_id, void *disp_pkt, AMDKernelCode *akc, Addr host_pkt_addr, Addr code_addr) | |
| const std::string & | kernelName () const | 
| int | wgSize (int dim) const | 
| int | gridSize (int dim) const | 
| int | numVectorRegs () const | 
| int | numScalarRegs () const | 
| uint32_t | queueId () const | 
| int | dispatchId () const | 
| void * | dispPktPtr () | 
| Addr | hostDispPktAddr () const | 
| Addr | completionSignal () const | 
| Addr | codeAddr () const | 
| Addr | kernargAddr () const | 
| int | ldsSize () const | 
| int | privMemPerItem () const | 
| int | contextId () const | 
| bool | dispComplete () const | 
| int | wgId (int dim) const | 
| void | wgId (int dim, int val) | 
| int | globalWgId () const | 
| void | globalWgId (int val) | 
| int | numWg (int dim) const | 
| void | notifyWgCompleted () | 
| int | numWgCompleted () const | 
| int | numWgTotal () const | 
| void | markWgDispatch () | 
| int | numWgAtBarrier () const | 
| bool | vgprBitEnabled (int bit) const | 
| bool | sgprBitEnabled (int bit) const | 
| int | outstandingInvs () | 
| bool | isInvStarted () | 
| Whether invalidate has started or finished -1 is the initial value indicating inv has not started for the kernel.  More... | |
| void | updateOutstandingInvs (int val) | 
| update the number of pending invalidate requests  More... | |
| void | markInvDone () | 
| Forcefully change the state to be inv done.  More... | |
| bool | isInvDone () const | 
| Is invalidate done?  More... | |
| int | outstandingWbs () const | 
| void | updateOutstandingWbs (int val) | 
| Update the number of pending writeback requests.  More... | |
| Public Attributes | |
| Addr | hostAMDQueueAddr | 
| Host-side addr of the amd_queue_t on which this task was queued.  More... | |
| _amd_queue_t | amdQueue | 
| Keep a copy of the AMD HSA queue because we need info from some of its fields to initialize register state.  More... | |
| Static Public Attributes | |
| const static int | MAX_DIM = 3 | 
| Private Member Functions | |
| void | parseKernelCode (AMDKernelCode *akc) | 
| Private Attributes | |
| std::string | kernName | 
| std::array< int, MAX_DIM > | _wgSize | 
| std::array< int, MAX_DIM > | _gridSize | 
| int | numVgprs | 
| int | numSgprs | 
| uint32_t | _queueId | 
| int | _dispatchId | 
| void * | dispPkt | 
| Addr | _hostDispPktAddr | 
| Addr | _completionSignal | 
| Addr | codeAddress | 
| Addr | kernargAddress | 
| int | _outstandingInvs | 
| Number of outstanding invs for the kernel.  More... | |
| int | _outstandingWbs | 
| Number of outstanding wbs for the kernel values: 0: 1)initial value, flush has not started for the kernel 2)+1->0: all wb requests are finished, i.e., flush done ?: positive value, indicating the number of pending wb requests.  More... | |
| int | _ldsSize | 
| int | _privMemPerItem | 
| int | _contextId | 
| std::array< int, MAX_DIM > | _wgId | 
| std::array< int, MAX_DIM > | _numWg | 
| int | _numWgTotal | 
| int | numWgArrivedAtBarrier | 
| int | _numWgCompleted | 
| int | _globalWgId | 
| bool | dispatchComplete | 
| std::bitset< NumVectorInitFields > | initialVgprState | 
| std::bitset< NumScalarInitFields > | initialSgprState | 
Definition at line 61 of file hsa_queue_entry.hh.
| 
 | inline | 
Definition at line 64 of file hsa_queue_entry.hh.
| 
 | inline | 
Definition at line 179 of file hsa_queue_entry.hh.
References codeAddress.
Referenced by gem5::ComputeUnit::startWavefront(), and gem5::GPUCommandProcessor::submitDispatchPkt().
| 
 | inline | 
Definition at line 173 of file hsa_queue_entry.hh.
References _completionSignal.
Referenced by gem5::GPUCommandProcessor::submitAgentDispatchPkt().
| 
 | inline | 
Definition at line 199 of file hsa_queue_entry.hh.
References _contextId.
| 
 | inline | 
Definition at line 155 of file hsa_queue_entry.hh.
References _dispatchId.
Referenced by gem5::GPUDispatcher::dispatch(), gem5::ComputeUnit::dispWorkgroup(), gem5::Shader::prepareInvalidate(), and gem5::ComputeUnit::startWavefront().
| 
 | inline | 
Definition at line 205 of file hsa_queue_entry.hh.
References dispatchComplete.
Referenced by gem5::Shader::dispatchWorkgroups().
| 
 | inline | 
Definition at line 161 of file hsa_queue_entry.hh.
References dispPkt.
| 
 | inline | 
Definition at line 225 of file hsa_queue_entry.hh.
References _globalWgId.
Referenced by gem5::Shader::dispatchWorkgroups(), gem5::ComputeUnit::dispWorkgroup(), and gem5::ComputeUnit::startWavefront().
| 
 | inline | 
Definition at line 231 of file hsa_queue_entry.hh.
References _globalWgId, and gem5::X86ISA::val.
| 
 | inline | 
Definition at line 130 of file hsa_queue_entry.hh.
References _gridSize, and MAX_DIM.
Referenced by gem5::ComputeUnit::fillKernelState(), gem5::ComputeUnit::hasDispResources(), gem5::Wavefront::initRegState(), and markWgDispatch().
| 
 | inline | 
Definition at line 167 of file hsa_queue_entry.hh.
References _hostDispPktAddr.
Referenced by gem5::Wavefront::initRegState().
| 
 | inline | 
Is invalidate done?
Definition at line 356 of file hsa_queue_entry.hh.
References _outstandingInvs.
Referenced by gem5::ComputeUnit::dispWorkgroup().
| 
 | inline | 
Whether invalidate has started or finished -1 is the initial value indicating inv has not started for the kernel.
Definition at line 326 of file hsa_queue_entry.hh.
References _outstandingInvs.
Referenced by gem5::Shader::prepareInvalidate().
| 
 | inline | 
Definition at line 185 of file hsa_queue_entry.hh.
References kernargAddress.
Referenced by gem5::Wavefront::initRegState().
| 
 | inline | 
Definition at line 117 of file hsa_queue_entry.hh.
References kernName.
Referenced by gem5::GPUDispatcher::dispatch().
| 
 | inline | 
Definition at line 191 of file hsa_queue_entry.hh.
References _ldsSize.
Referenced by gem5::ComputeUnit::dispWorkgroup(), and gem5::ComputeUnit::hasDispResources().
| 
 | inline | 
Forcefully change the state to be inv done.
Definition at line 347 of file hsa_queue_entry.hh.
References _outstandingInvs.
| 
 | inline | 
Definition at line 262 of file hsa_queue_entry.hh.
References _globalWgId, _wgId, dispatchComplete, gridSize(), wgId(), and wgSize().
Referenced by gem5::Shader::dispatchWorkgroups().
| 
 | inline | 
Definition at line 244 of file hsa_queue_entry.hh.
References _numWgCompleted.
| 
 | inline | 
Definition at line 143 of file hsa_queue_entry.hh.
References numSgprs.
Referenced by gem5::ComputeUnit::dispWorkgroup(), gem5::ComputeUnit::fillKernelState(), gem5::ComputeUnit::hasDispResources(), and gem5::GPUCommandProcessor::submitDispatchPkt().
| 
 | inline | 
Definition at line 137 of file hsa_queue_entry.hh.
References numVgprs.
Referenced by gem5::ComputeUnit::dispWorkgroup(), gem5::ComputeUnit::fillKernelState(), gem5::ComputeUnit::hasDispResources(), and gem5::GPUCommandProcessor::submitDispatchPkt().
| 
 | inline | 
Definition at line 237 of file hsa_queue_entry.hh.
References _numWg, and MAX_DIM.
Referenced by gem5::ComputeUnit::startWavefront().
| 
 | inline | 
Definition at line 283 of file hsa_queue_entry.hh.
References numWgArrivedAtBarrier.
| 
 | inline | 
Definition at line 250 of file hsa_queue_entry.hh.
References _numWgCompleted.
| 
 | inline | 
Definition at line 256 of file hsa_queue_entry.hh.
References _numWgTotal.
| 
 | inline | 
Definition at line 316 of file hsa_queue_entry.hh.
References _outstandingInvs.
Referenced by gem5::Shader::prepareInvalidate().
| 
 | inline | 
Definition at line 363 of file hsa_queue_entry.hh.
References _outstandingWbs.
| 
 | inlineprivate | 
set the enable bits for the initial SGPR state
set the enable bits for the initial VGPR state. the workitem Id in the X dimension is always initialized.
Definition at line 382 of file hsa_queue_entry.hh.
References gem5::DispatchId, gem5::DispatchPtr, gem5::AMDKernelCode::enable_sgpr_dispatch_id, gem5::AMDKernelCode::enable_sgpr_dispatch_ptr, gem5::AMDKernelCode::enable_sgpr_flat_scratch_init, gem5::AMDKernelCode::enable_sgpr_grid_workgroup_count_x, gem5::AMDKernelCode::enable_sgpr_grid_workgroup_count_y, gem5::AMDKernelCode::enable_sgpr_grid_workgroup_count_z, gem5::AMDKernelCode::enable_sgpr_kernarg_segment_ptr, gem5::AMDKernelCode::enable_sgpr_private_segment_buffer, gem5::AMDKernelCode::enable_sgpr_private_segment_size, gem5::AMDKernelCode::enable_sgpr_private_segment_wave_byte_offset, gem5::AMDKernelCode::enable_sgpr_queue_ptr, gem5::AMDKernelCode::enable_sgpr_workgroup_id_x, gem5::AMDKernelCode::enable_sgpr_workgroup_id_y, gem5::AMDKernelCode::enable_sgpr_workgroup_id_z, gem5::AMDKernelCode::enable_sgpr_workgroup_info, gem5::AMDKernelCode::enable_vgpr_workitem_id, gem5::FlatScratchInit, gem5::GridWorkgroupCountX, gem5::GridWorkgroupCountY, gem5::GridWorkgroupCountZ, initialSgprState, initialVgprState, gem5::KernargSegPtr, gem5::PrivateSegBuf, gem5::PrivateSegSize, gem5::PrivSegWaveByteOffset, gem5::QueuePtr, gem5::WorkgroupIdX, gem5::WorkgroupIdY, gem5::WorkgroupIdZ, gem5::WorkgroupInfo, gem5::WorkitemIdX, gem5::WorkitemIdY, and gem5::WorkitemIdZ.
| 
 | inline | 
Definition at line 196 of file hsa_queue_entry.hh.
References _privMemPerItem.
Referenced by gem5::GPUCommandProcessor::MQDDmaEvent().
| 
 | inline | 
Definition at line 149 of file hsa_queue_entry.hh.
References _queueId.
Referenced by gem5::GPUCommandProcessor::initABI(), gem5::GPUCommandProcessor::MQDDmaEvent(), and gem5::GPUCommandProcessor::ReadDispIdOffsetDmaEvent().
| 
 | inline | 
Definition at line 293 of file hsa_queue_entry.hh.
References initialSgprState.
Referenced by gem5::Wavefront::initRegState().
| 
 | inline | 
update the number of pending invalidate requests
val: negative to decrement, positive to increment
Definition at line 337 of file hsa_queue_entry.hh.
References _outstandingInvs, and gem5::X86ISA::val.
| 
 | inline | 
Update the number of pending writeback requests.
val: negative to decrement, positive to increment
Definition at line 374 of file hsa_queue_entry.hh.
References _outstandingWbs, and gem5::X86ISA::val.
| 
 | inline | 
Definition at line 288 of file hsa_queue_entry.hh.
References initialVgprState.
Referenced by gem5::Wavefront::initRegState().
| 
 | inline | 
Definition at line 211 of file hsa_queue_entry.hh.
References _wgId, and MAX_DIM.
Referenced by gem5::Wavefront::computeActualWgSz(), gem5::ComputeUnit::hasDispResources(), and markWgDispatch().
| 
 | inline | 
Definition at line 218 of file hsa_queue_entry.hh.
References _wgId, MAX_DIM, and gem5::X86ISA::val.
| 
 | inline | 
Definition at line 123 of file hsa_queue_entry.hh.
References _wgSize, and MAX_DIM.
Referenced by gem5::ComputeUnit::fillKernelState(), gem5::ComputeUnit::hasDispResources(), gem5::Wavefront::initRegState(), and markWgDispatch().
| 
 | private | 
Definition at line 443 of file hsa_queue_entry.hh.
Referenced by completionSignal().
| 
 | private | 
Definition at line 467 of file hsa_queue_entry.hh.
Referenced by contextId().
| 
 | private | 
Definition at line 437 of file hsa_queue_entry.hh.
Referenced by dispatchId().
| 
 | private | 
Definition at line 474 of file hsa_queue_entry.hh.
Referenced by globalWgId(), and markWgDispatch().
| 
 | private | 
Definition at line 430 of file hsa_queue_entry.hh.
Referenced by gridSize().
| 
 | private | 
Definition at line 441 of file hsa_queue_entry.hh.
Referenced by hostDispPktAddr().
| 
 | private | 
Definition at line 465 of file hsa_queue_entry.hh.
Referenced by ldsSize().
| 
 | private | 
Definition at line 469 of file hsa_queue_entry.hh.
Referenced by numWg().
| 
 | private | 
Definition at line 473 of file hsa_queue_entry.hh.
Referenced by notifyWgCompleted(), and numWgCompleted().
| 
 | private | 
Definition at line 470 of file hsa_queue_entry.hh.
Referenced by numWgTotal().
| 
 | private | 
Number of outstanding invs for the kernel.
values: -1: initial value, invalidate has not started for the kernel 0: 1)-1->0, about to start (a transient state, added in the same cycle) 2)+1->0, all inv requests are finished, i.e., invalidate done ?: positive value, indicating the number of pending inv requests
Definition at line 456 of file hsa_queue_entry.hh.
Referenced by isInvDone(), isInvStarted(), markInvDone(), outstandingInvs(), and updateOutstandingInvs().
| 
 | private | 
Number of outstanding wbs for the kernel values: 0: 1)initial value, flush has not started for the kernel 2)+1->0: all wb requests are finished, i.e., flush done ?: positive value, indicating the number of pending wb requests.
Definition at line 464 of file hsa_queue_entry.hh.
Referenced by outstandingWbs(), and updateOutstandingWbs().
| 
 | private | 
Definition at line 466 of file hsa_queue_entry.hh.
Referenced by privMemPerItem().
| 
 | private | 
Definition at line 436 of file hsa_queue_entry.hh.
Referenced by queueId().
| 
 | private | 
Definition at line 468 of file hsa_queue_entry.hh.
Referenced by markWgDispatch(), and wgId().
| 
 | private | 
Definition at line 428 of file hsa_queue_entry.hh.
Referenced by wgSize().
| _amd_queue_t gem5::HSAQueueEntry::amdQueue | 
Keep a copy of the AMD HSA queue because we need info from some of its fields to initialize register state.
Definition at line 309 of file hsa_queue_entry.hh.
Referenced by gem5::Wavefront::initRegState(), gem5::GPUCommandProcessor::MQDDmaEvent(), gem5::GPUCommandProcessor::ReadDispIdOffsetDmaEvent(), and gem5::GPUCommandProcessor::WaitScratchDmaEvent().
| 
 | private | 
Definition at line 445 of file hsa_queue_entry.hh.
Referenced by codeAddr().
| 
 | private | 
Definition at line 475 of file hsa_queue_entry.hh.
Referenced by dispComplete(), and markWgDispatch().
| 
 | private | 
Definition at line 439 of file hsa_queue_entry.hh.
Referenced by dispPktPtr().
| Addr gem5::HSAQueueEntry::hostAMDQueueAddr | 
Host-side addr of the amd_queue_t on which this task was queued.
Definition at line 302 of file hsa_queue_entry.hh.
Referenced by gem5::Wavefront::initRegState(), gem5::GPUCommandProcessor::ReadDispIdOffsetDmaEvent(), and gem5::GPUCommandProcessor::WaitScratchDmaEvent().
| 
 | private | 
Definition at line 478 of file hsa_queue_entry.hh.
Referenced by parseKernelCode(), and sgprBitEnabled().
| 
 | private | 
Definition at line 477 of file hsa_queue_entry.hh.
Referenced by parseKernelCode(), and vgprBitEnabled().
| 
 | private | 
Definition at line 447 of file hsa_queue_entry.hh.
Referenced by kernargAddr().
| 
 | private | 
Definition at line 426 of file hsa_queue_entry.hh.
Referenced by kernelName().
| 
 | static | 
Definition at line 312 of file hsa_queue_entry.hh.
Referenced by gem5::Wavefront::computeActualWgSz(), gridSize(), gem5::ComputeUnit::hasDispResources(), numWg(), wgId(), and wgSize().
| 
 | private | 
Definition at line 434 of file hsa_queue_entry.hh.
Referenced by numScalarRegs().
| 
 | private | 
Definition at line 432 of file hsa_queue_entry.hh.
Referenced by numVectorRegs().
| 
 | private | 
Definition at line 471 of file hsa_queue_entry.hh.
Referenced by numWgAtBarrier().