gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::SDMAEngine Class Reference

System DMA Engine class for AMD dGPU. More...

#include <sdma_engine.hh>

Inheritance diagram for gem5::SDMAEngine:
gem5::DmaVirtDevice gem5::DmaDevice gem5::PioDevice gem5::ClockedObject gem5::SimObject gem5::Clocked gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named

Classes

class  SDMAQueue
 

Public Member Functions

 SDMAEngine (const SDMAEngineParams &p)
 
void setGPUDevice (AMDGPUDevice *gpu_device)
 
void setId (int _id)
 
int getId () const
 
int getIHClientId (int _id)
 Returns the client id for the Interrupt Handler.
 
Addr getGARTAddr (Addr addr) const
 Methods for translation.
 
TranslationGenPtr translate (Addr vaddr, Addr size) override
 GPUController will perform DMA operations on VAs, and because page faults are not currently supported for GPUController, we must be able to find the pages mapped for the process.
 
Addr getDeviceAddress (Addr raw_addr)
 Translate an address in an SDMA packet.
 
Tick write (PacketPtr pkt) override
 Inherited methods.
 
Tick read (PacketPtr pkt) override
 Pure virtual function that the device must implement.
 
AddrRangeList getAddrRanges () const override
 Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to.
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
void processGfx (Addr wptrOffset)
 Given a new write ptr offset, communicated to the GPU through a doorbell write, the SDMA engine processes the page, gfx, rlc0, or rlc1 queue.
 
void processPage (Addr wptrOffset)
 
void processRLC (Addr doorbellOffset, Addr wptrOffset)
 
void decodeNext (SDMAQueue *q)
 This method checks read and write pointers and starts decoding packets if the read pointer is less than the write pointer.
 
void decodeHeader (SDMAQueue *q, uint32_t data)
 Reads the first DW (32 bits) (i.e., header) of an SDMA packet, which encodes the opcode and sub-opcode of the packet.
 
void write (SDMAQueue *q, sdmaWrite *pkt)
 Methods that implement processing of SDMA packets.
 
void writeReadData (SDMAQueue *q, sdmaWrite *pkt, uint32_t *dmaBuffer)
 
void writeDone (SDMAQueue *q, sdmaWrite *pkt, uint32_t *dmaBuffer)
 
void copy (SDMAQueue *q, sdmaCopy *pkt)
 
void copyReadData (SDMAQueue *q, sdmaCopy *pkt, uint8_t *dmaBuffer)
 
void copyDone (SDMAQueue *q, sdmaCopy *pkt, uint8_t *dmaBuffer)
 
void indirectBuffer (SDMAQueue *q, sdmaIndirectBuffer *pkt)
 
void fence (SDMAQueue *q, sdmaFence *pkt)
 
void fenceDone (SDMAQueue *q, sdmaFence *pkt)
 
void trap (SDMAQueue *q, sdmaTrap *pkt)
 
void srbmWrite (SDMAQueue *q, sdmaSRBMWriteHeader *header, sdmaSRBMWrite *pkt)
 
void pollRegMem (SDMAQueue *q, sdmaPollRegMemHeader *header, sdmaPollRegMem *pkt)
 Implements a poll reg/mem packet that polls an SRBM register or a memory location, compares the retrieved value with a reference value and if unsuccessfull it retries indefinitely or for a limited number of times.
 
void pollRegMemRead (SDMAQueue *q, sdmaPollRegMemHeader *header, sdmaPollRegMem *pkt, uint32_t dma_buffer, int count)
 
bool pollRegMemFunc (uint32_t value, uint32_t reference, uint32_t func)
 
void ptePde (SDMAQueue *q, sdmaPtePde *pkt)
 
void ptePdeDone (SDMAQueue *q, sdmaPtePde *pkt, uint64_t *dmaBuffer)
 
void atomic (SDMAQueue *q, sdmaAtomicHeader *header, sdmaAtomic *pkt)
 
void atomicData (SDMAQueue *q, sdmaAtomicHeader *header, sdmaAtomic *pkt, uint64_t *dmaBuffer)
 
void atomicDone (SDMAQueue *q, sdmaAtomicHeader *header, sdmaAtomic *pkt, uint64_t *dmaBuffer)
 
void constFill (SDMAQueue *q, sdmaConstFill *pkt, uint32_t header)
 
void constFillDone (SDMAQueue *q, sdmaConstFill *pkt, uint8_t *fill_data)
 
