gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::AMDGPUVM Class Reference

#include <amdgpu_vm.hh>

Inheritance diagram for gem5::AMDGPUVM:
gem5::Serializable

Classes

class  AGPTranslationGen
 Translation range generators. More...
 
struct  AMDGPUSysVMContext
 
class  GARTTranslationGen
 
struct  GEM5_PACKED
 
class  MMHUBTranslationGen
 
class  UserTranslationGen
 

Public Member Functions

 AMDGPUVM ()
 
void setGPUDevice (AMDGPUDevice *gpu_device)
 
Addr gartBase ()
 Return base address of GART table in framebuffer.
 
Addr gartSize ()
 Return size of GART in number of PTEs.
 
bool inGARTRange (Addr paddr)
 
void readMMIO (PacketPtr pkt, Addr offset)
 
void writeMMIO (PacketPtr pkt, Addr offset)
 
bool inAGP (Addr vaddr)
 Methods for resolving apertures.
 
Addr getAGPBot ()
 
Addr getAGPTop ()
 
Addr getAGPBase ()
 
bool inMMHUB (Addr vaddr)
 
Addr getMMHUBBase ()
 
Addr getMMHUBTop ()
 
void setMMHUBBase (Addr base)
 
void setMMHUBTop (Addr top)
 
bool inFB (Addr vaddr)
 
Addr getFBBase ()
 
Addr getFBTop ()
 
Addr getFBOffset ()
 
bool inSys (Addr vaddr)
 
Addr getSysAddrRangeLow ()
 
Addr getSysAddrRangeHigh ()
 
void setMMIOAperture (mmio_range_t mmio_aperture, AddrRange range)
 
const AddrRangegetMMIOAperture (Addr addr)
 
AddrRange getMMIORange (mmio_range_t mmio_aperture)
 
Addr getFrameAperture (Addr addr)
 
void setPageTableBase (uint16_t vmid, Addr ptBase)
 Page table base/start accessors for user VMIDs.
 
Addr getPageTableBase (uint16_t vmid)
 
Addr getPageTableStart (uint16_t vmid)
 
void registerTLB (VegaISA::GpuTLB *tlb)
 Control methods for TLBs associated with the GPU device.
 
void invalidateTLBs ()
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section.
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object.
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Public Attributes

std::unordered_map< uint64_t, uint64_t > gartTable
 Copy of GART table.
 

Private Types

typedef struct gem5::AMDGPUVM::GEM5_PACKED AMDGPUVMContext
 
typedef gem5::AMDGPUVM::AMDGPUSysVMContext AMDGPUSysVMContext
 

Private Member Functions

void writeMMIOGfx900 (PacketPtr pkt, Addr offset)
 Different MMIO implements for different GFX versions with overlapping MMIO addresses.
 
void writeMMIOGfx940 (PacketPtr pkt, Addr offset)
 

Private Attributes

AMDGPUDevicegpuDevice
 
AMDGPUSysVMContext vmContext0
 
std::vector< AMDGPUVMContextvmContexts
 
uint64_t mmhubBase = 0x0
 
uint64_t mmhubTop = 0x0
 
std::vector< VegaISA::GpuTLB * > gpu_tlbs
 List of TLBs associated with the GPU device.
 
std::array< AddrRange, NUM_MMIO_RANGESmmioRanges
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section.
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it.
 

Detailed Description

Definition at line 135 of file amdgpu_vm.hh.

Member Typedef Documentation

◆ AMDGPUSysVMContext

typedef gem5::AMDGPUVM::AMDGPUSysVMContext gem5::AMDGPUVM::AMDGPUSysVMContext
private

◆ AMDGPUVMContext

Constructor & Destructor Documentation

◆ AMDGPUVM()

Member Function Documentation

◆ gartBase()

Addr gem5::AMDGPUVM::gartBase ( )

Return base address of GART table in framebuffer.

Definition at line 87 of file amdgpu_vm.cc.

References vmContext0.

Referenced by getFrameAperture(), and inGARTRange().

◆ gartSize()

Addr gem5::AMDGPUVM::gartSize ( )

Return size of GART in number of PTEs.

Definition at line 93 of file amdgpu_vm.cc.

References vmContext0.

Referenced by getFrameAperture(), and inGARTRange().

◆ getAGPBase()

Addr gem5::AMDGPUVM::getAGPBase ( )
inline

Definition at line 247 of file amdgpu_vm.hh.

