Go to the documentation of this file.
45 #ifndef __DEV_HSA_GPU_COMMAND_PROCESSOR_HH__
46 #define __DEV_HSA_GPU_COMMAND_PROCESSOR_HH__
54 #include "debug/GPUCommandProc.hh"
61 #include "params/GPUCommandProcessor.hh"
66 struct GPUCommandProcessorParams;
67 class GPUComputeDriver;
74 typedef GPUCommandProcessorParams
Params;
110 [] (
const uint64_t &) { });
121 return signal_handle + offsetof(
amd_signal_t, event_mailbox_ptr);
126 return signal_handle + offsetof(
amd_signal_t, event_id);
154 const uint32_t &readDispIdOffset)
208 "Needed more scratch, but kernels are in flight for "
209 "this queue and it is unsafe to reallocate scratch. "
210 "We need to implement additional intelligence in the "
211 "hardware scheduling logic to support CP-driven "
212 "queue draining and scheduling.");
213 DPRINTF(GPUCommandProc,
"Not enough scratch space to launch "
214 "kernel (%x available, %x requested bytes per "
215 "workitem). Asking host runtime to allocate more "
221 [ = ] (
const uint64_t &dma_buffer)
222 { WaitScratchDmaEvent(task, dma_buffer); });
225 DPRINTF(GPUCommandProc,
"Sufficient scratch space, launching "
226 "kernel (%x available, %x requested bytes per "
241 if (dmaBuffer == 0) {
242 DPRINTF(GPUCommandProc,
"Host scratch allocation complete. "
243 "Attempting to re-read MQD\n");
264 DPRINTF(GPUCommandProc,
"Polling queue inactive signal at "
265 "%p.\n", value_addr);
267 [ = ] (
const uint64_t &dma_buffer)
276 #endif // __DEV_HSA_GPU_COMMAND_PROCESSOR_HH__
GPUCommandProcessorParams Params
Addr getHsaSignalEventAddr(Addr signal_handle)
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
HSAPacketProcessor * hsaPP
int privMemPerItem() const
void signalWakeupEvent(uint32_t event_id)
void attachDriver(GPUComputeDriver *driver)
uint64_t hostReadIndexPtr
Wraps a std::function object in a DmaCallback.
void dmaReadVirt(Addr host_addr, unsigned size, DmaCallback *cb, void *data, Tick delay=0)
Initiate a DMA read from virtual address host_addr.
void(DmaDevice::* DmaFnPtr)(Addr, int, Event *, uint8_t *, Tick)
HSAQueueDescriptor * getQueueDesc(uint32_t queId)
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
GPUCommandProcessor()=delete
uint64_t inFlightPkts(uint32_t queId)
void WaitScratchDmaEvent(HSAQueueEntry *task, const uint64_t &dmaBuffer)
Poll on queue_inactive signal until the runtime can get around to taking care of our lack of scratch ...
HSAPacketProcessor & hsaPacketProc()
Addr getHsaSignalMailboxAddr(Addr signal_handle)
void submitDispatchPkt(void *raw_pkt, uint32_t queue_id, Addr host_pkt_addr)
submitDispatchPkt() is the entry point into the CP from the HSAPP and is only meant to be used with A...
void updateHsaSignal(Addr signal_handle, uint64_t signal_value, HsaSignalCallbackFunction function=[](const uint64_t &) { })
void MQDDmaEvent(HSAQueueEntry *task)
Perform a DMA read of the MQD that corresponds to a hardware queue descriptor (HQD).
_amd_queue_t amdQueue
Keep a copy of the AMD HSA queue because we need info from some of its fields to initialize register ...
void dispatchPkt(HSAQueueEntry *task)
Once the CP has finished extracting all relevant information about a task and has initialized the ABI...
void setShader(Shader *shader)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t Tick
Tick count type.
GPUComputeDriver * _driver
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void submitAgentDispatchPkt(void *raw_pkt, uint32_t queue_id, Addr host_pkt_addr)
submitAgentDispatchPkt() is for accepting agent dispatch packets.
Addr getHsaSignalValueAddr(Addr signal_handle)
Addr hostAMDQueueAddr
Host-side addr of the amd_queue_t on which this task was queued.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void ReadDispIdOffsetDmaEvent(HSAQueueEntry *task, const uint32_t &readDispIdOffset)
Perform a DMA read of the read_dispatch_id_field_base_byte_offset field, which follows directly after...
void submitVendorPkt(void *raw_pkt, uint32_t queue_id, Addr host_pkt_addr)
submitVendorPkt() is for accepting vendor-specific packets from the HSAPP.
uint64_t functionalReadHsaSignal(Addr signal_handle)
void translateOrDie(Addr vaddr, Addr &paddr) override
Function used to translate from virtual to physical addresses.
_hsa_signal_t queue_inactive_signal
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
uint32_t compute_tmpring_size_wavesize
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
GPUDispatcher & dispatcher
std::function< void(const uint64_t &)> HsaSignalCallbackFunction
GPUComputeDriver * driver()
void initABI(HSAQueueEntry *task)
The CP is responsible for traversing all HSA-ABI-related data structures from memory and initializing...
Generated on Tue Sep 21 2021 12:25:23 for gem5 by doxygen 1.8.17