gem5 v25.0.0.1
Loading...
Searching...
No Matches
gem5::DmaVirtDevice::DmaVirtCallback< T > Class Template Reference

Wraps a std::function object in a DmaCallback. More...

#include <dma_virt_device.hh>

Inheritance diagram for gem5::DmaVirtDevice::DmaVirtCallback< T >:
gem5::DmaCallback gem5::Drainable

Public Member Functions

 DmaVirtCallback (const std::function< void(const T &)> &function, T dma_buffer_value=0)
Public Member Functions inherited from gem5::DmaCallback
virtual const std::string name () const
DrainState drain () override
 DmaPort ensures that all oustanding DMA accesses have completed before it finishes draining.
EventgetChunkEvent ()
 Request a chunk event.
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 Attributes

dmaBuffer

Private Member Functions

virtual void process () override
 Callback function invoked on completion of all chunks.

Private Attributes

std::function< void(const T &)> _function

Additional Inherited Members

Protected Member Functions inherited from gem5::DmaCallback
virtual ~DmaCallback ()=default
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 Attributes inherited from gem5::DmaCallback
int count = 0

Detailed Description

template<class T>
class gem5::DmaVirtDevice::DmaVirtCallback< T >

Wraps a std::function object in a DmaCallback.

Much cleaner than defining a bunch of callback objects for each desired behavior when a DMA completes. Contains a built in templated buffer that can be used for DMA temporary storage.

Definition at line 51 of file dma_virt_device.hh.

Constructor & Destructor Documentation

◆ DmaVirtCallback()

template<class T>
gem5::DmaVirtDevice::DmaVirtCallback< T >::DmaVirtCallback ( const std::function< void(const T &)> & function,
T dma_buffer_value = 0 )
inline

Definition at line 64 of file dma_virt_device.hh.

References _function, and dmaBuffer.

Member Function Documentation

◆ process()

template<class T>
virtual void gem5::DmaVirtDevice::DmaVirtCallback< T >::process ( )
inlineoverrideprivatevirtual

Callback function invoked on completion of all chunks.

Implements gem5::DmaCallback.

Definition at line 56 of file dma_virt_device.hh.

References _function, and dmaBuffer.

Member Data Documentation

◆ _function

template<class T>
std::function<void(const T &)> gem5::DmaVirtDevice::DmaVirtCallback< T >::_function
private

Definition at line 53 of file dma_virt_device.hh.

Referenced by DmaVirtCallback(), and process().

◆ dmaBuffer

template<class T>
T gem5::DmaVirtDevice::DmaVirtCallback< T >::dmaBuffer

Definition at line 62 of file dma_virt_device.hh.

Referenced by DmaVirtCallback(), gem5::GPUCommandProcessor::initABI(), and process().


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

Generated on Sat Oct 18 2025 08:06:50 for gem5 by doxygen 1.14.0