Intel® FPGA SDK for OpenCL™ Standard Edition: Custom Platform Toolkit User Guide

ID 683398
Date 9/24/2018
Public
Document Table of Contents

2.3.5. aocl_mmd_read

The aocl_mmd_read function is the read operation on a single interface.

Syntax

int aocl_mmd_read( int handle,
                   aocl_mmd_op_t op,
                   size_t len,
                   void* dst,
                   aocl_mmd_interface_t interface,
                   size_t offset );

Function Arguments

  1. handle—A positive int value representing the handle to the board obtained from the aocl_mmd_open() call.

  2. op—The operation object of type aocl_mmd_op_t used to track the progress of the operation. If op is NULL, the call must block, and return only after the operation completes.
    Note:

    aocl_mmd_op_t is defined as follows:

    typedef void* aocl_mmd_op_t;

  3. len—The size of the data, in bytes, that the function transfers. Declare len with type size_t.

  4. dst—The host buffer, of type void*, to which data is written.

  5. interface—The handle to the interface that aocl_mmd_read is accessing. For example, to access global memory, this handle is the enum value aocl_mmd_get_info() returns when its requested_info_id argument is AOCL_MMD_MEMORY_INTERFACE. The interface argument is of type aocl_mmd_interface_t, and can take one of the following values:
    Name Description
    AOCL_MMD_KERNEL Control interface into the kernel interface
    AOCL_MMD_MEMORY Data interface to device memory
    AOCL_MMD_PLL Interface for reconfigurable PLL

  6. offset—The size_t byte offset within the interface at which the data transfer begins.

Return Value

If the read operation is successful, the return value is 0.

If the read operation fails, a negative return value indicates an error.