|
gem5 [DEVELOP-FOR-25.0]
|
#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, GfxVersion gfx_version) | |
| const GfxVersion & | gfxVersion () const |
| 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. | |
| void | updateOutstandingInvs (int val) |
| update the number of pending invalidate requests | |
| void | markInvDone () |
| Forcefully change the state to be inv done. | |
| bool | isInvDone () const |
| Is invalidate done? | |
| int | outstandingWbs () const |
| void | updateOutstandingWbs (int val) |
| Update the number of pending writeback requests. | |
| unsigned | accumOffset () const |
| void | preloadLength (unsigned val) |
| unsigned | preloadLength () const |
| uint32_t * | preloadArgs () |
Public Attributes | |
| Addr | hostAMDQueueAddr |
| Host-side addr of the amd_queue_t on which this task was queued. | |
| _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. | |
Static Public Attributes | |
| static const int | MAX_DIM = 3 |
Private Member Functions | |
| void | parseKernelCode (AMDKernelCode *akc) |
Private Attributes | |
| GfxVersion | _gfxVersion |
| 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. | |
| 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 ? | |
| 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 |
| unsigned | _accumOffset |
| unsigned | _preloadLength = 0 |
| uint32_t | _preloadArgs [KernargPreloadPktSize/sizeof(uint32_t)] |
Definition at line 60 of file hsa_queue_entry.hh.
|
inline |
Definition at line 63 of file hsa_queue_entry.hh.
References _gfxVersion, _wgSize, and kernName.
|
inline |
Definition at line 405 of file hsa_queue_entry.hh.
References _accumOffset.
Referenced by gem5::Wavefront::initRegState().
|
inline |
Definition at line 203 of file hsa_queue_entry.hh.
References codeAddress.
Referenced by gem5::GPUCommandProcessor::dispatchKernelObject(), and gem5::ComputeUnit::startWavefront().
|
inline |
Definition at line 197 of file hsa_queue_entry.hh.
References _completionSignal.
Referenced by gem5::GPUCommandProcessor::dispatchKernelObject(), and gem5::GPUCommandProcessor::submitAgentDispatchPkt().
|
inline |
Definition at line 223 of file hsa_queue_entry.hh.
References _contextId.
|
inline |
Definition at line 179 of file hsa_queue_entry.hh.
References _dispatchId.
Referenced by gem5::GPUDispatcher::dispatch(), gem5::ComputeUnit::dispWorkgroup(), gem5::Wavefront::initRegState(), gem5::Shader::prepareInvalidate(), and gem5::ComputeUnit::startWavefront().
|
inline |
Definition at line 229 of file hsa_queue_entry.hh.
References dispatchComplete.
Referenced by gem5::Shader::dispatchWorkgroups().
|
inline |
Definition at line 185 of file hsa_queue_entry.hh.
References dispPkt.
Referenced by gem5::GPUCommandProcessor::dispatchKernelObject(), and gem5::GPUCommandProcessor::readPreload().
|
inline |
Definition at line 135 of file hsa_queue_entry.hh.
References _gfxVersion.
Referenced by gem5::Wavefront::initRegState().
|
inline |
Definition at line 249 of file hsa_queue_entry.hh.
References _globalWgId.
Referenced by gem5::Shader::dispatchWorkgroups(), gem5::ComputeUnit::dispWorkgroup(), and gem5::ComputeUnit::startWavefront().
|
inline |
Definition at line 255 of file hsa_queue_entry.hh.
References _globalWgId, and gem5::X86ISA::val.
|
inline |
Definition at line 154 of file hsa_queue_entry.hh.
References _gridSize, and MAX_DIM.
Referenced by gem5::ComputeUnit::fillKernelState(), gem5::ComputeUnit::hasDispResources(), and markWgDispatch().
|
inline |
Definition at line 191 of file hsa_queue_entry.hh.
References _hostDispPktAddr.
Referenced by gem5::Wavefront::initRegState().
|
inline |
Is invalidate done?
Definition at line 380 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 350 of file hsa_queue_entry.hh.
References _outstandingInvs.
Referenced by gem5::Shader::prepareInvalidate().
|
inline |
Definition at line 209 of file hsa_queue_entry.hh.
References kernargAddress.
Referenced by gem5::Wavefront::initRegState().
|
inline |
Definition at line 141 of file hsa_queue_entry.hh.
References kernName.
Referenced by gem5::GPUDispatcher::dispatch().
|
inline |
Definition at line 215 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 371 of file hsa_queue_entry.hh.
References _outstandingInvs.
|
inline |
Definition at line 286 of file hsa_queue_entry.hh.
References _globalWgId, _wgId, dispatchComplete, gridSize(), wgId(), and wgSize().
Referenced by gem5::Shader::dispatchWorkgroups().
|
inline |
Definition at line 268 of file hsa_queue_entry.hh.
References _numWgCompleted.
|
inline |
Definition at line 167 of file hsa_queue_entry.hh.
References numSgprs.
Referenced by gem5::GPUCommandProcessor::dispatchKernelObject(), gem5::ComputeUnit::dispWorkgroup(), gem5::ComputeUnit::fillKernelState(), and gem5::ComputeUnit::hasDispResources().
|
inline |
Definition at line 161 of file hsa_queue_entry.hh.
References numVgprs.
Referenced by gem5::GPUCommandProcessor::dispatchKernelObject(), gem5::ComputeUnit::dispWorkgroup(), gem5::ComputeUnit::fillKernelState(), and gem5::ComputeUnit::hasDispResources().
|
inline |
Definition at line 261 of file hsa_queue_entry.hh.
References _numWg, and MAX_DIM.
Referenced by gem5::ComputeUnit::startWavefront().
|
inline |
Definition at line 307 of file hsa_queue_entry.hh.
References numWgArrivedAtBarrier.
|
inline |
Definition at line 274 of file hsa_queue_entry.hh.
References _numWgCompleted.
|
inline |
Definition at line 280 of file hsa_queue_entry.hh.
References _numWgTotal.
|
inline |
Definition at line 340 of file hsa_queue_entry.hh.
References _outstandingInvs.
Referenced by gem5::Shader::prepareInvalidate().
|
inline |
Definition at line 387 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 438 of file hsa_queue_entry.hh.
References gem5::DispatchId, gem5::DispatchPtr, gem5::GEM5_PACKED::enable_private_segment, gem5::GEM5_PACKED::enable_sgpr_dispatch_id, gem5::GEM5_PACKED::enable_sgpr_dispatch_ptr, gem5::GEM5_PACKED::enable_sgpr_flat_scratch_init, gem5::GEM5_PACKED::enable_sgpr_kernarg_segment_ptr, gem5::GEM5_PACKED::enable_sgpr_private_segment_buffer, gem5::GEM5_PACKED::enable_sgpr_private_segment_size, gem5::GEM5_PACKED::enable_sgpr_queue_ptr, gem5::GEM5_PACKED::enable_sgpr_workgroup_id_x, gem5::GEM5_PACKED::enable_sgpr_workgroup_id_y, gem5::GEM5_PACKED::enable_sgpr_workgroup_id_z, gem5::GEM5_PACKED::enable_sgpr_workgroup_info, gem5::GEM5_PACKED::enable_vgpr_workitem_id, gem5::FlatScratchInit, 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 431 of file hsa_queue_entry.hh.
References _preloadArgs.
Referenced by gem5::GPUCommandProcessor::initPreload(), gem5::Wavefront::initRegState(), and gem5::GPUCommandProcessor::readPreload().
|
inline |
Definition at line 425 of file hsa_queue_entry.hh.
References _preloadLength.
|
inline |
set the enable bit for KernargPreload if used. The preloaded kernargs go between private segment size and sgpr workgroup IDs.
Definition at line 411 of file hsa_queue_entry.hh.
References _preloadLength, initialSgprState, gem5::KernargPreload, and gem5::X86ISA::val.
Referenced by gem5::GPUCommandProcessor::initPreload(), and gem5::Wavefront::initRegState().
|
inline |
Definition at line 220 of file hsa_queue_entry.hh.
References _privMemPerItem.
Referenced by gem5::Wavefront::initRegState(), and gem5::GPUCommandProcessor::MQDDmaEvent().
|
inline |
Definition at line 173 of file hsa_queue_entry.hh.
References _queueId.
Referenced by gem5::GPUCommandProcessor::dispatchKernelObject(), gem5::GPUCommandProcessor::initABI(), gem5::GPUCommandProcessor::MQDDmaEvent(), and gem5::GPUCommandProcessor::ReadDispIdOffsetDmaEvent().
|
inline |
Definition at line 317 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 361 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 398 of file hsa_queue_entry.hh.
References _outstandingWbs, and gem5::X86ISA::val.
|
inline |
Definition at line 312 of file hsa_queue_entry.hh.
References initialVgprState.
Referenced by gem5::Wavefront::initRegState().
|
inline |
Definition at line 235 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 242 of file hsa_queue_entry.hh.
References _wgId, MAX_DIM, and gem5::X86ISA::val.
|
inline |
Definition at line 147 of file hsa_queue_entry.hh.
References _wgSize, and MAX_DIM.
Referenced by gem5::ComputeUnit::fillKernelState(), gem5::ComputeUnit::hasDispResources(), and markWgDispatch().
|
private |
Definition at line 532 of file hsa_queue_entry.hh.
Referenced by accumOffset().
|
private |
Definition at line 495 of file hsa_queue_entry.hh.
Referenced by completionSignal().
|
private |
Definition at line 519 of file hsa_queue_entry.hh.
Referenced by contextId().
|
private |
Definition at line 489 of file hsa_queue_entry.hh.
Referenced by dispatchId().
|
private |
Definition at line 476 of file hsa_queue_entry.hh.
Referenced by gfxVersion(), and HSAQueueEntry().
|
private |
Definition at line 526 of file hsa_queue_entry.hh.
Referenced by globalWgId(), globalWgId(), and markWgDispatch().
|
private |
Definition at line 482 of file hsa_queue_entry.hh.
Referenced by gridSize().
|
private |
Definition at line 493 of file hsa_queue_entry.hh.
Referenced by hostDispPktAddr().
|
private |
Definition at line 517 of file hsa_queue_entry.hh.
Referenced by ldsSize().
|
private |
Definition at line 521 of file hsa_queue_entry.hh.
Referenced by numWg().
|
private |
Definition at line 525 of file hsa_queue_entry.hh.
Referenced by notifyWgCompleted(), and numWgCompleted().
|
private |
Definition at line 522 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 508 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 516 of file hsa_queue_entry.hh.
Referenced by outstandingWbs(), and updateOutstandingWbs().
|
private |
Definition at line 539 of file hsa_queue_entry.hh.
Referenced by preloadArgs().
|
private |
Definition at line 538 of file hsa_queue_entry.hh.
Referenced by preloadLength(), and preloadLength().
|
private |
Definition at line 518 of file hsa_queue_entry.hh.
Referenced by privMemPerItem().
|
private |
Definition at line 488 of file hsa_queue_entry.hh.
Referenced by queueId().
|
private |
Definition at line 520 of file hsa_queue_entry.hh.
Referenced by markWgDispatch(), wgId(), and wgId().
|
private |
Definition at line 480 of file hsa_queue_entry.hh.
Referenced by HSAQueueEntry(), and 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 333 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 497 of file hsa_queue_entry.hh.
Referenced by codeAddr().
|
private |
Definition at line 527 of file hsa_queue_entry.hh.
Referenced by dispComplete(), and markWgDispatch().
|
private |
Definition at line 491 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 326 of file hsa_queue_entry.hh.
Referenced by gem5::Wavefront::initRegState(), gem5::GPUCommandProcessor::ReadDispIdOffsetDmaEvent(), and gem5::GPUCommandProcessor::WaitScratchDmaEvent().
|
private |
Definition at line 530 of file hsa_queue_entry.hh.
Referenced by parseKernelCode(), preloadLength(), and sgprBitEnabled().
|
private |
Definition at line 529 of file hsa_queue_entry.hh.
Referenced by parseKernelCode(), and vgprBitEnabled().
|
private |
Definition at line 499 of file hsa_queue_entry.hh.
Referenced by kernargAddr().
|
private |
Definition at line 478 of file hsa_queue_entry.hh.
Referenced by HSAQueueEntry(), and kernelName().
|
static |
Definition at line 336 of file hsa_queue_entry.hh.
Referenced by gem5::Wavefront::computeActualWgSz(), gridSize(), gem5::ComputeUnit::hasDispResources(), numWg(), wgId(), wgId(), and wgSize().
|
private |
Definition at line 486 of file hsa_queue_entry.hh.
Referenced by numScalarRegs().
|
private |
Definition at line 484 of file hsa_queue_entry.hh.
Referenced by numVectorRegs().
|
private |
Definition at line 523 of file hsa_queue_entry.hh.
Referenced by numWgAtBarrier().