References vmContext0.

◆ getAGPBot()

Addr gem5::AMDGPUVM::getAGPBot ( )
inline

Definition at line 245 of file amdgpu_vm.hh.

References vmContext0.

◆ getAGPTop()

Addr gem5::AMDGPUVM::getAGPTop ( )
inline

Definition at line 246 of file amdgpu_vm.hh.

References vmContext0.

◆ getFBBase()

Addr gem5::AMDGPUVM::getFBBase ( )
inline

Definition at line 267 of file amdgpu_vm.hh.

References vmContext0.

◆ getFBOffset()

Addr gem5::AMDGPUVM::getFBOffset ( )
inline

Definition at line 269 of file amdgpu_vm.hh.

References vmContext0.

◆ getFBTop()

Addr gem5::AMDGPUVM::getFBTop ( )
inline

Definition at line 268 of file amdgpu_vm.hh.

References vmContext0.

◆ getFrameAperture()

Addr gem5::AMDGPUVM::getFrameAperture ( Addr addr)
inline

Definition at line 287 of file amdgpu_vm.hh.

References gem5::X86ISA::addr, gartBase(), gartSize(), and warn_once.

◆ getMMHUBBase()

Addr gem5::AMDGPUVM::getMMHUBBase ( )
inline

Definition at line 255 of file amdgpu_vm.hh.

References mmhubBase.

Referenced by inMMHUB().

◆ getMMHUBTop()

Addr gem5::AMDGPUVM::getMMHUBTop ( )
inline

Definition at line 256 of file amdgpu_vm.hh.

References mmhubTop.

Referenced by inMMHUB().

◆ getMMIOAperture()

const AddrRange & gem5::AMDGPUVM::getMMIOAperture ( Addr addr)

◆ getMMIORange()

AddrRange gem5::AMDGPUVM::getMMIORange ( mmio_range_t mmio_aperture)

Definition at line 68 of file amdgpu_vm.cc.

References mmioRanges.

◆ getPageTableBase()

Addr gem5::AMDGPUVM::getPageTableBase ( uint16_t vmid)
inline

Definition at line 311 of file amdgpu_vm.hh.

References vmContexts.

◆ getPageTableStart()

Addr gem5::AMDGPUVM::getPageTableStart ( uint16_t vmid)
inline

Definition at line 318 of file amdgpu_vm.hh.

References vmContexts.

◆ getSysAddrRangeHigh()

Addr gem5::AMDGPUVM::getSysAddrRangeHigh ( )
inline

Definition at line 279 of file amdgpu_vm.hh.

References vmContext0.

◆ getSysAddrRangeLow()

Addr gem5::AMDGPUVM::getSysAddrRangeLow ( )
inline

Definition at line 278 of file amdgpu_vm.hh.

References vmContext0.

◆ inAGP()

bool gem5::AMDGPUVM::inAGP ( Addr vaddr)
inline

Methods for resolving apertures.

Definition at line 240 of file amdgpu_vm.hh.

References gem5::MipsISA::vaddr, and vmContext0.

◆ inFB()

bool gem5::AMDGPUVM::inFB ( Addr vaddr)
inline

Definition at line 262 of file amdgpu_vm.hh.

References gem5::MipsISA::vaddr, and vmContext0.

◆ inGARTRange()

bool gem5::AMDGPUVM::inGARTRange ( Addr paddr)
inline

Definition at line 222 of file amdgpu_vm.hh.

References gartBase(), and gartSize().

◆ inMMHUB()

bool gem5::AMDGPUVM::inMMHUB ( Addr vaddr)
inline

Definition at line 250 of file amdgpu_vm.hh.

References getMMHUBBase(), getMMHUBTop(), and gem5::MipsISA::vaddr.

◆ inSys()

bool gem5::AMDGPUVM::inSys ( Addr vaddr)
inline

Definition at line 272 of file amdgpu_vm.hh.

References gem5::MipsISA::vaddr, and vmContext0.

◆ invalidateTLBs()

void gem5::AMDGPUVM::invalidateTLBs ( )

Definition at line 280 of file amdgpu_vm.cc.

References DPRINTF, gpu_tlbs, and gem5::ArmISA::tlb.

◆ readMMIO()

◆ registerTLB()

void gem5::AMDGPUVM::registerTLB ( VegaISA::GpuTLB * tlb)

Control methods for TLBs associated with the GPU device.

Definition at line 273 of file amdgpu_vm.cc.