Addr getMmioBase ()
 Methods for getting SDMA MMIO base address and size.
 
Addr getMmioSize ()
 
uint64_t getGfxBase ()
 Methods for getting the values of SDMA MMIO registers.
 
uint64_t getGfxRptr ()
 
uint64_t getGfxDoorbell ()
 
uint64_t getGfxDoorbellOffset ()
 
uint64_t getGfxWptr ()
 
uint64_t getPageBase ()
 
uint64_t getPageRptr ()
 
uint64_t getPageDoorbell ()
 
uint64_t getPageDoorbellOffset ()
 
uint64_t getPageWptr ()
 
void writeMMIO (PacketPtr pkt, Addr mmio_offset)
 Methods for setting the values of SDMA MMIO registers.
 
void setGfxBaseLo (uint32_t data)
 
void setGfxBaseHi (uint32_t data)
 
void setGfxRptrLo (uint32_t data)
 
void setGfxRptrHi (uint32_t data)
 
void setGfxDoorbellLo (uint32_t data)
 
void setGfxDoorbellHi (uint32_t data)
 
void setGfxDoorbellOffsetLo (uint32_t data)
 
void setGfxDoorbellOffsetHi (uint32_t data)
 
void setGfxSize (uint32_t data)
 
void setGfxWptrLo (uint32_t data)
 
void setGfxWptrHi (uint32_t data)
 
void setPageBaseLo (uint32_t data)
 
void setPageBaseHi (uint32_t data)
 
void setPageRptrLo (uint32_t data)
 
void setPageRptrHi (uint32_t data)
 
void setPageDoorbellLo (uint32_t data)
 
void setPageDoorbellHi (uint32_t data)
 
void setPageDoorbellOffsetLo (uint32_t data)
 
void setPageDoorbellOffsetHi (uint32_t data)
 
void setPageSize (uint32_t data)
 
void setPageWptrLo (uint32_t data)
 
void setPageWptrHi (uint32_t data)
 
void registerRLCQueue (Addr doorbell, Addr mqdAddr, SDMAQueueDesc *mqd)
 Methods for RLC queues.
 
void unregisterRLCQueue (Addr doorbell)
 
void deallocateRLCQueues ()
 
- Public Member Functions inherited from gem5::DmaVirtDevice
 DmaVirtDevice (const Params &p)
 
virtual ~DmaVirtDevice ()
 
void dmaReadVirt (Addr host_addr, unsigned size, DmaCallback *cb, void *data, Tick delay=0)
 Initiate a DMA read from virtual address host_addr.
 
void dmaWriteVirt (Addr host_addr, unsigned size, DmaCallback *b, void *data, Tick delay=0)
 Initiate a DMA write from virtual address host_addr.
 
void dmaVirt (DmaFnPtr dmaFn, Addr host_addr, unsigned size, DmaCallback *cb, void *data, Tick delay=0)
 Initiate a call to DmaDevice using DmaFnPtr do a DMA starting from virtual address host_addr for size number of bytes on the data.
 
- Public Member Functions inherited from gem5::DmaDevice
 DmaDevice (const Params &p)
 
virtual ~DmaDevice ()=default
 
void dmaWrite (Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
 
void dmaWrite (Addr addr, int size, Event *event, uint8_t *data, Tick delay=0)
 
void dmaRead (Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
 
void dmaRead (Addr addr, int size, Event *event, uint8_t *data, Tick delay=0)
 
bool dmaPending () const
 
void init () override
 init() is called after all C++ SimObjects have been created and all ports are connected.
 
Addr cacheBlockSize () const
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a port with a given name and index.
 
- Public Member Functions inherited from gem5::PioDevice
 PioDevice (const Params &p)
 
virtual ~PioDevice ()
 
void init () override
 init() is called after all C++ SimObjects have been created and all ports are connected.
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a port with a given name and index.
 
- Public Member Functions inherited from gem5::ClockedObject
 ClockedObject (const ClockedObjectParams &p)
 
- Public Member Functions inherited from gem5::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint.
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint.
 
virtual void regProbePoints ()
 Register probe points for this object.
 
virtual void regProbeListeners ()
 Register probe listeners for this object.
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object.
 
virtual void startup ()
 startup() is the final initialization call before simulation.
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining.
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes.
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers.
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::EventManager
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick) -1)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers.
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue.
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- 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 Member Functions inherited from gem5::Drainable
DrainState drainState () const
 Return the current drain state of an object.
 
