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

ID 683398
Date 5/04/2018
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

1.4.2.2. Creating the board_spec.xml File

The board_spec.xml XML file contains metadata necessary to describe your hardware system to the Intel® FPGA SDK for OpenCL™ Standard Edition.
For detailed descriptions on the type of information you must include in the board_spec.xml file, refer to the XML Elements, Attributes, and Parameters in the board_spec.xml File section. A board_spec.xml template is available in the INTELFPGAOCLSDKROOT/board/custom_platform_toolkit/board_package/hardware/template directory of the Custom Platform Toolkit.
  1. Structure the board_spec.xml file to include the following XML elements and attributes:
    Table 3.  XML Elements and Attributes Specified in the board_spec.xml File
    Element Attribute
    board version, name
    device device_model, used_resources
    global_mem name, max_bandwidth, interleaved_bytes, config_addr, [default], interface
    host kernel_config
    [channels] interface
    interfaces interface, kernel_clk_reset
    compile project, revision, qsys_file, generic_kernel, generate_cmd, synthesize_cmd, auto_migrate

  2. For the board element, specify the board version and the name of the accelerator board. The name of the board must match the name of the directory in which the board_spec.xml file resides.
    Important: The board version must match the SDK version you use to develop the Custom Platform.
    Attention: The board name must contain a combination of only letters, numbers, underscores (_), hyphens (-), or periods (.) (for example: s5_net).
  3. For the device element, perform the following steps to specify the name of the device model file.
    1. Navigate to the INTELFPGAOCLSDKROOT/share/models/dm directory, where INTELFPGAOCLSDKROOT points to the path to the SDK installation. The directory contains a list of device models files that describe available FPGA resources on accelerator boards.
    2. If your device is listed in the dm directory, specify the device_model attribute with the name of the device model file. Proceed to Step 4.
      For example, device_model="5sgsed8k2f40c2_dm.xml"
    3. If your device is not listed in the dm directory, or if your board uses an FPGA that does not have a device model, create a new device model by performing the tasks described in Steps d to g:
    4. Copy a device model from the INTELFPGAOCLSDKROOT/share/models/dm directory (for example, 5sgxma7h2fe35c2_dm.xml).
    5. Place your copy of the device model in the Custom Platform subdirectory in which your board_spec.xml file resides.
    6. Rename the file, and modify the values to describe the part your board uses.
      Important:

      The file name must conform to the format <part_number>_dm.xml, where <part_number> is the official Intel® FPGA device part number (for example, 5sgxma7h2fe35c2).

      You can search for the Intel® FPGA device part number on the Buy page of the Intel® FPGA website.

    7. In the board_spec.xml file, update the device_model attribute of the device element with the name of your file.
  4. For the device element, specify the parameters in the used_resources attribute to describe the FPGA resources that the board design consumes in the absence of any OpenCL kernel.
    If your design includes a defined partition around all the board logic, you can extract the data from the Partition Statistics section of the Fitter report.
  5. For each global memory type, specify the following information:
    1. Name of the memory type.
    2. The combined maximum global memory bandwidth.
      You can calculate this bandwidth value from datasheets of your memories.
    3. The size of the data that the Intel® FPGA SDK for OpenCL™ Offline Compiler interleaves across memory banks.
      Note: interleaved_bytes = burst_size x width_bytes
    4. If you have a homogeneous memory system, proceed to Step e. If you have a heterogeneous memory system, for each global memory type, specify the config_addr attribute with the base address of the ACL Mem Organization Control Platform Designer (Standard) component (mem_org_mode).
    5. If you choose to set a global memory type as default, assign a value of 1 to the optional default attribute.
      If you do not include this attribute, the first memory defined in the board_spec.xml file becomes the default memory.
    6. Specify the parameters in the interface attribute to describe the characteristics of each memory interface.
  6. For the host element, specify the parameters in the kernel_config attribute to describe the offset at which the kernel resides. Determine the start of the offset from the perspective of the kernel_cra master in the OpenCL Kernel Interface Platform Designer (Standard) component.
  7. If your board provides channels for direct OpenCL kernel-to-I/O accesses, include the channels element for all channel interfaces. Specify the parameters in the interface attribute to describe the characteristics of each channel interface.
  8. Include the interfaces element to describe the kernel interfaces connecting to and controlling OpenCL kernels. Include one of each interface types (that is master, irq, and streamsource).
    1. Specify the parameters in the interface attribute to describe the characteristics of each kernel interface.
      For the streamsource interface type, also specify the clock attribute with the name of the clock the snoop stream uses. Usually, this clock is the kernel clock.
      Important: Update the width of the snoop interface (acl_internal_snoop) specified with the streamsource kernel interface. Updating the width ensures that the global_mem interface entries in board_spec.xml match the characteristics of the bank<N> Avalon® Memory-Mapped (Avalon-MM) masters from corresponding OpenCL Memory Bank Divider component for the default memory.
    2. Specify the parameters in the kernel_clk_reset attribute to include the exported kernel clock and reset interfaces as kernel interfaces.
  9. Include the compile element and specify its attributes to control the Intel® Quartus® Prime compilation, registration, and automigration.