References DPRINTF, gpu_tlbs, and gem5::ArmISA::tlb.

◆ serialize()

void gem5::AMDGPUVM::serialize ( CheckpointOut & cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 290 of file amdgpu_vm.cc.

References gem5::AMDGPU_VM_COUNT, gartTable, gem5::ArmISA::i, mmhubBase, mmhubTop, SERIALIZE_ARRAY, SERIALIZE_SCALAR, vmContext0, and vmContexts.

◆ setGPUDevice()

void gem5::AMDGPUVM::setGPUDevice ( AMDGPUDevice * gpu_device)
inline

Definition at line 210 of file amdgpu_vm.hh.

References gpuDevice.

◆ setMMHUBBase()

void gem5::AMDGPUVM::setMMHUBBase ( Addr base)
inline

Definition at line 258 of file amdgpu_vm.hh.

References gem5::RiscvISA::base, and mmhubBase.

◆ setMMHUBTop()

void gem5::AMDGPUVM::setMMHUBTop ( Addr top)
inline

Definition at line 259 of file amdgpu_vm.hh.

References mmhubTop.

◆ setMMIOAperture()

void gem5::AMDGPUVM::setMMIOAperture ( mmio_range_t mmio_aperture,
AddrRange range )

Definition at line 62 of file amdgpu_vm.cc.

References mmioRanges.

◆ setPageTableBase()

void gem5::AMDGPUVM::setPageTableBase ( uint16_t vmid,
Addr ptBase )
inline

Page table base/start accessors for user VMIDs.

Definition at line 305 of file amdgpu_vm.hh.

References vmContexts.

◆ unserialize()

void gem5::AMDGPUVM::unserialize ( CheckpointIn & cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 341 of file amdgpu_vm.cc.

References gem5::AMDGPU_VM_COUNT, gartTable, gem5::ArmISA::i, mmhubBase, mmhubTop, UNSERIALIZE_ARRAY, UNSERIALIZE_SCALAR, vmContext0, and vmContexts.

◆ writeMMIO()

void gem5::AMDGPUVM::writeMMIO ( PacketPtr pkt,
Addr offset )

Definition at line 260 of file amdgpu_vm.cc.

References gpuDevice, gem5::ArmISA::offset, writeMMIOGfx900(), and writeMMIOGfx940().

◆ writeMMIOGfx900()

◆ writeMMIOGfx940()

Member Data Documentation

◆ gartTable

std::unordered_map<uint64_t, uint64_t> gem5::AMDGPUVM::gartTable

Copy of GART table.

Typically resides in device memory, however we use a copy in gem5 to simplify the interface.

Definition at line 231 of file amdgpu_vm.hh.

Referenced by serialize(), and unserialize().

◆ gpu_tlbs

std::vector<VegaISA::GpuTLB *> gem5::AMDGPUVM::gpu_tlbs
private

List of TLBs associated with the GPU device.

This is used for flushing the TLBs upon a driver request.

Definition at line 196 of file amdgpu_vm.hh.

Referenced by invalidateTLBs(), and registerTLB().

◆ gpuDevice

AMDGPUDevice* gem5::AMDGPUVM::gpuDevice
private

Definition at line 138 of file amdgpu_vm.hh.

Referenced by setGPUDevice(), and writeMMIO().

◆ mmhubBase

uint64_t gem5::AMDGPUVM::mmhubBase = 0x0
private

Definition at line 189 of file amdgpu_vm.hh.

Referenced by getMMHUBBase(), readMMIO(), serialize(), setMMHUBBase(), and unserialize().

◆ mmhubTop

uint64_t gem5::AMDGPUVM::mmhubTop = 0x0
private

Definition at line 190 of file amdgpu_vm.hh.

Referenced by getMMHUBTop(), readMMIO(), serialize(), setMMHUBTop(), and unserialize().

◆ mmioRanges

std::array<AddrRange, NUM_MMIO_RANGES> gem5::AMDGPUVM::mmioRanges
private

Definition at line 205 of file amdgpu_vm.hh.

Referenced by AMDGPUVM(), getMMIOAperture(), getMMIORange(), and setMMIOAperture().

◆ vmContext0

◆ vmContexts

std::vector<AMDGPUVMContext> gem5::AMDGPUVM::vmContexts
private

The documentation for this class was generated from the following files:

Generated on Mon May 26 2025 09:19:18 for gem5 by doxygen 1.13.2