virtual void notifyFork ()
 Notify a child process of a fork.
 
- Public Member Functions inherited from gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group.
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters.
 
virtual void resetStats ()
 Callback to reset stats.
 
virtual void preDumpStats ()
 Callback before stats are dumped.
 
void addStat (statistics::Info *info)
 Register a stat with this group.
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object.
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object.
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block.
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group.
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block.
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 
- Public Member Functions inherited from gem5::Clocked
void updateClockPeriod ()
 Update the tick to the current tick.
 
Tick clockEdge (Cycles cycles=Cycles(0)) const
 Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle.
 
Cycles curCycle () const
 Determine the current cycle, corresponding to a tick aligned to a clock edge.
 
Tick nextCycle () const
 Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future.
 
uint64_t frequency () const
 
Tick clockPeriod () const
 
double voltage () const
 
Cycles ticksToCycles (Tick t) const
 
Tick cyclesToTicks (Cycles c) const
 

Public Attributes

int cur_vmid = 0
 
- Public Attributes inherited from gem5::ClockedObject
PowerStatepowerState
 

Private Types

enum  SDMAType { SDMAGfx , SDMAPage }
 

Private Member Functions

void processRLC0 (Addr wptrOffset)
 
void processRLC1 (Addr wptrOffset)
 

Private Attributes

int id
 
SDMAQueue gfx
 Each SDMAEngine processes four queues: paging, gfx, rlc0, and rlc1, where RLC stands for Run List Controller.
 
SDMAQueue page
 
SDMAQueue gfxIb
 
SDMAQueue pageIb
 
SDMAQueue rlc0
 
SDMAQueue rlc0Ib
 
SDMAQueue rlc1
 
SDMAQueue rlc1Ib
 
uint64_t gfxBase
 
uint64_t gfxRptr
 
uint64_t gfxDoorbell
 
uint64_t gfxDoorbellOffset
 
uint64_t gfxWptr
 
uint64_t pageBase
 
uint64_t pageRptr
 
uint64_t pageDoorbell
 
uint64_t pageDoorbellOffset
 
uint64_t pageWptr
 
AMDGPUDevicegpuDevice
 
VegaISA::Walkerwalker
 
std::array< Addr, 2 > rlcInfo {}
 
Addr mmioBase = 0
 
Addr mmioSize = 0
 

Additional Inherited Members

- Public Types inherited from gem5::DmaVirtDevice
typedef void(DmaDevice::* DmaFnPtr) (Addr, int, Event *, uint8_t *, Tick)
 
- Public Types inherited from gem5::DmaDevice
typedef DmaDeviceParams Params
 
- Public Types inherited from gem5::PioDevice
using Params = PioDeviceParams
 
- Public Types inherited from gem5::ClockedObject
using Params = ClockedObjectParams
 Parameters of ClockedObject.
 
- Public Types inherited from gem5::SimObject
typedef SimObjectParams Params
 
- Static Public Member Functions inherited from gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing all SimObjects in the system.
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it.
 
static void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
- 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.
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain.
 
void signalDrainDone () const
 Signal that an object is drained.
 
- Protected Member Functions inherited from gem5::Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters.
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance.
 
void resetClock () const
 Reset the object's clock using the current global tick value.
 
virtual void clockPeriodUpdated ()
 A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed.
 
- Protected Attributes inherited from gem5::DmaDevice
DmaPort dmaPort
 
- Protected Attributes inherited from gem5::PioDevice
Systemsys
 
PioPort< PioDevicepioPort
 The pioPort that handles the requests for us and provides us requests that it sees.
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters.
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue.
 

Detailed Description

System DMA Engine class for AMD dGPU.

Definition at line 48 of file sdma_engine.hh.

Member Enumeration Documentation

◆ SDMAType

Enumerator
SDMAGfx 
SDMAPage 

Definition at line 50 of file sdma_engine.hh.

Constructor & Destructor Documentation

◆ SDMAEngine()

Member Function Documentation

◆ atomic()

◆ atomicData()

void gem5::SDMAEngine::atomicData ( SDMAQueue * q,
sdmaAtomicHeader * header,
sdmaAtomic * pkt,
uint64_t * dmaBuffer )

◆ atomicDone()

void gem5::SDMAEngine::atomicDone ( SDMAQueue * q,
sdmaAtomicHeader * header,
sdmaAtomic * pkt,
uint64_t * dmaBuffer )

