CYNQ  0.3.0
Framework to develop FPGA applications in C++ with the easiness of PYNQ
cynq::IMemory Class Referenceabstract

Interface for standardising the API of Memory devices: XRTMemory. More...

#include <memory.hpp>

Inheritance diagram for cynq::IMemory:

Public Types

enum  Type { None = 0 , XRT }
 Type Type of runtime supported by the IMemory. More...
 

Public Member Functions

virtual ~IMemory ()=default
 ~IMemory destructor method Destroy the IMemory object.
 
virtual Status Sync (const SyncType type)=0
 Sync method Synchronizes the memory in terms of transactions. More...
 
virtual Status Sync (std::shared_ptr< IExecutionGraph > graph, const SyncType type)
 Sync method (Asynchronous) This function executes asynchronously through an execution graph. Please, see IMemory::Sync for more information. More...
 
virtual size_t Size ()=0
 Size method Gives the value for the memory size in bytes. More...
 
template<typename T >
std::shared_ptr< T > HostAddress ()
 HostAddress method Getter for the address of the host. More...
 
template<typename T >
std::shared_ptr< T > DeviceAddress ()
 DeviceAddress method Getter for the address of the device. More...
 

Static Public Member Functions

static std::shared_ptr< IMemoryCreate (IMemory::Type impl, const std::size_t size, uint8_t *hostptr, uint8_t *devptr, void *moverptr)
 Create method Factory method to create specific subclasses of IMemory. More...
 

Protected Member Functions

virtual std::shared_ptr< uint8_t > GetHostAddress ()=0
 GetHostAddress method Get the Address that belongs to the host. [Reference] shared memory pointer with reference counting. More...
 
virtual std::shared_ptr< uint8_t > GetDeviceAddress ()=0
 GetDeviceAddress method Get the Address that belongs to the device. [Reference] shared memory pointer with reference counting. More...
 

Detailed Description

Interface for standardising the API of Memory devices: XRTMemory.

Member Enumeration Documentation

◆ Type

Type Type of runtime supported by the IMemory.

Enumerator
None 

No runtime

XRT 

Xilinx runtime

Member Function Documentation

◆ Create()

std::shared_ptr< IMemory > cynq::IMemory::Create ( IMemory::Type  impl,
const std::size_t  size,
uint8_t *  hostptr,
uint8_t *  devptr,
void *  moverptr 
)
static

Create method Factory method to create specific subclasses of IMemory.

Parameters
implUsed for establishin if the object is dependent on a runtime, use None if this is not the case.
sizeSize in bytes of the memory, this defines the length of the address space of the transaction being mapped.
hostptrPointer of the address that belongs to the host, used for memory mapping from the host to the device.
devptrPointer of the address that belongs to the device, used for mapping memory to the device.
moverptrPointer to platform specific properties
Returns
std::shared_ptr<IMemory> This is a shared_ptr with reference counting, the type will depend on the value of impl, the options are the following: following: XRT -> XRTMemory None -> nullptr

◆ DeviceAddress()

template<typename T >
std::shared_ptr<T> cynq::IMemory::DeviceAddress ( )
inline

DeviceAddress method Getter for the address of the device.

Template Parameters
TA type which is used for type casting within this method.
Returns
std::shared_ptr<T>

◆ GetDeviceAddress()

virtual std::shared_ptr<uint8_t> cynq::IMemory::GetDeviceAddress ( )
protectedpure virtual

GetDeviceAddress method Get the Address that belongs to the device. [Reference] shared memory pointer with reference counting.

Returns
std::shared_ptr<uint8_t>

Implemented in cynq::XRTMemory.

◆ GetHostAddress()

virtual std::shared_ptr<uint8_t> cynq::IMemory::GetHostAddress ( )
protectedpure virtual

GetHostAddress method Get the Address that belongs to the host. [Reference] shared memory pointer with reference counting.

Returns
std::shared_ptr<uint8_t>

Implemented in cynq::XRTMemory.

◆ HostAddress()

template<typename T >
std::shared_ptr<T> cynq::IMemory::HostAddress ( )
inline

HostAddress method Getter for the address of the host.

Template Parameters
TA type which is used for type casting within this method.
Returns
std::shared_ptr<T>

◆ Size()

virtual size_t cynq::IMemory::Size ( )
pure virtual

Size method Gives the value for the memory size in bytes.

Returns
size_t

Implemented in cynq::XRTMemory.

◆ Sync() [1/2]

virtual Status cynq::IMemory::Sync ( const SyncType  type)
pure virtual

Sync method Synchronizes the memory in terms of transactions.

Parameters
typeThe orientation of the Synchronizaton this can be host to host to device (HostToDevice) or device to host (DeviceToHost).
Returns
Status

Implemented in cynq::XRTMemory.

◆ Sync() [2/2]

Status cynq::IMemory::Sync ( std::shared_ptr< IExecutionGraph graph,
const SyncType  type 
)
virtual

Sync method (Asynchronous) This function executes asynchronously through an execution graph. Please, see IMemory::Sync for more information.

Parameters
graphThe execution graph to work on
typeThe orientation of the Synchronizaton this can be host to host to device (HostToDevice) or device to host (DeviceToHost).
Returns
Status

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