32#ifndef __DEV_AMDGPU_AMDGPU_DEVICE_HH__
33#define __DEV_AMDGPU_AMDGPU_DEVICE_HH__
45#include "enums/GfxVersion.hh"
46#include "params/AMDGPUDevice.hh"
51class AMDGPUInterruptHandler;
89 using GPURegMap = std::unordered_map<uint32_t, uint64_t>;
101 std::array<uint8_t, ROM_SIZE>
rom;
119 std::unordered_map<uint32_t, SDMAEngine *>
sdmaEngs;
121 std::unordered_map<uint32_t, SDMAEngine *>
sdmaIds;
126 std::unordered_map<uint32_t, sdmaFuncPtr>
sdmaFunc;
136 std::unordered_map<uint16_t, uint16_t>
idMap;
211 std::unordered_map<uint16_t, std::set<int>>&
getUsedVMIDs();
Device model for an AMD GPU.
void insertQId(uint16_t vmid, int id)
uint32_t getRegVal(uint32_t addr)
std::unordered_map< Addr, uint16_t > doorbellVMIDMap
std::unordered_map< uint16_t, uint16_t > idMap
void readMMIO(PacketPtr pkt, Addr offset)
void serialize(CheckpointOut &cp) const override
Checkpoint support.
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void writeMMIO(PacketPtr pkt, Addr offset)
GfxVersion getGfxVersion() const
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
PM4PacketProcessor * pm4PktProc
void setDoorbellType(uint32_t offset, QueueType qt)
Set handles to GPU blocks.
void deallocateAllQueues()
void readROM(PacketPtr pkt)
AddrRange romRange
VGA ROM methods.
std::unordered_map< uint16_t, std::set< int > > & getUsedVMIDs()
std::array< uint8_t, ROM_SIZE > rom
bool isROM(Addr addr) const
std::unordered_map< uint32_t, AddrRange > sdmaMmios
void(SDMAEngine::* sdmaFuncPtr)(uint32_t)
SDMAEngine * getSDMAEngine(Addr offset)
AMDGPUMemoryManager * gpuMemMgr
void readDoorbell(PacketPtr pkt, Addr offset)
AMDGPUNbio nbio
Blocks of the GPU.
uint16_t getVMID(Addr doorbell)
Tick readConfig(PacketPtr pkt) override
Read from the PCI config space data that is stored locally.
std::unordered_map< uint32_t, sdmaFuncPtr > sdmaFunc
std::unordered_map< uint16_t, std::set< int > > usedVMIDs
AMDGPUInterruptHandler * deviceIH
Tick writeConfig(PacketPtr pkt) override
Write to the PCI config space data that is stored locally.
AMDGPUInterruptHandler * getIH()
Get handles to GPU blocks.
AMDMMIOReader mmioReader
MMIO reader to populate device registers map.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
bool checkpoint_before_mmios
Initial checkpoint support variables.
bool haveRegVal(uint32_t addr)
Register value getter/setter.
void dispatchAccess(PacketPtr pkt, bool read)
Convert a PCI packet into a response.
void deallocateVmid(uint16_t vmid)
void mapDoorbellToVMID(Addr doorbell, uint16_t vmid)
void intrPost()
Methods inherited from PciDevice.
void readFrame(PacketPtr pkt, Addr offset)
Helper methods to handle specific BAR read/writes.
void writeROM(PacketPtr pkt)
AMDGPUMemoryManager * getMemMgr()
void writeDoorbell(PacketPtr pkt, Addr offset)
RequestorID vramRequestorId()
Methods related to translations and system/device memory.
std::unordered_map< uint32_t, SDMAEngine * > sdmaIds
void setRegVal(uint32_t addr, uint32_t value)
uint16_t allocateVMID(uint16_t pasid)
std::unordered_map< uint32_t, uint64_t > GPURegMap
Structures to hold registers, doorbells, and some frame memory.
void deallocatePasid(uint16_t pasid)
SDMAEngine * getSDMAById(int id)
void writeFrame(PacketPtr pkt, Addr offset)
void setSDMAEngine(Addr offset, SDMAEngine *eng)
memory::PhysicalMemory deviceMem
std::unordered_map< uint32_t, QueueType > doorbells
std::unordered_map< uint32_t, SDMAEngine * > sdmaEngs
GPUCommandProcessor * CP()
RequestorID getRequestorID() const
Get the requestorID for the memory manager.
Helper class to read Linux kernel MMIO trace from amdgpu modprobes.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
PCI device, base implementation is only config space.
System DMA Engine class for AMD dGPU.
The physical memory encapsulates all memories in the system and provides basic functionality for acce...
bool contains(const Addr &a) const
Determine if the range contains an address.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.