Go to the documentation of this file.
38 #include "debug/AMDGPUDevice.hh"
71 uint32_t value = pkt->
getLE<uint32_t>();
77 pkt->
setLE<uint32_t>(1);
83 pkt->
setLE<uint32_t>(1);
96 pkt->
setLE<uint32_t>(1);
130 uint32_t
val = pkt->
getLE<uint32_t>();
134 uint32_t
val = pkt->
getLE<uint32_t>();
138 uint32_t
val = pkt->
getLE<uint32_t>();
142 uint32_t
val = pkt->
getLE<uint32_t>();
146 uint32_t
val = pkt->
getLE<uint32_t>();
150 uint32_t
val = pkt->
getLE<uint32_t>();
154 uint32_t
val = pkt->
getLE<uint32_t>();
158 uint32_t
val = pkt->
getLE<uint32_t>();
178 tlb->invalidateAll();
189 uint64_t gartTableSize;
219 uint64_t* gartTableKey =
new uint64_t[gartTableSize];
220 uint64_t* gartTableValue =
new uint64_t[gartTableSize];
224 gartTableKey[
i] = it->first;
225 gartTableValue[
i] = it->second;
230 delete[] gartTableKey;
231 delete[] gartTableValue;
241 uint64_t gartTableSize, *gartTableKey, *gartTableValue;
273 gartTableKey =
new uint64_t[gartTableSize];
274 gartTableValue =
new uint64_t[gartTableSize];
277 for (uint64_t
i = 0;
i < gartTableSize;
i++) {
280 delete[] gartTableKey;
281 delete[] gartTableValue;
290 if (next == range.
vaddr)
304 if (next == range.
vaddr)
313 gart_addr += lsb * 7;
317 auto result =
vm->gartTable.find(gart_addr);
318 if (result ==
vm->gartTable.end()) {
321 warn(
"GART translation for %p not found", range.
vaddr);
327 Addr pte = result->second;
329 range.
paddr = (
bits(pte, 47, 12) << 12) | lower_bits;
339 assert(
vm->inMMHUB(range.
vaddr));
342 if (next == range.
vaddr)
357 Addr start =
vm->getPageTableStart(vmid);
359 base, start, walker);
364 Fault fault = walker->startFunctional(
base, paddr, logBytes,
365 BaseMMU::Mode::Read, system_bit);
367 fatal(
"User translation fault");
371 const Addr page_size = 1 << logBytes;
373 if (next == range.
vaddr) {
381 paddr +=
vm->getMMHUBBase();
382 assert(
vm->inMMHUB(paddr));
void readMMIO(PacketPtr pkt, Addr offset)
#define fatal(...)
This implements a cprintf based fatal() function.
constexpr decltype(nullptr) NoFault
#define mmMMHUB_VM_FB_LOCATION_TOP
void translate(Range &range) const override
Subclasses implement this function to complete TranslationGen.
#define mmMMHUB_VM_INVALIDATE_ENG17_ACK
#define UNSERIALIZE_SCALAR(scalar)
static constexpr int AMDGPU_USER_PAGE_SIZE
#define mmMC_VM_FB_LOCATION_BASE
#define mmMMHUB_VM_FB_LOCATION_BASE
AMDGPUSysVMContext vmContext0
static constexpr int AMDGPU_MMHUB_PAGE_SIZE
#define mmVM_CONTEXT0_PAGE_TABLE_END_ADDR_HI32
Addr gartBase()
Return base address of GART table in framebuffer.
#define mmVM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32
#define mmVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32
bool inAGP(Addr vaddr)
Methods for resolving apertures.
This structure represents a single, contiguous translation, or carries information about whatever fau...
std::vector< AMDGPUVMContext > vmContexts
#define mmVM_CONTEXT0_PAGE_TABLE_END_ADDR_LO32
std::shared_ptr< FaultBase > Fault
void translate(Range &range) const override
Subclasses implement this function to complete TranslationGen.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::vector< VegaISA::GpuTLB * > gpu_tlbs
List of TLBs associated with the GPU device.
Device model for an AMD GPU.
constexpr T insertBits(T val, unsigned first, unsigned last, B bit_val)
Returns val with bits first to last set to the LSBs of bit_val.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define mmMC_VM_FB_OFFSET
void registerTLB(VegaISA::GpuTLB *tlb)
Control methods for TLBs associated with the GPU device.
#define SERIALIZE_ARRAY(member, size)
#define mmVM_INVALIDATE_ENG17_ACK
MMIO offsets for graphics register bus manager (GRBM).
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::unordered_map< uint64_t, uint64_t > gartTable
Copy of GART table.
#define SERIALIZE_SCALAR(scalar)
void translate(Range &range) const override
Subclasses implement this function to complete TranslationGen.
static constexpr int AMDGPU_AGP_PAGE_SIZE
#define mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR
void writeMMIO(PacketPtr pkt, Addr offset)
Addr gartSize()
Return size of GART in number of PTEs.
#define UNSERIALIZE_ARRAY(member, size)
#define mmVM_CONTEXT0_PAGE_TABLE_START_ADDR_HI32
#define mmVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32
static constexpr T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
void translate(Range &range) const override
Subclasses implement this function to complete TranslationGen.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
#define mmMC_VM_SYSTEM_APERTURE_LOW_ADDR
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::ostream CheckpointOut
static constexpr int AMDGPU_VM_COUNT
void setLE(T v)
Set the value in the data pointer to v as little endian.
#define mmMMHUB_VM_INVALIDATE_ENG17_SEM
#define mmMC_VM_FB_LOCATION_TOP
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void unserialize(CheckpointIn &cp) override
Unserialize an object.
static constexpr int AMDGPU_GART_PAGE_SIZE
Generated on Sun Jul 30 2023 01:56:54 for gem5 by doxygen 1.8.17