Definition at line 1070 of file sdma_engine.cc.

References gem5::GEM5_PACKED::addr, decodeNext(), DPRINTF, header, and gem5::ArmISA::q.

Referenced by atomicData().

◆ constFill()

◆ constFillDone()

void gem5::SDMAEngine::constFillDone ( SDMAQueue * q,
sdmaConstFill * pkt,
uint8_t * fill_data )

Definition at line 1135 of file sdma_engine.cc.

References gem5::GEM5_PACKED::addr, decodeNext(), DPRINTF, and gem5::ArmISA::q.

Referenced by constFill().

◆ copy()

◆ copyDone()

void gem5::SDMAEngine::copyDone ( SDMAQueue * q,
sdmaCopy * pkt,
uint8_t * dmaBuffer )

◆ copyReadData()

◆ deallocateRLCQueues()

void gem5::SDMAEngine::deallocateRLCQueues ( )

◆ decodeHeader()

◆ decodeNext()

void gem5::SDMAEngine::decodeNext ( SDMAQueue * q)

This method checks read and write pointers and starts decoding packets if the read pointer is less than the write pointer.

It also marks a queue a being currently processing, in case the doorbell is rung again, the newly enqueued packets will be decoded once the currently processing once are finished. This is achieved by calling decodeNext once an entire SDMA packet has been processed.

Definition at line 342 of file sdma_engine.cc.

References cur_vmid, decodeHeader(), decodeNext(), gem5::DmaVirtDevice::dmaReadVirt(), gem5::DmaVirtDevice::dmaWriteVirt(), DPRINTF, header, and gem5::ArmISA::q.

Referenced by atomicDone(), constFillDone(), copyDone(), decodeHeader(), decodeNext(), fenceDone(), indirectBuffer(), pollRegMem(), pollRegMemRead(), processGfx(), processPage(), processRLC0(), processRLC1(), ptePdeDone(), srbmWrite(), trap(), and writeDone().

◆ fence()

void gem5::SDMAEngine::fence ( SDMAQueue * q,
sdmaFence * pkt )

◆ fenceDone()

void gem5::SDMAEngine::fenceDone ( SDMAQueue * q,
sdmaFence * pkt )

Definition at line 814 of file sdma_engine.cc.

References gem5::GEM5_PACKED::data, decodeNext(), gem5::GEM5_PACKED::dest, DPRINTF, and gem5::ArmISA::q.

Referenced by fence().

◆ getAddrRanges()

AddrRangeList gem5::SDMAEngine::getAddrRanges ( ) const
overridevirtual

Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to.

Returns
a list of non-overlapping address ranges

Implements gem5::PioDevice.

Definition at line 1145 of file sdma_engine.cc.

◆ getDeviceAddress()

Addr gem5::SDMAEngine::getDeviceAddress ( Addr raw_addr)

Translate an address in an SDMA packet.

Return the device address if address in the packet is on the device and 0 if the the address in the packet is on the host/system memory.

Definition at line 119 of file sdma_engine.cc.

References cur_vmid, DPRINTF, gem5::AMDGPUVM::getMMHUBBase(), gem5::AMDGPUDevice::getVM(), gpuDevice, gem5::AMDGPUVM::inMMHUB(), and translate().

Referenced by constFill(), copy(), and copyReadData().

◆ getGARTAddr()

Addr gem5::SDMAEngine::getGARTAddr ( Addr addr) const

◆ getGfxBase()

uint64_t gem5::SDMAEngine::getGfxBase ( )
inline

Methods for getting the values of SDMA MMIO registers.

Definition at line 265 of file sdma_engine.hh.

References gfxBase.

◆ getGfxDoorbell()

uint64_t gem5::SDMAEngine::getGfxDoorbell ( )
inline

Definition at line 267 of file sdma_engine.hh.

References gfxDoorbell.

Referenced by writeMMIO().

◆ getGfxDoorbellOffset()

uint64_t gem5::SDMAEngine::getGfxDoorbellOffset ( )
inline

Definition at line 268 of file sdma_engine.hh.

References gfxDoorbellOffset.

Referenced by writeMMIO().

◆ getGfxRptr()

uint64_t gem5::SDMAEngine::getGfxRptr ( )
inline

Definition at line 266 of file sdma_engine.hh.

References gfxRptr.

◆ getGfxWptr()

uint64_t gem5::SDMAEngine::getGfxWptr ( )
inline

Definition at line 269 of file sdma_engine.hh.

