dev-amdgpu: Support multiple CPs and MMIO AddrRanges
Currently gem5 assumes that there is only one command processor (CP) which contains the PM4 packet processor. Some GPU devices have multiple CPs which the driver tests individually during POST if they are used or not. Therefore, these additional CPs need to be supported. This commit allows for multiple PM4 packet processors which represent multiple CPs. Each of these processors will have its own independent MMIO address range. To more easily support ranges, the MMIO addresses now use AddrRange to index a PM4 packet processor instead of the hard-coded constexpr MMIO start and size pairs. By default only one PM4 packet processor is created, meaning the functionality of the simulation is unchanged for devices currently supported in gem5. Change-Id: I977f4fd3a169ef4a78671a4fb58c8ea0e19bf52c
This commit is contained in:
@@ -87,7 +87,7 @@ class AMDGPUDevice : public PciDevice
|
||||
/**
|
||||
* Structures to hold registers, doorbells, and some frame memory
|
||||
*/
|
||||
std::unordered_map<uint32_t, QueueType> doorbells;
|
||||
std::unordered_map<uint32_t, DoorbellInfo> doorbells;
|
||||
std::unordered_map<uint32_t, PacketPtr> pendingDoorbellPkts;
|
||||
|
||||
/**
|
||||
@@ -113,9 +113,19 @@ class AMDGPUDevice : public PciDevice
|
||||
AMDGPUMemoryManager *gpuMemMgr;
|
||||
AMDGPUInterruptHandler *deviceIH;
|
||||
AMDGPUVM gpuvm;
|
||||
PM4PacketProcessor *pm4PktProc;
|
||||
GPUCommandProcessor *cp;
|
||||
|
||||
struct AddrRangeHasher
|
||||
{
|
||||
std::size_t operator()(const AddrRange& k) const
|
||||
{
|
||||
return k.start();
|
||||
}
|
||||
};
|
||||
std::unordered_map<int, PM4PacketProcessor *> pm4PktProcs;
|
||||
std::unordered_map<AddrRange, PM4PacketProcessor *,
|
||||
AddrRangeHasher> pm4Ranges;
|
||||
|
||||
// SDMAs mapped by doorbell offset
|
||||
std::unordered_map<uint32_t, SDMAEngine *> sdmaEngs;
|
||||
// SDMAs mapped by ID
|
||||
@@ -185,7 +195,7 @@ class AMDGPUDevice : public PciDevice
|
||||
/**
|
||||
* Set handles to GPU blocks.
|
||||
*/
|
||||
void setDoorbellType(uint32_t offset, QueueType qt);
|
||||
void setDoorbellType(uint32_t offset, QueueType qt, int ip_id = 0);
|
||||
void processPendingDoorbells(uint32_t offset);
|
||||
void setSDMAEngine(Addr offset, SDMAEngine *eng);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user