dev-amdgpu: Add memory manager for GPU VRAM

The memory manager is responsible for reading and writes to VRAM memory
for direct requests that bypass GPU caches.

Change-Id: I4aa1e77737ce52f2f2c01929b58984126bdcb925
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51850
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Matthew Poremba
2021-10-20 15:22:57 -05:00
parent b7826f1329
commit 42b56ceb7b
6 changed files with 255 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ from m5.proxy import *
from m5.objects.PciDevice import PciDevice
from m5.objects.PciDevice import PciMemBar, PciMemUpperBar, PciLegacyIoBar
from m5.objects.Device import DmaDevice
from m5.objects.ClockedObject import ClockedObject
# PCI device model for an AMD Vega 10 based GPU. The PCI codes and BARs
# correspond to a Vega Frontier Edition hardware device. None of the PCI
@@ -78,8 +79,18 @@ class AMDGPUDevice(PciDevice):
# The config script should not create a new cp here but rather assign the
# same cp that is assigned to the Shader SimObject.
cp = Param.GPUCommandProcessor(NULL, "Command Processor")
memory_manager = Param.AMDGPUMemoryManager("GPU Memory Manager")
memories = VectorParam.AbstractMemory([], "All memories in the device")
device_ih = Param.AMDGPUInterruptHandler("GPU Interrupt handler")
class AMDGPUMemoryManager(ClockedObject):
type = 'AMDGPUMemoryManager'
cxx_header = 'dev/amdgpu/memory_manager.hh'
cxx_class = 'gem5::AMDGPUMemoryManager'
port = RequestPort('Memory Port to access VRAM (device memory)')
system = Param.System(Parent.any, 'System the dGPU belongs to')
class AMDGPUInterruptHandler(DmaDevice):
type = 'AMDGPUInterruptHandler'
cxx_header = "dev/amdgpu/interrupt_handler.hh"