sharc-lab / LightningSim

A fast, accurate trace-based simulator for High-Level Synthesis.
https://arxiv.org/abs/2304.11219
GNU Affero General Public License v3.0
38 stars 2 forks source link

Issue with linking Vitis HLS libraries against new versions of Vitis HLS #2

Open stefanpie opened 1 year ago

stefanpie commented 1 year ago

When running LightningSim using a newer version of Vitis HLS, there is a linking error. I think it has to do with the internal Vitis HLS libraries being renamed due to their version update. See the included error for more details. Should be a simple fix to dynamically get the libraries to link from the Vitis HLS install based on the Vitis HLS version (either gathered at runtime or hardcoded).

Traceback (most recent call last):
  File "/usr/scratch/skaram7/miniconda/envs/lsim/lib/python3.10/site-packages/lightningsim/runner.py", line 552, in run
    link_testbench.check_returncode()
  File "/usr/scratch/skaram7/miniconda/envs/lsim/lib/python3.10/site-packages/lightningsim/runner.py", line 124, in check_returncode
    raise RuntimeError(message)
RuntimeError: command /usr/scratch/skaram7/miniconda/envs/lsim/bin/x86_64-conda-linux-gnu-c++ -L /tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/systemc/lib -L /tools/software/xilinx/Vitis_HLS/2023.1/lnx64/lib/csim -L /tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fpo_v7_0 -L /tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fft_v9_1 -L /tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fir_v7_0 -L /tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/dds_v6_0 -L /usr/scratch/skaram7/miniconda/envs/lsim/share/lightningsim/templates -L /usr/scratch/skaram7/miniconda/envs/lsim/lib -Xlinker -rpath=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/lib/csim -Xlinker -rpath=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fpo_v7_0 -Xlinker -rpath=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fft_v9_1 -Xlinker -rpath=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fir_v7_0 -Xlinker -rpath=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/dds_v6_0 -Xlinker -rpath=/usr/scratch/skaram7/miniconda/envs/lsim/lib -Xlinker -rpath-link=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/lib/csim -Xlinker -rpath-link=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fpo_v7_0 -Xlinker -rpath-link=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fft_v9_1 -Xlinker -rpath-link=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/fir_v7_0 -Xlinker -rpath-link=/tools/software/xilinx/Vitis_HLS/2023.1/lnx64/tools/dds_v6_0 /tmp/tmp1gl4j2ix/model_tb.o /tmp/tmp1gl4j2ix/model.o /tmp/tmp1gl4j2ix/a.o.3.o /tmp/tmp1gl4j2ix/mapper_fpga_base_gcn_qm9_top.o -lsystemc -lhlsmc++-GCC46 -lhlsm-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 -llightningsimrt -pthread -g -O3 -flto -o /tmp/tmpj0huv8ab/testbench_fpga_base_gcn_qm9_top returned non-zero exit status 1 with output:
> /export/hdd/scratch/skaram7/miniconda/envs/lsim/bin/../lib/gcc/x86_64-conda-linux-gnu/13.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lsystemc: No such file or directory
> /export/hdd/scratch/skaram7/miniconda/envs/lsim/bin/../lib/gcc/x86_64-conda-linux-gnu/13.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lIp_floating_point_v7_0_bitacc_cmodel: No such file or directory
> collect2: error: ld returned 1 exit status