definelicht / hlslib

A collection of extensions for Vitis and Intel FPGA OpenCL to improve developer quality of life.
BSD 3-Clause "New" or "Revised" License
304 stars 56 forks source link

Using hlslib cmake script with SDx2017.4 #8

Closed salehjg closed 5 years ago

salehjg commented 5 years ago

I am trying to migrate my SDAccel project from GUI to CMake buildsystem. While trying to figure out how to use your CMake script, I noticed something weird was happening.

I have installed SDx2017.4 and when I run cmake .., in function sdaccel_target, the if-statement that detects SDAccel versions, evaluates false so as a result, CMake script does not execute required commands to generate *.xclbin files needed for emulation or hardware targets.

if(((${SDAccel_MAJOR_VERSION} LESS 2018) AND (${SDAccel_MINOR_VERSION} LESS 3)) OR ${SDAccel_MAJOR_VERSION} LESS 2017)

The problem is with: (${SDAccel_MINOR_VERSION} LESS 3) Obviously, for 2017.4, the minor version is 4.

With all the changes in the recent releases of SDAccel, I am not sure if this is intentional and the CMake script does not support 2017.4 or I am missing something obvious.

I appreciate your quick response on this. Thanks.

definelicht commented 5 years ago

Hi @salehjg, 2017.4 was the version where the build system changed from a single phase to a two phase (compile + link) system. The script will still generate the commands necessary to build the xclbin, but it's a single command (e.g., build_foo_hardware) instead of two commands (compile_foo_hardware and link_foo_hardware). Although, I see that the commands are named a bit weirdly -- I will update this to match the Xilinx nomenclature.

salehjg commented 5 years ago

Hi, Thank you so much for your quick response even for a closed issue. I appreciate it. As you mentioned I was wrong. It does run the right commands to generate xclbin file. spcl/gmem_hls project helped me a lot to understand it.