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

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

2.2.3. global_mem

The global_mem and interface elements of the board_spec.xml file provides information on the memory interfaces that connect to the kernel.
Example XML code:
<!-- DDR3-1600 -->
<global_mem name="DDR" max_bandwidth="25600" interleaved_bytes="1024"
 config_addr="0x018">
  <interface name="board" port="kernel_mem0" type="slave" width="512" maxburst="16"
   address="0x00000000" size="0x100000000" latency="240"/>
  <interface name="board" port="kernel_mem1" type="slave" width="512" maxburst="16"
   address="0x100000000" size="0x100000000" latency="240"/>
</global_mem>

<!-- QDRII -->
  <global_mem name="QDR" max_bandwidth="17600" interleaved_bytes="8"
   config_addr="0x100">
    <interface name="board" type="slave" width="64" maxburst="1"
     address="0x200000000" size="0x1000000" latency="150" addpipe="1">
      <port name="kernel_qdr0_r" direction="r"/>
      <port name="kernel_qdr0_w" direction="w"/>
    </interface>
    <interface name="board" type="slave" width="64" maxburst="1"
     address="0x201000000" size="0x1000000" latency="150" addpipe="1">
      <port name="kernel_qdr1_r" direction="r"/>
      <port name="kernel_qdr1_w" direction="w"/>
    </interface>
    <interface name="board" type="slave" width="64" maxburst="1"
     address="0x202000000" size="0x1000000" latency="150" addpipe="1">
      <port name="kernel_qdr2_r" direction="r"/>
      <port name="kernel_qdr2_w" direction="w"/>
    </interface>
    <interface name="board" type="slave" width="64" maxburst="1"
     address="0x203000000" size="0x1000000" latency="150" addpipe="1">
      <port name="kernel_qdr3_r" direction="r"/>
      <port name="kernel_qdr3_w" direction="w"/>
    </interface>
  </global_mem>
Note: For each global memory that the kernel accesses, you must include one interface element that describes its characteristics.
Table 13.  Attributes for the global_mem Element
Attribute Description
name The name the Intel® FPGA SDK for OpenCL™ Standard Edition user uses to identify the memory type. Each name must be unique and must comprise of less than 32 characters.
max_bandwidth The maximum bandwidth, in megabytes per second (MB/s), of all global memory interfaces combined in their current configuration. The Intel® FPGA SDK for OpenCL™ Offline Compiler uses max_bandwidth to choose an architecture suitable for the application and the board.

Compute this bandwidth value from datasheets of your memories.

Example max_bandwidth calculation for a 64-bit DDR3 interface running at 800 MHz:

max_bandwidth = 800 MHz x 2 x 64 bits ÷ 8-bits = 12800 MB/s

You have the option to use block RAM instead of or in conjunction with external memory as global memory. The formula for calculating max_bandwidth for block RAM is max_bandwidth = block RAM speed x (block RAM interface size ÷ 8 bits)

Example max_bandwidth calculation for a 512-bit block RAM running at 100 MHz:

max_bandwidth = 100 MHz x 512 bits ÷ 8 bits = 6400 MB/s

interleaved_bytes

Include the interleaved_bytes attribute in the board_spec.xml file when you instantiate multiple interfaces for a given global memory system. This attribute controls the size of data that the offline compiler distributes across the interfaces.

The offline compiler currently can interleave data across banks no finer than the size of one full burst. This attribute specifies this size in bytes, which is generally computed by burst_size x width_bytes. The interleaved_bytes value must be the same for the host interface and the kernels. Therefore, the configuration of the OpenCL Memory Bank Divider must match the exported kernel slave interfaces in this respect.

For block RAM, interleaved_bytes equals the width of the interface in bytes.

config_addr The address of the ACL Mem Organization Control Platform Designer (Standard) component (mem_org_mode) that the host software uses to configure memory. You may omit this attribute if your board has homogeneous memory; the software will use the default address (0x18) for this component. If your board has heterogeneous memory, there is a mem_org_mode component in the board system for each memory type.

Enter the config_addr attribute and set it to the value of the base address of the mem_org_mode component(s).

default Include this optional attribute and assign a value of 1 to set the global memory as the default memory interface.

If you do not implement this attribute, the first memory type defined in the board_spec.xml file becomes the default memory interface.

interface See the interface section for the parameters you must specify for each interface.