References gfxWptr.

◆ getId()

int gem5::SDMAEngine::getId ( ) const
inline

Definition at line 171 of file sdma_engine.hh.

References id.

Referenced by trap().

◆ getIHClientId()

int gem5::SDMAEngine::getIHClientId ( int _id)

◆ getMmioBase()

Addr gem5::SDMAEngine::getMmioBase ( )
inline

Methods for getting SDMA MMIO base address and size.

These are set by the python configuration depending on device to allow for flexible base addresses depending on what GPU is being simulated.

Definition at line 259 of file sdma_engine.hh.

References mmioBase.

◆ getMmioSize()

Addr gem5::SDMAEngine::getMmioSize ( )
inline

Definition at line 260 of file sdma_engine.hh.

References mmioSize.

◆ getPageBase()

uint64_t gem5::SDMAEngine::getPageBase ( )
inline

Definition at line 270 of file sdma_engine.hh.

References pageBase.

◆ getPageDoorbell()

uint64_t gem5::SDMAEngine::getPageDoorbell ( )
inline

Definition at line 272 of file sdma_engine.hh.

References pageDoorbell.

Referenced by writeMMIO().

◆ getPageDoorbellOffset()

uint64_t gem5::SDMAEngine::getPageDoorbellOffset ( )
inline

Definition at line 273 of file sdma_engine.hh.

References pageDoorbellOffset.

Referenced by writeMMIO().

◆ getPageRptr()

uint64_t gem5::SDMAEngine::getPageRptr ( )
inline

Definition at line 271 of file sdma_engine.hh.

References pageRptr.

◆ getPageWptr()

uint64_t gem5::SDMAEngine::getPageWptr ( )
inline

Definition at line 274 of file sdma_engine.hh.

References pageWptr.

◆ indirectBuffer()

void gem5::SDMAEngine::indirectBuffer ( SDMAQueue * q,
sdmaIndirectBuffer * pkt )

◆ pollRegMem()

void gem5::SDMAEngine::pollRegMem ( SDMAQueue * q,
sdmaPollRegMemHeader * header,
sdmaPollRegMem * pkt )

Implements a poll reg/mem packet that polls an SRBM register or a memory location, compares the retrieved value with a reference value and if unsuccessfull it retries indefinitely or for a limited number of times.

Definition at line 876 of file sdma_engine.cc.

References gem5::GEM5_PACKED::address, decodeNext(), gem5::DmaVirtDevice::dmaReadVirt(), DPRINTF, header, gem5::GEM5_PACKED::mask, panic, gem5::GEM5_PACKED::pollInt, pollRegMemRead(), gem5::ArmISA::q, gem5::GEM5_PACKED::ref, gem5::GEM5_PACKED::retryCount, and warn_once.

Referenced by decodeHeader().

◆ pollRegMemFunc()

bool gem5::SDMAEngine::pollRegMemFunc ( uint32_t value,
uint32_t reference,
uint32_t func )

Definition at line 944 of file sdma_engine.cc.

References panic.

Referenced by pollRegMemRead().

◆ pollRegMemRead()

◆ processGfx()

void gem5::SDMAEngine::processGfx ( Addr wptrOffset)

Given a new write ptr offset, communicated to the GPU through a doorbell write, the SDMA engine processes the page, gfx, rlc0, or rlc1 queue.

Definition at line 279 of file sdma_engine.cc.

References decodeNext(), gfx, gem5::SDMAEngine::SDMAQueue::processing(), and gem5::SDMAEngine::SDMAQueue::setWptr().

Referenced by gem5::AMDGPUDevice::writeDoorbell().

◆ processPage()

void gem5::SDMAEngine::processPage ( Addr wptrOffset)

◆ processRLC()

void gem5::SDMAEngine::processRLC ( Addr doorbellOffset,
Addr wptrOffset )

Definition at line 301 of file sdma_engine.cc.

References panic, processRLC0(), processRLC1(), and rlcInfo.

Referenced by gem5::AMDGPUDevice::writeDoorbell().

◆ processRLC0()

void gem5::SDMAEngine::processRLC0 ( Addr wptrOffset)
private

◆ processRLC1()

void gem5::SDMAEngine::processRLC1 ( Addr wptrOffset)
private

◆ ptePde()

◆ ptePdeDone()

void gem5::SDMAEngine::ptePdeDone ( SDMAQueue * q,
sdmaPtePde * pkt,
uint64_t * dmaBuffer )

