Go to the documentation of this file.
40 #include "debug/GPUDriver.hh"
44 #include "params/GPUComputeDriver.hh"
50 DPRINTF(GPUDriver,
"Constructing KFD: device\n");
61 DPRINTF(GPUDriver,
"ioctl: AMDKFD_IOC_GET_VERSION\n");
72 DPRINTF(GPUDriver,
"ioctl: AMDKFD_IOC_CREATE_QUEUE\n");
83 DPRINTF(GPUDriver,
"ioctl: AMDKFD_IOC_DESTROY_QUEUE;" \
84 "queue offset %d\n", args->
queue_id);
90 warn(
"unimplemented ioctl: AMDKFD_IOC_SET_MEMORY_POLICY\n");
95 DPRINTF(GPUDriver,
"ioctl: AMDKFD_IOC_GET_CLOCK_COUNTERS\n");
117 DPRINTF(GPUDriver,
"ioctl: AMDKFD_IOC_GET_PROCESS_APERTURES\n");
151 DPRINTF(GPUDriver,
"GPUVM base for node[%i] = %#x\n",
i,
153 DPRINTF(GPUDriver,
"GPUVM limit for node[%i] = %#x\n",
i,
156 DPRINTF(GPUDriver,
"LDS base for node[%i] = %#x\n",
i,
158 DPRINTF(GPUDriver,
"LDS limit for node[%i] = %#x\n",
i,
161 DPRINTF(GPUDriver,
"Scratch base for node[%i] = %#x\n",
i,
163 DPRINTF(GPUDriver,
"Scratch limit for node[%i] = %#x\n",
i,
203 warn(
"unimplemented ioctl: AMDKFD_IOC_UPDATE_QUEUE\n");
208 warn(
"unimplemented ioctl: AMDKFD_IOC_CREATE_EVENT\n");
213 warn(
"unimplemented ioctl: AMDKFD_IOC_DESTROY_EVENT\n");
218 warn(
"unimplemented ioctl: AMDKFD_IOC_SET_EVENT\n");
223 warn(
"unimplemented ioctl: AMDKFD_IOC_RESET_EVENT\n");
228 warn(
"unimplemented ioctl: AMDKFD_IOC_WAIT_EVENTS\n");
233 warn(
"unimplemented ioctl: AMDKFD_IOC_DBG_REGISTER\n");
238 warn(
"unimplemented ioctl: AMDKFD_IOC_DBG_UNREGISTER\n");
243 warn(
"unimplemented ioctl: AMDKFD_IOC_DBG_ADDRESS_WATCH\n");
248 warn(
"unimplemented ioctl: AMDKFD_IOC_DBG_WAVE_CONTROL\n");
253 warn(
"unimplemented ioctl: AMDKFD_IOC_ALLOC_MEMORY_OF_GPU\n");
258 warn(
"unimplemented ioctl: AMDKFD_IOC_FREE_MEMORY_OF_GPU\n");
263 warn(
"unimplemented ioctl: AMDKFD_IOC_MAP_MEMORY_TO_GPU\n");
268 warn(
"unimplemented ioctl: AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU\n");
273 warn(
"unimplemented ioctl: AMDKFD_IOC_ALLOC_MEMORY_OF_SCRATCH\n");
278 warn(
"unimplemented ioctl: AMDKFD_IOC_SET_CU_MASK\n");
283 warn(
"unimplemented ioctl: AMDKFD_IOC_SET_PROCESS_DGPU_APERTURE"
289 warn(
"unimplemented ioctl: AMDKFD_IOC_SET_TRAP_HANDLER\n");
295 "ioctl: AMDKFD_IOC_GET_PROCESS_APERTURES_NEW\n");
300 ioc_args.
copyIn(virt_proxy);
317 assert(bits<Addr>(ape_args->
scratch_base, 63, 47) != 0x1ffff);
318 assert(bits<Addr>(ape_args->
scratch_base, 63, 47) != 0);
319 assert(bits<Addr>(ape_args->
scratch_limit, 63, 47) != 0x1ffff);
321 assert(bits<Addr>(ape_args->
lds_base, 63, 47) != 0x1ffff);
322 assert(bits<Addr>(ape_args->
lds_base, 63, 47) != 0);
323 assert(bits<Addr>(ape_args->
lds_limit, 63, 47) != 0x1ffff);
324 assert(bits<Addr>(ape_args->
lds_limit, 63, 47) != 0);
325 assert(bits<Addr>(ape_args->
gpuvm_base, 63, 47) != 0x1ffff);
326 assert(bits<Addr>(ape_args->
gpuvm_base, 63, 47) != 0);
327 assert(bits<Addr>(ape_args->
gpuvm_limit, 63, 47) != 0x1ffff);
328 assert(bits<Addr>(ape_args->
gpuvm_limit, 63, 47) != 0);
338 warn(
"unimplemented ioctl: AMDKFD_IOC_GET_DMABUF_INFO\n");
343 warn(
"unimplemented ioctl: AMDKFD_IOC_IMPORT_DMABUF\n");
348 warn(
"unimplemented ioctl: AMDKFD_IOC_GET_TILE_CONFIG\n");
353 warn(
"unimplemented ioctl: AMDKFD_IOC_IPC_IMPORT_HANDLE\n");
358 warn(
"unimplemented ioctl: AMDKFD_IOC_IPC_EXPORT_HANDLE\n");
363 warn(
"unimplemented ioctl: AMDKFD_IOC_CROSS_MEMORY_COPY\n");
368 warn(
"unimplemented ioctl: AMDKFD_IOC_OPEN_GRAPHIC_HANDLE\n");
372 fatal(
"%s: bad ioctl %d\n", req);
381 return ((
Addr)gpuNum << 61) + 0x1000000000000
L;
387 return (apeBase & 0xFFFFFF0000000000UL) | 0xFFFFFFFFFF
L;
393 return ((
Addr)gpuNum << 61) + 0x100000000
L;
399 return (apeBase & 0xFFFFFFFF00000000UL) | 0xFFFFFFFF;
405 return ((
Addr)gpuNum << 61) + 0x0;
411 return (apeBase & 0xFFFFFFFF00000000UL) | 0xFFFFFFFF;
415 GPUComputeDriverParams::create()
Addr scratchApeLimit(Addr apeBase) const
#define fatal(...)
This implements a cprintf based fatal() function.
#define AMDKFD_IOC_MAP_MEMORY_TO_GPU
uint64_t kfd_process_device_apertures_ptr
Addr ldsApeBase(int gpuNum) const
#define AMDKFD_IOC_GET_TILE_CONFIG
#define AMDKFD_IOC_DBG_WAVE_CONTROL
#define AMDKFD_IOC_FREE_MEMORY_OF_GPU
#define AMDKFD_IOC_DESTROY_EVENT
#define AMDKFD_IOC_IPC_EXPORT_HANDLE
uint64_t system_clock_counter
struct kfd_process_device_apertures process_apertures[NUM_OF_SUPPORTED_GPUS]
#define AMDKFD_IOC_GET_VERSION
#define AMDKFD_IOC_CROSS_MEMORY_COPY
uint64_t system_clock_freq
uint64_t gpu_clock_counter
#define AMDKFD_IOC_SET_EVENT
uint64_t cpu_clock_counter
#define AMDKFD_IOC_GET_PROCESS_APERTURES
#define AMDKFD_IOC_SET_TRAP_HANDLER
GPUComputeDriverParams Params
#define AMDKFD_IOC_DBG_REGISTER
Addr ldsApeLimit(Addr apeBase) const
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Addr gpuVmApeLimit(Addr apeBase) const
Addr scratchApeBase(int gpuNum) const
#define AMDKFD_IOC_SET_CU_MASK
#define AMDKFD_IOC_IPC_IMPORT_HANDLE
void unsetDeviceQueueDesc(uint64_t queue_id)
#define AMDKFD_IOC_RESET_EVENT
GPUComputeDriver(Params *p)
#define AMDKFD_IOC_DBG_ADDRESS_WATCH
int ioctl(ThreadContext *tc, unsigned req, Addr ioc_buf) override
Abstract method, invoked when the user program calls ioctl() on the file descriptor returned by a pre...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr gpuVmApeBase(int gpuNum) const
The aperture (APE) base/limit pairs are set statically at startup by the real KFD.
bool copyIn(PortProxy &memproxy)
copy data into simulator space (read from target memory)
#define AMDKFD_IOC_IMPORT_DMABUF
virtual PortProxy & getVirtProxy()=0
HSAPacketProcessor & hsaPacketProc()
#define AMDKFD_IOC_CREATE_EVENT
#define AMDKFD_IOC_DESTROY_QUEUE
#define AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU
#define AMDKFD_IOC_ALLOC_MEMORY_OF_SCRATCH
#define AMDKFD_IOC_SET_MEMORY_POLICY
#define AMDKFD_IOC_WAIT_EVENTS
#define AMDKFD_IOC_OPEN_GRAPHIC_HANDLE
#define AMDKFD_IOC_DBG_UNREGISTER
TypedBufferArg is a class template; instances of this template represent typed buffers in target user...
#define AMDKFD_IOC_UPDATE_QUEUE
HSADevice * device
HSA agent (device) that is controled by this driver.
#define AMDKFD_IOC_GET_PROCESS_APERTURES_NEW
void allocateQueue(ThreadContext *tc, Addr ioc_buf)
Forward relevant parameters to packet processor; queueID is used to link doorbell.
#define AMDKFD_IOC_SET_PROCESS_DGPU_APERTURE
#define AMDKFD_IOC_ALLOC_MEMORY_OF_GPU
#define AMDKFD_IOC_CREATE_QUEUE
bool copyOut(PortProxy &memproxy)
copy data out of simulator space (write to target memory)
#define AMDKFD_IOC_GET_CLOCK_COUNTERS
Tick curTick()
The current simulated tick.
#define AMDKFD_IOC_GET_DMABUF_INFO
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17