dev-amdgpu: Enable more GPUs with device specific registers
Currently gem5 assumes the amdgpu device to be Vega10. In order to support more devices we need to handle situations where different registers and addresses have the same functionality but different offsets on different devices. This changeset adds an NBIO class to handle device discovery and driver initialization related tasks, pulling them out of the AMDGPUDevice class. The offsets used for MMIOs are reworked slightly to use offsets rather than absolute addresses. This is because we cannot determine the absolute address in the constructor since the BAR has not been assigned by the OS yet. Change-Id: I14b364374e086e185978334425a4e265cf2760d0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70041 Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com> Maintainer: Matt Sinclair <mattdsinclair@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "base/bitunion.hh"
|
||||
#include "dev/amdgpu/amdgpu_defines.hh"
|
||||
#include "dev/amdgpu/amdgpu_nbio.hh"
|
||||
#include "dev/amdgpu/amdgpu_vm.hh"
|
||||
#include "dev/amdgpu/memory_manager.hh"
|
||||
#include "dev/amdgpu/mmio_reader.hh"
|
||||
@@ -106,6 +107,7 @@ class AMDGPUDevice : public PciDevice
|
||||
/**
|
||||
* Blocks of the GPU
|
||||
*/
|
||||
AMDGPUNbio nbio;
|
||||
AMDGPUMemoryManager *gpuMemMgr;
|
||||
AMDGPUInterruptHandler *deviceIH;
|
||||
AMDGPUVM gpuvm;
|
||||
@@ -185,6 +187,7 @@ class AMDGPUDevice : public PciDevice
|
||||
* Register value getter/setter. Used by other GPU blocks to change
|
||||
* values from incoming driver/user packets.
|
||||
*/
|
||||
bool haveRegVal(uint32_t addr);
|
||||
uint32_t getRegVal(uint32_t addr);
|
||||
void setRegVal(uint32_t addr, uint32_t value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user