Go to the documentation of this file.
37 #include "debug/GPUCommandProc.hh"
38 #include "debug/GPUKernelInfo.hh"
42 #include "params/GPUCommandProcessor.hh"
72 auto process =
sys->
threads[0]->getProcessPtr();
74 return process->pTable->translateRange(
vaddr, size);
98 static int dynamic_task_id = 0;
124 DPRINTF(GPUCommandProc,
"GPU machine code is %lli bytes from start of the "
125 "kernel object\n", akc.kernel_code_entry_byte_offset);
127 DPRINTF(GPUCommandProc,
"GPUCommandProc: Sending dispatch pkt to %lu\n",
128 (uint64_t)tc->cpuId());
132 + akc.kernel_code_entry_byte_offset;
134 DPRINTF(GPUCommandProc,
"Machine code starts at addr: %#x\n",
137 std::string kernel_name;
148 if (akc.runtime_loader_kernel_symbol) {
149 kernel_name =
"Some kernel";
151 kernel_name =
"Blit kernel";
154 DPRINTF(GPUKernelInfo,
"Kernel name: %s\n", kernel_name.c_str());
157 dynamic_task_id, raw_pkt, &akc, host_pkt_addr, machine_code_addr);
159 DPRINTF(GPUCommandProc,
"Task ID: %i Got AQL: wg size (%dx%dx%d), "
160 "grid size (%dx%dx%d) kernarg addr: %#x, completion "
167 DPRINTF(GPUCommandProc,
"Extracted code object: %s (num vector regs: %d, "
168 "num scalar regs: %d, code addr: %#x, kernarg size: %d, "
194 DPRINTF(GPUCommandProc,
"Triggering completion signal: %x!\n", value_addr);
208 if (*mailbox_ptr != 0) {
214 DPRINTF(GPUCommandProc,
"Calling signal wakeup event on "
215 "signal event value %d\n", *event_val);
276 DPRINTF(GPUCommandProc,
"Agent Dispatch Packet NOP\n");
277 }
else if (agent_pkt->
type == AgentCmd::Steal) {
279 int kid = agent_pkt->
arg[0];
281 "Agent Dispatch Packet Stealing signal handle for kernel %d\n",
288 DPRINTF(GPUCommandProc,
"Return Addr: %p\n",return_address);
291 *new_signal_addr = (
Addr)signal_addr;
295 "Agent Dispatch Packet Stealing signal handle from kid %d :" \
296 "(%x:%x) writing into %x\n",
297 kid,signal_addr,new_signal_addr,return_address);
301 panic(
"The agent dispatch packet provided an unknown argument in" \
302 "arg[0],currently only 0(nop) or 1(return kernel signal) is accepted");
336 [ = ] (
const uint32_t &readDispIdOffset)
342 dmaReadVirt(hostReadIdxPtr +
sizeof(hostReadIdxPtr),
Addr getHsaSignalEventAddr(Addr signal_handle)
virtual void signalWakeupEvent(uint32_t event_id)
HSAPacketProcessor * hsaPP
uint16_t workgroup_size_x
void signalWakeupEvent(uint32_t event_id)
void attachDriver(GPUComputeDriver *driver)
Wraps a std::function object in a DmaCallback.
Addr completionSignal() const
void dmaReadVirt(Addr host_addr, unsigned size, DmaCallback *cb, void *data, Tick delay=0)
Initiate a DMA read from virtual address host_addr.
HSAQueueDescriptor * getQueueDesc(uint32_t queId)
HSAQueueEntry * hsaTask(int disp_id)
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
GPUCommandProcessor()=delete
HSAPacketProcessor & hsaPacketProc()
Addr getHsaSignalMailboxAddr(Addr signal_handle)
int numScalarRegs() const
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 &) { })
This proxy attempts to translate virtual addresses using the TLBs.
def format Nop(code, *opt_flags)
void dispatch(HSAQueueEntry *task)
After all relevant HSA data structures have been traversed/extracted from memory by the CP,...
int numVectorRegs() const
void finishPkt(void *pkt, uint32_t rl_idx)
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)
GPUComputeDriver * _driver
void submitAgentDispatchPkt(void *raw_pkt, uint32_t queue_id, Addr host_pkt_addr)
submitAgentDispatchPkt() is for accepting agent dispatch packets.
This object is a proxy for a port or other object which implements the functional response protocol,...
uint16_t workgroup_size_z
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Addr getHsaSignalValueAddr(Addr signal_handle)
void setCommandProcessor(GPUCommandProcessor *gpu_cmd_proc)
void dmaWriteVirt(Addr host_addr, unsigned size, DmaCallback *b, void *data, Tick delay=0)
Initiate a DMA write from virtual address host_addr.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
uint16_t workgroup_size_y
void setDevice(GPUCommandProcessor *dev)
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)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
GPUDispatcher & dispatcher
uint64_t completion_signal
std::function< void(const uint64_t &)> HsaSignalCallbackFunction
TranslationGenPtr translate(Addr vaddr, Addr size) override
Function used to translate a range of addresses from virtual to physical addresses.
std::unique_ptr< TranslationGen > TranslationGenPtr
#define panic(...)
This implements a cprintf based panic() function.
GPUComputeDriver * driver()
void initABI(HSAQueueEntry *task)
The CP is responsible for traversing all HSA-ABI-related data structures from memory and initializing...
Generated on Wed May 4 2022 12:13:58 for gem5 by doxygen 1.8.17