DMADataMover class Provides the api from which to interact with the data buffers responsable for memory operations making use of the Xilinx runtime (XRT) the types are the following: BO (Buffer object) DMA (Direct memory allocation) More...
#include <datamover.hpp>
Public Member Functions | |
DMADataMover (const uint64_t addr, std::shared_ptr< HardwareParameters > hwparams) | |
Construct a new DMADataMover object. More... | |
DMADataMover ()=delete | |
Default constructor. More... | |
virtual | ~DMADataMover () |
~DMADataMover destructor method Destroy the DMADataMover object. | |
std::shared_ptr< IMemory > | GetBuffer (const size_t size, const int memory_bank=0, const MemoryType type=MemoryType::Dual) override |
GetBuffer method This method allocates a memory buffer. Depending on the MemoryType, it allocates memory in a contiguous or memory region (non-pageable) or non contiguous memory region depending on the Memory typed past to the method. The memory can be mirrored with pageable memory for its use in the host (or CPU). More... | |
Status | Upload (const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) override |
Upload method This method moves the data from the host to the device using a DMA engine. This triggers the AXI Memory Map and AXI Stream Transactions under the hood. More... | |
Status | Download (const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) override |
Download method. More... | |
Status | Sync (const SyncType type) override |
Sync method Synchronizes data movements in case of asynchronous Upload/Download. More... | |
DeviceStatus | GetStatus () override |
GetStatus method Returns the status of the data mover in terms of transactions. More... | |
![]() | |
virtual | ~IDataMover ()=default |
~IDataMover destructor method Destroy the IDataMover object. | |
virtual Status | Upload (std::shared_ptr< IExecutionGraph > graph, const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) |
Upload method (asynchronous) Please, refer to IDataMover::Upload for reference. This overload performs an asynchronous execution of the function based on a graph of operations. It returns as soon as the operation is scheduled. More... | |
virtual Status | Download (std::shared_ptr< IExecutionGraph > graph, const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) |
Download method (asynchronous) Please, refer to IDataMover::Download for reference. This overload performs an asynchronous execution of the function based on a graph of operations. It returns as soon as the operation is scheduled. More... | |
virtual Status | Sync (std::shared_ptr< IExecutionGraph > graph, const SyncType type) |
Sync method (asynchronous) Please, refer to IDataMover::Sync for reference. This overload performs an asynchronous execution of the function based on a graph of operations. It returns as soon as the operation is scheduled. More... | |
Additional Inherited Members | |
![]() | |
enum | Type { None = 0 , DMA , XRT } |
Type Type of runtime supported by the IDataMover. More... | |
![]() | |
static std::shared_ptr< IDataMover > | Create (IDataMover::Type impl, const uint64_t addr, std::shared_ptr< HardwareParameters > hwparams) |
Create method Factory method used for creating specific subclasses of IDataMover. More... | |
DMADataMover class Provides the api from which to interact with the data buffers responsable for memory operations making use of the Xilinx runtime (XRT) the types are the following: BO (Buffer object) DMA (Direct memory allocation)
cynq::DMADataMover::DMADataMover | ( | const uint64_t | addr, |
std::shared_ptr< HardwareParameters > | hwparams | ||
) |
Construct a new DMADataMover object.
This constructs a data mover that uses DMA to execute the transfers between the host and the device. Moreover, it uses XRT buffer object as memory buffers.
addr | DMA address in the physical memory map |
hwparams | Hardware-specific params |
|
delete |
Default constructor.
The default constructor is deleted since the address is mandatory for the DMA transfer.
|
overridevirtual |
Download method.
mem | IMemory instance to download. |
size | Size in bytes of data being downloaded from the memory device by making use of the buffer. |
offset | Offset in bytes where the device pointer should start |
exetype | The execution type to use for the download, this is either sync (synchronous) or async (asynchronous) execution. |
Implements cynq::IDataMover.
|
overridevirtual |
GetBuffer method This method allocates a memory buffer. Depending on the MemoryType, it allocates memory in a contiguous or memory region (non-pageable) or non contiguous memory region depending on the Memory typed past to the method. The memory can be mirrored with pageable memory for its use in the host (or CPU).
size | Size in bytes of the buffer. |
type | One of the values in the MemoryType enum class which can be one of the following: Dual (DIMM memory) Cacheable (cache) Host (Memory from the host) Device (Memory from the device to be mapped) |
memory_bank | Currently unused |
Implements cynq::IDataMover.
|
overridevirtual |
GetStatus method Returns the status of the data mover in terms of transactions.
Implements cynq::IDataMover.
|
overridevirtual |
Sync method Synchronizes data movements in case of asynchronous Upload/Download.
type | sync type. Depending on the transaction, it will trigger sync |
Implements cynq::IDataMover.
|
overridevirtual |
Upload method This method moves the data from the host to the device using a DMA engine. This triggers the AXI Memory Map and AXI Stream Transactions under the hood.
mem | XRTMemory instance to upload. |
size | Size in bytes of data being uploaded in the memory device by making use of the buffer. |
offset | Offset in bytes where the device pointer should start |
exetype | The execution type to use for the upload, this is either sync (synchronous) or async (asynchronous) execution. |
Implements cynq::IDataMover.