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

XRTMemory class Provides the api for configuring the data buffers, this class is based on the Buffer object from the xilinx runtime. More...

#include <memory.hpp>

Inheritance diagram for cynq::XRTMemory:
Collaboration diagram for cynq::XRTMemory:

Public Member Functions

 XRTMemory (const std::size_t size, uint8_t *hostptr, uint8_t *devptr, void *moverptr)
 Construct a new XRTDataMover object. More...
 
 XRTMemory ()=delete
 Default constructor. More...
 
virtual ~XRTMemory ()
 ~XRTMemory destructor method Destroy the XRTMemory object.
 
Status Sync (const SyncType type) override
 Sync method Synchronizes the memory in terms of transactions. More...
 
size_t Size () override
 Size method Gives the value for the memory size in bytes. More...
 
- Public Member Functions inherited from cynq::IMemory
virtual ~IMemory ()=default
 ~IMemory destructor method Destroy the IMemory object.
 
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...
 
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...
 

Protected Member Functions

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

Friends

class DMADataMover
 
class XRTDataMover
 

Additional Inherited Members

- Public Types inherited from cynq::IMemory
enum  Type { None = 0 , XRT }
 Type Type of runtime supported by the IMemory. More...
 
- Static Public Member Functions inherited from cynq::IMemory
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...
 

Detailed Description

XRTMemory class Provides the api for configuring the data buffers, this class is based on the Buffer object from the xilinx runtime.

Constructor & Destructor Documentation

◆ XRTMemory() [1/2]

cynq::XRTMemory::XRTMemory ( const std::size_t  size,
uint8_t *  hostptr,
uint8_t *  devptr,
void *  moverptr 
)

Construct a new XRTDataMover object.

Parameters
sizesize of the memory region in bytes
hostptrhost pointer where to store the host related memory. It can be null in case of using moverptr.
devptrhost pointer where to store the device related memory. It can be null in case of using moverptr.
moverptrdata mover specific metadata

◆ XRTMemory() [2/2]

cynq::XRTMemory::XRTMemory ( )
delete

Default constructor.

The default constructor is deleted because the Memory depends on the mover

Member Function Documentation

◆ GetDeviceAddress()

std::shared_ptr< uint8_t > cynq::XRTMemory::GetDeviceAddress ( )
overrideprotectedvirtual

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

Returns
std::shared_ptr<uint8_t>

Implements cynq::IMemory.

◆ GetHostAddress()

std::shared_ptr< uint8_t > cynq::XRTMemory::GetHostAddress ( )
overrideprotectedvirtual

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

Returns
std::shared_ptr<uint8_t>

Implements cynq::IMemory.

◆ Size()

size_t cynq::XRTMemory::Size ( )
overridevirtual

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

Returns
size_t

Implements cynq::IMemory.

◆ Sync()

Status cynq::XRTMemory::Sync ( const SyncType  type)
overridevirtual

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

Implements cynq::IMemory.

Friends And Related Function Documentation

◆ DMADataMover

friend class DMADataMover
friend

Define the friend relacionship between the mover and the memory


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