Definition at line 1016 of file sdma_engine.cc.

References gem5::GEM5_PACKED::count, decodeNext(), gem5::GEM5_PACKED::dest, DPRINTF, and gem5::ArmISA::q.

Referenced by ptePde().

◆ read()

Tick gem5::SDMAEngine::read ( PacketPtr pkt)
inlineoverridevirtual

Pure virtual function that the device must implement.

Called when a read command is recieved by the port.

Parameters
pktPacket describing this request
Returns
number of ticks it took to complete

Implements gem5::PioDevice.

Definition at line 194 of file sdma_engine.hh.

◆ registerRLCQueue()

◆ serialize()

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

Serialize an object.

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

Parameters
cpCheckpoint state

Reimplemented from gem5::ClockedObject.

Definition at line 1152 of file sdma_engine.cc.

References gem5::X86ISA::base, gfx, gfxBase, gfxDoorbell, gfxDoorbellOffset, gfxIb, gfxRptr, gfxWptr, gem5::ArmISA::i, page, pageBase, pageDoorbell, pageDoorbellOffset, pageIb, pageRptr, pageWptr, gem5::ClockedObject::serialize(), SERIALIZE_ARRAY, and SERIALIZE_SCALAR.

◆ setGfxBaseHi()

void gem5::SDMAEngine::setGfxBaseHi ( uint32_t data)

◆ setGfxBaseLo()

void gem5::SDMAEngine::setGfxBaseLo ( uint32_t data)

◆ setGfxDoorbellHi()

void gem5::SDMAEngine::setGfxDoorbellHi ( uint32_t data)

Definition at line 1360 of file sdma_engine.cc.

References data, gfxDoorbell, and gem5::insertBits().

◆ setGfxDoorbellLo()

void gem5::SDMAEngine::setGfxDoorbellLo ( uint32_t data)

Definition at line 1353 of file sdma_engine.cc.

References data, gfxDoorbell, and gem5::insertBits().

Referenced by gem5::AMDGPUDevice::AMDGPUDevice(), and writeMMIO().

◆ setGfxDoorbellOffsetHi()

void gem5::SDMAEngine::setGfxDoorbellOffsetHi ( uint32_t data)

Definition at line 1378 of file sdma_engine.cc.

References data, gfxDoorbellOffset, and gem5::insertBits().

◆ setGfxDoorbellOffsetLo()

void gem5::SDMAEngine::setGfxDoorbellOffsetLo ( uint32_t data)

◆ setGfxRptrHi()

void gem5::SDMAEngine::setGfxRptrHi ( uint32_t data)

◆ setGfxRptrLo()

void gem5::SDMAEngine::setGfxRptrLo ( uint32_t data)

◆ setGfxSize()

void gem5::SDMAEngine::setGfxSize ( uint32_t data)

◆ setGfxWptrHi()

void gem5::SDMAEngine::setGfxWptrHi ( uint32_t data)

Definition at line 1400 of file sdma_engine.cc.

References data, gfxWptr, and gem5::insertBits().

Referenced by gem5::AMDGPUDevice::AMDGPUDevice(), and writeMMIO().

◆ setGfxWptrLo()

void gem5::SDMAEngine::setGfxWptrLo ( uint32_t data)

Definition at line 1393 of file sdma_engine.cc.

References data, gfxWptr, and gem5::insertBits().

Referenced by gem5::AMDGPUDevice::AMDGPUDevice(), and writeMMIO().

◆ setGPUDevice()

void gem5::SDMAEngine::setGPUDevice ( AMDGPUDevice * gpu_device)

◆ setId()

void gem5::SDMAEngine::setId ( int _id)
inline

Definition at line 170 of file sdma_engine.hh.

◆ setPageBaseHi()

void gem5::SDMAEngine::setPageBaseHi ( uint32_t data)

◆ setPageBaseLo()

void gem5::SDMAEngine::setPageBaseLo ( uint32_t data)

◆ setPageDoorbellHi()

void gem5::SDMAEngine::setPageDoorbellHi ( uint32_t data)

Definition at line 1446 of file sdma_engine.cc.

References data, gem5::insertBits(), and pageDoorbell.

◆ setPageDoorbellLo()

void gem5::SDMAEngine::setPageDoorbellLo ( uint32_t data)

Definition at line 1439 of file sdma_engine.cc.

References data, gem5::insertBits(), and pageDoorbell.

Referenced by gem5::AMDGPUDevice::AMDGPUDevice(), and writeMMIO().