Below is the XML code of an example board_spec.xml file:
<?xml version="1.0"?>
<board version="<SDK_version>" name="<board_name>">

  <compile name="top" project="top" revision="top" qsys_file="none" generic_kernel="1">
    <generate cmd="quartus_sh -t scripts/pre_flow_pr.tcl"/>
    <synthesize cmd="quartus_cdb -t import_compile.tcl"/>
    <auto_migrate platform_type="<customplatform_name>" >
      <include fixes=""/>
      <exclude fixes=""/>
    </auto_migrate>
  </compile>

  <compile name="base" project="top" revision="base" qsys_file="none" generic_kernel="1">
    <generate cmd="quartus_sh -t scripts/pre_flow_pr.tcl base"/>
    <synthesize cmd="quartus_sh --flow compile top -c base"/>
    <auto_migrate platform_type="<customplatform_name>" >
      <include fixes=""/>
      <exclude fixes="pre_skipbak,post_skipbak"/>
    </auto_migrate>
  </compile>

  <compile name="flat" project="top" revision="flat" qsys_file="none" generic_kernel="1">
    <generate cmd="quartus_sh -t scripts/pre_flow_pr.tcl flat"/>
    <synthesize cmd="quartus_sh --flow compile top -c flat"/>
    <auto_migrate platform_type="<customplatform_name>" >
      <include fixes=""/>
      <exclude fixes="pre_skipbak,post_skipbak"/>
    </auto_migrate>
  </compile>

  <compile name="regenerate_cache" project="top" revision="top" qsys_file="none" generic_kernel="1">
    <generate cmd="quartus_sh -t scripts/pre_flow_pr.tcl"/>
    <synthesize cmd="quartus_sh -t scripts/regenerate_cache.tcl <customplatform_name> <board_name>"/>
    <auto_migrate platform_type="<customplatform_name>" >
      <include fixes=""/>
      <exclude fixes="pre_skipbak"/>
    </auto_migrate>
  </compile>

  <device device_model="<devicemodel_filename>">
    <used_resources>
      <alms num="33400"/> <!-- Total ALMs - ALMs available to kernel_system_inst -->
      <ffs num="133600"/>
      <dsps num="0"/>
      <rams num="182"/>
    </used_resources>
  </device>

  <!-- DDR4-2400 -->
  <global_mem name="DDR" max_bandwidth="19200" interleaved_bytes="1024" config_addr="0x018">
    <interface name="board" port="kernel_mem0" type="slave" width="512" maxburst="16" address="0x00000000" size="0x80000000" latency="240" addpipe="1"/>
  </global_mem>

  <host>
    <kernel_config start="0x00000000" size="0x0100000"/>
  </host>

  <interfaces>
    <interface name="board" port="kernel_cra" type="master" width="64" misc="0"/>
    <interface name="board" port="kernel_irq" type="irq" width="1"/>
    <interface name="board" port="acl_internal_snoop" type="streamsource" enable="SNOOPENABLE" width="31" clock="board.kernel_clk"/>
    <kernel_clk_reset clk="board.kernel_clk" clk2x="board.kernel_clk2x" reset="board.kernel_reset"/>
  </interfaces>

</board>