Supported High-Level Synthesis Features in the AI Engine Compiler - 2020.2 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
UG1076
Release Date
2020-11-24
Version
2020.2 English

The AI Engine compiler supports a subset of high-level synthesis (HLS) interfaces.

The supported input and output data types of HLS functions are:

  • hls::stream<ap_axis<N,0,0,0>> and hls::stream<ap_axiu<N,0,0,0>>, where N can be 32, 64, or 128
  • hls::stream<ap_int<N>> and hls::stream<ap_uint<N>>, where N can be 32 or 64
  • hls::stream<T>, where T can be int, unsigned int, long long, unsigned long long, or float
  • hls::stream<std::complex<T>>, where T can be int, short or float

The following scalar run-time parameter (RTP) data types are also supported:

  • ap_int<N> and ap_uint<N>, where N can be 8, 16, 32, or 64
  • short, unsigned short, int, unsigned int, long long, unsigned long long, and float
  • std::complex<T>, where T can be int, short, or float

The following array RTP data types are supported:

  • Arrays of ap_int<N> and ap_uint<N>, where N can be 8, 16, 32, or 64
  • Arrays of short, unsigned short, int, unsigned int, long long, unsigned long long, or float
  • Arrays of std::complex<T>, where T can be int, short, or float
Note: For PL kernels, ap_memory and s_axilite interfaces are required to support array RTPs. Synchronous array RTPs are not supported for PL kernels. Asynchronous array RTPs are supported for PL kernels in bare-metal systems.

When ap_int<N> and ap_uint<N> are used as RTPs, the PS program can use adf::graph::update and adf::graph::read with compatible data types to access RTPs. For example, use adf::graph::update(input_port& rtpPort, int32 value) to update the ap_int<32> run-time parameter. For more information on the use of RTPs, see Run-Time Graph Control API.

The only supported HLS function return type is void.

graph::update for an HLS scalar RTP greater than 32 bits should be called before graph::run.

To support the HLS math library inside the kernel, an additional linker option is needed for the AI Engine compiler:

--Xpslinker="-lhlsmc++-GCC46
-lIp_floating_point_v7_0_bitacc_cmodel 
-lIp_xfft_v9_1_bitacc_cmodel 
-lIp_fir_compiler_v7_2_bitacc_cmodel 
-lIp_dds_compiler_v6_0_bitacc_cmodel 
-L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 
-L$(XILINX_HLS)/lnx64/lib/csim 
-L$(XILINX_HLS)/lnx64/tools/dds_v6_0 
-L$(XILINX_HLS)/lnx64/tools/fir_v7_0 
-L$(XILINX_HLS)/lnx64/tools/fft_v9_1 
-Wl,-rpath,$(XILINX_HLS)/lnx64/lib/csim 
-Wl,-rpath,$(XILINX_HLS)/lnx64/tools/fpo_v7_0 
-Wl,-rpath,$(XILINX_HLS)/lnx64/tools/fft_v9_1 
-Wl,-rpath,$(XILINX_HLS)/lnx64/tools/fir_v7_0 
-Wl,-rpath,$(XILINX_HLS)/lnx64/tools/dds_v6_0"