◆ setPageDoorbellOffsetHi()

void gem5::SDMAEngine::setPageDoorbellOffsetHi ( uint32_t data)

Definition at line 1464 of file sdma_engine.cc.

References data, gem5::insertBits(), and pageDoorbellOffset.

◆ setPageDoorbellOffsetLo()

void gem5::SDMAEngine::setPageDoorbellOffsetLo ( uint32_t data)

◆ setPageRptrHi()

void gem5::SDMAEngine::setPageRptrHi ( uint32_t data)

◆ setPageRptrLo()

void gem5::SDMAEngine::setPageRptrLo ( uint32_t data)

◆ setPageSize()

void gem5::SDMAEngine::setPageSize ( uint32_t data)

◆ setPageWptrHi()

void gem5::SDMAEngine::setPageWptrHi ( uint32_t data)

Definition at line 1486 of file sdma_engine.cc.

References data, gem5::insertBits(), and pageWptr.

◆ setPageWptrLo()

void gem5::SDMAEngine::setPageWptrLo ( uint32_t data)

Definition at line 1479 of file sdma_engine.cc.

References data, gem5::insertBits(), and pageWptr.

Referenced by gem5::AMDGPUDevice::AMDGPUDevice(), and writeMMIO().

◆ srbmWrite()

void gem5::SDMAEngine::srbmWrite ( SDMAQueue * q,
sdmaSRBMWriteHeader * header,
sdmaSRBMWrite * pkt )

◆ translate()

TranslationGenPtr gem5::SDMAEngine::translate ( Addr vaddr,
Addr size )
overridevirtual

GPUController will perform DMA operations on VAs, and because page faults are not currently supported for GPUController, we must be able to find the pages mapped for the process.

Implements gem5::DmaVirtDevice.

Definition at line 157 of file sdma_engine.cc.

References cur_vmid, gem5::AMDGPUDevice::getVM(), gpuDevice, gem5::AMDGPUVM::inAGP(), gem5::AMDGPUVM::inMMHUB(), gem5::MipsISA::vaddr, and walker.

Referenced by getDeviceAddress().

◆ trap()

◆ unregisterRLCQueue()

◆ unserialize()

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

Unserialize an object.

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

Parameters
cpCheckpoint state

Reimplemented from gem5::ClockedObject.

Definition at line 1198 of file sdma_engine.cc.

References gem5::X86ISA::base, gfx, gfxBase, gfxDoorbell, gfxDoorbellOffset, gfxIb, gfxRptr, gfxWptr, gem5::ArmISA::i, page, pageBase, pageDoorbell, pageDoorbellOffset, pageIb, pageRptr, pageWptr, gem5::ClockedObject::unserialize(), UNSERIALIZE_ARRAY, and UNSERIALIZE_SCALAR.

◆ write() [1/2]

Tick gem5::SDMAEngine::write ( PacketPtr pkt)
inlineoverridevirtual

Inherited methods.

Implements gem5::PioDevice.

Definition at line 193 of file sdma_engine.hh.

Referenced by decodeHeader().

◆ write() [2/2]

void gem5::SDMAEngine::write ( SDMAQueue * q,
sdmaWrite * pkt )

Methods that implement processing of SDMA packets.

Definition at line 602 of file sdma_engine.cc.

References gem5::GEM5_PACKED::count, gem5::GEM5_PACKED::dest, gem5::DmaVirtDevice::dmaReadVirt(), DPRINTF, gem5::ArmISA::q, and writeReadData().

◆ writeDone()

void gem5::SDMAEngine::writeDone ( SDMAQueue * q,
sdmaWrite * pkt,
uint32_t * dmaBuffer )

◆ writeMMIO()

◆ writeReadData()

Member Data Documentation

◆ cur_vmid

int gem5::SDMAEngine::cur_vmid = 0

Definition at line 311 of file sdma_engine.hh.

Referenced by decodeNext(), getDeviceAddress(), processRLC0(), processRLC1(), and translate().

◆ gfx

SDMAQueue gem5::SDMAEngine::gfx
private

Each SDMAEngine processes four queues: paging, gfx, rlc0, and rlc1, where RLC stands for Run List Controller.

Each one of these can have one indirect buffer associated at any particular time. The switching order between queues is supposed to be page -> gfx -> rlc0 -> page -> gfx -> rlc1, skipping empty queues.

Definition at line 138 of file sdma_engine.hh.

