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

ID 683085
Date 3/28/2022
Public
Document Table of Contents

1.4.3. Creating the MMD Library

Your Custom Platform requires an MMD layer necessary for communication with the accelerator board.

You must implement a file I/O-like software interface such as open, read, write, and close to communicate with the accelerator board over any medium. The result of your implementation is a set of linker arguments that allows an OpenCL™ host application to link against the MMD layer of the target board. A dynamic link library (DLL) that fully implements the MMD layer is also necessary for the communication.

Figure 2.  Intel® FPGA SDK for OpenCL™ Software ArchitectureThis figure depicts the four layers of the Intel® FPGA SDK for OpenCL™ Pro Edition software architecture: runtime, hardware abstraction layer (HAL), MMD layer, and kernel mode driver.

The following tasks outline the procedure for creating an MMD library for use with PCI Express® (PCIe®).

  1. Name a new library file that implements the MMD layer in the following manner:
    <board_vendor_name>_<board_family_name>[_<unique_string>]_mmd.<a|so|lib|dll>
    Where:
    • <board_vendor_name> is the entity responsible for the accelerator board.
    • <board_family_name> is the board family name that the library supports.
    • <unique_string> is a designation that you create. Intel® recommends that you include information such as revision and interface type.
    • <a|so|lib|dll> is the file extension. It can be an archive file (.a), a shared object file (.so), a library file (.lib), or a dynamic link library file (.dll).

    Example library file name: altera_svdevkit_pcierev1_mmd.so

  2. Include the aocl_mmd.h header file (refer to source/include directory in one of the reference platform BSPs available at the FPGA Software Download Center) in the operating system-specific implementation of the MMD layer.
    The aocl_mmd.h file and the MMD API Descriptions reference section contain full details on the MMD application programming interface (API) descriptions, their arguments, and their return values.
  3. Implement the MMD layer for your Custom Platform, and compile it into a C/C++ library.
    Example source codes of a functional MMD library are available in the <path_to_a10_ref>/source/host/mmd directory of the Intel® Arria® 10 GX FPGA Development Kit Reference Platform. In particular, the acl_pcie.cpp file implements the API functions defined in the aocl_mmd.h file.
    If the SDK users need to load a particular library at runtime, deliver the library in a directory that the operating system can locate. Instruct the SDK users to add the library path to the LD_LIBRARY_PATH (for Linux) or PATH (for Windows) environment variable at runtime.
  4. Modify the mmdlib and linkflags elements in the board_env.xml file by specifying the library flags necessary for linking with the MMD layer.