Interface for standardising the API of DataMover for a specific device: XRTDataMover.
More...
#include <datamover.hpp>
|
virtual | ~IDataMover ()=default |
| ~IDataMover destructor method Destroy the IDataMover object.
|
|
virtual std::shared_ptr< IMemory > | GetBuffer (const size_t size, const int memory_bank=0, const MemoryType type=MemoryType::Dual)=0 |
| 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...
|
|
virtual Status | Upload (const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype)=0 |
| 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...
|
|
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 (const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype)=0 |
| Download method. 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 (const SyncType type)=0 |
| Sync method Synchronizes data movements in case of asynchronous Upload/Download. 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...
|
|
virtual DeviceStatus | GetStatus ()=0 |
| GetStatus method Returns the status of the data mover in terms of transactions. More...
|
|
Interface for standardising the API of DataMover for a specific device: XRTDataMover.
◆ Type
Type Type of runtime supported by the IDataMover.
Enumerator |
---|
None | No runtime
|
DMA | DMA-based runtime
|
XRT | XRT-based runtime
|
◆ Create()
Create method Factory method used for creating specific subclasses of IDataMover.
- Parameters
-
impl | Used for establishin if the object is dependent on a runtime, use None if this is not the case. |
addr | A 64 bit unsigned integer representing the beginning address of the IDataMover. |
hwparams | Hardware-specific parameters to configure the data mover and grab the correct memory blocks |
- Returns
- std::shared_ptr<IDataMover> This is a shared_ptr with reference counting, the type will depend on the value of impl, the options are the following: following: XRT -> XRTDatamover None -> nullptr
◆ Download() [1/2]
virtual Status cynq::IDataMover::Download |
( |
const std::shared_ptr< IMemory > |
mem, |
|
|
const size_t |
size, |
|
|
const size_t |
offset, |
|
|
const ExecutionType |
exetype |
|
) |
| |
|
pure virtual |
Download method.
- Parameters
-
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. |
- Returns
- Status
Implemented in cynq::XRTDataMover, and cynq::DMADataMover.
◆ Download() [2/2]
Status cynq::IDataMover::Download |
( |
std::shared_ptr< IExecutionGraph > |
graph, |
|
|
const std::shared_ptr< IMemory > |
mem, |
|
|
const size_t |
size, |
|
|
const size_t |
offset, |
|
|
const ExecutionType |
exetype |
|
) |
| |
|
virtual |
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.
- Parameters
-
graph | Execution graph to execute on. If nullptr is passed, the execution will be synchronous. |
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. In case of async execution type, a Sync call must be performed afterwards to get coherent results. |
- Returns
- Status
◆ GetBuffer()
virtual std::shared_ptr<IMemory> cynq::IDataMover::GetBuffer |
( |
const size_t |
size, |
|
|
const int |
memory_bank = 0 , |
|
|
const MemoryType |
type = MemoryType::Dual |
|
) |
| |
|
pure virtual |
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).
- Parameters
-
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 | Memory bank corresponding to the memory to be allocated. It is used for XRT-based data allocators. |
- Returns
- std::shared_ptr<IMemory>
Implemented in cynq::XRTDataMover, and cynq::DMADataMover.
◆ GetStatus()
virtual DeviceStatus cynq::IDataMover::GetStatus |
( |
| ) |
|
|
pure virtual |
◆ Sync() [1/2]
virtual Status cynq::IDataMover::Sync |
( |
const SyncType |
type | ) |
|
|
pure virtual |
Sync method Synchronizes data movements in case of asynchronous Upload/Download.
- Parameters
-
type | sync type. Depending on the transaction, it will trigger sync |
- Returns
- Status
Implemented in cynq::XRTDataMover, and cynq::DMADataMover.
◆ Sync() [2/2]
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.
- Parameters
-
graph | Execution graph to execute on. If nullptr is passed, the execution will be synchronous. |
type | sync type. Depending on the transaction, it will trigger sync |
- Returns
- Status
◆ Upload() [1/2]
virtual Status cynq::IDataMover::Upload |
( |
const std::shared_ptr< IMemory > |
mem, |
|
|
const size_t |
size, |
|
|
const size_t |
offset, |
|
|
const ExecutionType |
exetype |
|
) |
| |
|
pure virtual |
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.
- Parameters
-
mem | IMemory 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. |
- Returns
- Status
Implemented in cynq::XRTDataMover, and cynq::DMADataMover.
◆ Upload() [2/2]
Status cynq::IDataMover::Upload |
( |
std::shared_ptr< IExecutionGraph > |
graph, |
|
|
const std::shared_ptr< IMemory > |
mem, |
|
|
const size_t |
size, |
|
|
const size_t |
offset, |
|
|
const ExecutionType |
exetype |
|
) |
| |
|
virtual |
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.
- Parameters
-
graph | Execution graph to execute on. If nullptr is passed, the execution will be synchronous. |
mem | IMemory 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. In case of async execution type, a Sync call must be performed afterwards to get coherent results. |
- Returns
- Status
The documentation for this class was generated from the following files:
- /mnt/usbkey/lleon/cynq/include/cynq/datamover.hpp
- /mnt/usbkey/lleon/cynq/src/cynq/datamover.cpp