Referenced by processGfx(), SDMAEngine(), serialize(), setGfxBaseHi(), setGfxBaseLo(), setGfxRptrHi(), setGfxRptrLo(), setGfxSize(), and unserialize().

◆ gfxBase

uint64_t gem5::SDMAEngine::gfxBase
private

Definition at line 142 of file sdma_engine.hh.

Referenced by getGfxBase(), serialize(), setGfxBaseHi(), setGfxBaseLo(), and unserialize().

◆ gfxDoorbell

uint64_t gem5::SDMAEngine::gfxDoorbell
private

◆ gfxDoorbellOffset

uint64_t gem5::SDMAEngine::gfxDoorbellOffset
private

◆ gfxIb

SDMAQueue gem5::SDMAEngine::gfxIb
private

Definition at line 138 of file sdma_engine.hh.

Referenced by SDMAEngine(), serialize(), and unserialize().

◆ gfxRptr

uint64_t gem5::SDMAEngine::gfxRptr
private

Definition at line 143 of file sdma_engine.hh.

Referenced by getGfxRptr(), serialize(), setGfxRptrHi(), setGfxRptrLo(), and unserialize().

◆ gfxWptr

uint64_t gem5::SDMAEngine::gfxWptr
private

Definition at line 146 of file sdma_engine.hh.

Referenced by getGfxWptr(), serialize(), setGfxWptrHi(), setGfxWptrLo(), and unserialize().

◆ gpuDevice

◆ id

int gem5::SDMAEngine::id
private

Definition at line 130 of file sdma_engine.hh.

Referenced by getId().

◆ mmioBase

Addr gem5::SDMAEngine::mmioBase = 0
private

Definition at line 162 of file sdma_engine.hh.

Referenced by getMmioBase().

◆ mmioSize

Addr gem5::SDMAEngine::mmioSize = 0
private

Definition at line 163 of file sdma_engine.hh.

Referenced by getMmioSize().

◆ page

SDMAQueue gem5::SDMAEngine::page
private

◆ pageBase

uint64_t gem5::SDMAEngine::pageBase
private

Definition at line 148 of file sdma_engine.hh.

Referenced by getPageBase(), serialize(), setPageBaseHi(), setPageBaseLo(), and unserialize().

◆ pageDoorbell

uint64_t gem5::SDMAEngine::pageDoorbell
private

◆ pageDoorbellOffset

uint64_t gem5::SDMAEngine::pageDoorbellOffset
private

◆ pageIb

SDMAQueue gem5::SDMAEngine::pageIb
private

Definition at line 138 of file sdma_engine.hh.

Referenced by SDMAEngine(), serialize(), and unserialize().

◆ pageRptr

uint64_t gem5::SDMAEngine::pageRptr
private

Definition at line 149 of file sdma_engine.hh.

Referenced by getPageRptr(), serialize(), setPageRptrHi(), setPageRptrLo(), and unserialize().

◆ pageWptr

uint64_t gem5::SDMAEngine::pageWptr
private

Definition at line 152 of file sdma_engine.hh.

Referenced by getPageWptr(), serialize(), setPageWptrHi(), setPageWptrLo(), and unserialize().

◆ rlc0

SDMAQueue gem5::SDMAEngine::rlc0
private

Definition at line 139 of file sdma_engine.hh.

Referenced by processRLC0(), registerRLCQueue(), SDMAEngine(), and unregisterRLCQueue().

◆ rlc0Ib

SDMAQueue gem5::SDMAEngine::rlc0Ib
private

Definition at line 139 of file sdma_engine.hh.

Referenced by SDMAEngine().

◆ rlc1

SDMAQueue gem5::SDMAEngine::rlc1
private

Definition at line 139 of file sdma_engine.hh.

Referenced by processRLC1(), registerRLCQueue(), SDMAEngine(), and unregisterRLCQueue().

◆ rlc1Ib

SDMAQueue gem5::SDMAEngine::rlc1Ib
private

Definition at line 139 of file sdma_engine.hh.

Referenced by SDMAEngine().

◆ rlcInfo

std::array<Addr, 2> gem5::SDMAEngine::rlcInfo {}
private

◆ walker

VegaISA::Walker* gem5::SDMAEngine::walker
private

Definition at line 155 of file sdma_engine.hh.

Referenced by setGPUDevice(), and translate().


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

Generated on Tue Jun 18 2024 16:24:14 for gem5 by doxygen 1.11.0