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.2.1. Creating the board_env.xml File

The board_env.xml file describes your Custom Platform to the SDK.
Together with the other contents of the Custom Platform, the board_env.xml file sets up the board installation that enables the offline compiler to target a specific accelerator board.

A board_env.xml template is available in the /board_package directory of the Custom Platform Toolkit.

  1. Create a board_env top-level XML element. Within board_env, include the following XML elements:
    • hardware
    • platform

      Include a platform element for each operating system that your Custom Platform supports.

  2. Within each platform element, include the following XML elements:
    • mmdlib
    • linkflags
    • linklibs
    • utilbindir
  3. Parameterize each element and corresponding attribute(s) with information specific to your Custom Platform, as outline in the table below:
    Table 2.  Specifications of XML Elements and Attributes in the board_env.xml File
    Element Attribute Description
    board_env version: The SDK's Custom Platform Toolkit release you use to create your Custom Platform.
    Attention: The Custom Platform version must match the SDK version you use to develop the Custom Platform.

    name: Name of the board installation directory containing your Custom Platform.

    hardware dir: Name of the subdirectory, within the board installation directory, that contains the board variants.

    default: The default board variant that the offline compiler targets when the SDK user does not specify an explicit argument for the --board <board_name> offline compiler option.

    platform name: Name of the operating system.

    Refer to the Intel® FPGA SDK for OpenCL™ Pro Edition Getting Started Guide and the Intel® FPGA RTE for OpenCL Pro Edition Getting Started Guide for more information.

    mmdlib A string that specifies the path to the MMD library of your Custom Platform.

    To load multiple libraries, specify them in an ordered, comma-separated list. The host application loads the libraries in the order that they appear in the list.

    Tip: You can use %b to reference your board installation directory.
    linkflags A string that specifies the linker flags necessary for linking with the MMD layer available with the board.
    Tip: You can use %a to reference the SDK installation directory and %b to reference your board installation directory.
    linklibs A string that specifies the libraries the SDK must link against to use the MMD layer available with the board.
    utilbindir Directory in which the SDK expects to locate its utility executables (that is, install, uninstall, program, diagnose, and flash).
    Tip: You can use %a to reference the SDK installation directory and %b to reference your board installation directory.
Your board_env.xml file should resemble the following example:
<?xml version="1.0"?>
<board_env version="<SDK_version>" name="<Custom_Platform_name>">
  <hardware dir="hardware" default="<board_name>"></hardware>
  <platform name="linux64">
    <mmdlib>%b/linux64/lib/libaltera_<Custom_Platform_name>_mmd.so</mmdlib>
    <linkflags>-L%b/linux64/lib</linkflags>
    <linklibs>-laltera_<Custom_Platform_name>_mmd</linklibs>
    <utilbindir>%b/linux64/libexec</utilbindir>
  </platform>

  <platform name="windows64">
    <mmdlib>%b/windows64/bin/altera_<Custom_Platform_name>_mmd.dll</mmdlib>
    <linkflags>/libpath:%b/windows64/lib</linkflags>
    <linklibs>altera_<Custom_Platform_name>_mmd.lib</linklibs>
    <utilbindir>%b/windows64/libexec</utilbindir>
  </platform>
</board_env>

Where:

  • <SDK_version> is the Intel® FPGA SDK for OpenCL™ Pro Edition version.
  • <Custom_Platform_name> is the name of your Custom Platform (for example, a10_ref).
  • <board_name> is the name of the FPGA board.