Xilinx / Vitis-HLS-Introductory-Examples

Other
600 stars 158 forks source link

Csim for manual_burst_inference_success example fails with link error #11

Closed louiev-xlnx closed 1 year ago

louiev-xlnx commented 2 years ago

https://github.com/Xilinx/Vitis-HLS-Introductory-Examples/tree/master/Interface/Memory/manual_burst/manual_burst_example/manual_burst_inference_success/

CSim with Vitis HLS 2022.1 on Windows10 fails with:

INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
   Compiling ../../../example_tb.cpp in debug mode
   Compiling ../../../example.cpp in debug mode
   Generating csim.exe
Makefile.rules:392: recipe for target 'csim.exe' failed
In file included from C:/Xilinx/Vitis_HLS/2022.1/include/floating_point_v7_0_bitacc_cmodel.h:144:0,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_fpo.h:189,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half_fpo.h:64,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half.h:71,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/etc/ap_private.h:98,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_common.h:710,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_int.h:56,
                 from ../../../example.h:1,
                 from ../../../example_tb.cpp:1:
C:/Xilinx/Vitis_HLS/2022.1/include/gmp.h:63:0: warning: "__GMP_LIBGMP_DLL" redefined
 #define __GMP_LIBGMP_DLL  0

In file included from C:/Xilinx/Vitis_HLS/2022.1/include/hls_fpo.h:189:0,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half_fpo.h:64,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half.h:71,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/etc/ap_private.h:98,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_common.h:710,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_int.h:56,
                 from ../../../example.h:1,
                 from ../../../example_tb.cpp:1:
C:/Xilinx/Vitis_HLS/2022.1/include/floating_point_v7_0_bitacc_cmodel.h:136:0: note: this is the location of the previous definition
 #define __GMP_LIBGMP_DLL 1

In file included from C:/Xilinx/Vitis_HLS/2022.1/include/floating_point_v7_0_bitacc_cmodel.h:144:0,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_fpo.h:189,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half_fpo.h:64,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half.h:71,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/etc/ap_private.h:98,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_common.h:710,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_int.h:56,
                 from ../../../example.h:1,
                 from ../../../example.cpp:1:
C:/Xilinx/Vitis_HLS/2022.1/include/gmp.h:63:0: warning: "__GMP_LIBGMP_DLL" redefined
 #define __GMP_LIBGMP_DLL  0

In file included from C:/Xilinx/Vitis_HLS/2022.1/include/hls_fpo.h:189:0,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half_fpo.h:64,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/hls_half.h:71,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/etc/ap_private.h:98,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_common.h:710,
                 from C:/Xilinx/Vitis_HLS/2022.1/include/ap_int.h:56,
                 from ../../../example.h:1,
                 from ../../../example.cpp:1:
C:/Xilinx/Vitis_HLS/2022.1/include/floating_point_v7_0_bitacc_cmodel.h:136:0: note: this is the location of the previous definition
 #define __GMP_LIBGMP_DLL 1

obj/example.o:example.cpp:(.bss+0x0): multiple definition of `.weak._ZN3hls27MAXIPointer2AccessRecordMapE._ZnwyPv'
obj/example_tb.o:example_tb.cpp:(.bss+0x0): first defined here
obj/example.o: In function `std::_Tuple_impl<0ull, void*&&>::_Tuple_impl<void*>(void*&&)':
C:/Xilinx/Vitis_HLS/2022.1/tps/win64/msys64/mingw64/include/c++/6.2.0/bits/stl_tree.h:1912: multiple definition of `.weak._ZGVN3hls27MAXIPointer2AccessRecordMapE._ZnwyPv'
obj/example_tb.o:C:\Users\username\AppData\Roaming\Xilinx\Vitis\manualburst\solution1\csim\build/../../../example_tb.cpp:9: first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [csim.exe] Error 1
ERR: [SIM 100] 'csim_design' failed: compilation error(s).
INFO: [SIM 3] *************** CSIM finish ***************

Also see https://support.xilinx.com/s/question/0D54U00005ZO4WuSAL/c-simulation-error-for-vitis-hls?language=en_US.

This works in Linux (specifically Ubuntu 20.04). ...

ramanan-radhakrishnan commented 2 years ago

Hi Louie,

This issue has been fixed. Will merge the fix during the next update.

liubenyuan commented 1 year ago

I am using vivado 2022.2 and faced the same issue, how could I fix it or could I fix it using any patch?

INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
   Compiling ../../../../../hls/tjott_tb.cpp in debug mode
   Compiling ../../../../../hls/tjott.cpp in debug mode
   Generating csim.exe
Makefile.rules:322: recipe for target 'csim.exe' failed
In file included from D:/xilinx/Vitis_HLS/2022.2/include/floating_point_v7_1_bitacc_cmodel.h:149:0,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_fpo.h:143,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half_fpo.h:18,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half.h:25,
                 from D:/xilinx/Vitis_HLS/2022.2/include/etc/ap_private.h:52,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_common.h:666,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_int.h:10,
                 from ../../../../../hls/tjott.hpp:7,
                 from ../../../../../hls/tjott_tb.cpp:5:
D:/xilinx/Vitis_HLS/2022.2/include/gmp.h:58:0: warning: "__GMP_LIBGMP_DLL" redefined
 #define __GMP_LIBGMP_DLL  0

In file included from D:/xilinx/Vitis_HLS/2022.2/include/hls_fpo.h:143:0,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half_fpo.h:18,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half.h:25,
                 from D:/xilinx/Vitis_HLS/2022.2/include/etc/ap_private.h:52,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_common.h:666,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_int.h:10,
                 from ../../../../../hls/tjott.hpp:7,
                 from ../../../../../hls/tjott_tb.cpp:5:
D:/xilinx/Vitis_HLS/2022.2/include/floating_point_v7_1_bitacc_cmodel.h:141:0: note: this is the location of the previous definition
 #define __GMP_LIBGMP_DLL 1

In file included from ../../../../../hls/tjott_tb.cpp:5:0:
../../../../../hls/tjott.hpp:161:63: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> cexpf_phi[PF_TOTAL] __attribute__((no_ctor));
                                                               ^
../../../../../hls/tjott.hpp:165:65: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> complex_amp[PF_TOTAL] __attribute__((no_ctor));
                                                                 ^
../../../../../hls/tjott_tb.cpp: In function 'int main()':
../../../../../hls/tjott_tb.cpp:52:49: warning: narrowing conversion of 'rand()' from 'int' to 'float' inside { } [-Wnarrowing]
             payload_y = std::complex<float>{rand(), rand()};
                                             ~~~~^~
../../../../../hls/tjott_tb.cpp:52:57: warning: narrowing conversion of 'rand()' from 'int' to 'float' inside { } [-Wnarrowing]
             payload_y = std::complex<float>{rand(), rand()};
                                                     ~~~~^~
../../../../../hls/tjott_tb.cpp:53:49: warning: narrowing conversion of 'rand()' from 'int' to 'float' inside { } [-Wnarrowing]
             payload_z = std::complex<float>{rand(), rand()};
                                             ~~~~^~
../../../../../hls/tjott_tb.cpp:53:57: warning: narrowing conversion of 'rand()' from 'int' to 'float' inside { } [-Wnarrowing]
             payload_z = std::complex<float>{rand(), rand()};
                                                     ~~~~^~
In file included from D:/xilinx/Vitis_HLS/2022.2/include/floating_point_v7_1_bitacc_cmodel.h:149:0,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_fpo.h:143,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half_fpo.h:18,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half.h:25,
                 from D:/xilinx/Vitis_HLS/2022.2/include/etc/ap_private.h:52,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_common.h:666,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_int.h:10,
                 from ../../../../../hls/tjott.hpp:7,
                 from ../../../../../hls/tjott.cpp:1:
D:/xilinx/Vitis_HLS/2022.2/include/gmp.h:58:0: warning: "__GMP_LIBGMP_DLL" redefined
 #define __GMP_LIBGMP_DLL  0

In file included from D:/xilinx/Vitis_HLS/2022.2/include/hls_fpo.h:143:0,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half_fpo.h:18,
                 from D:/xilinx/Vitis_HLS/2022.2/include/hls_half.h:25,
                 from D:/xilinx/Vitis_HLS/2022.2/include/etc/ap_private.h:52,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_common.h:666,
                 from D:/xilinx/Vitis_HLS/2022.2/include/ap_int.h:10,
                 from ../../../../../hls/tjott.hpp:7,
                 from ../../../../../hls/tjott.cpp:1:
D:/xilinx/Vitis_HLS/2022.2/include/floating_point_v7_1_bitacc_cmodel.h:141:0: note: this is the location of the previous definition
 #define __GMP_LIBGMP_DLL 1

In file included from ../../../../../hls/tjott.cpp:1:0:
../../../../../hls/tjott.hpp:161:63: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> cexpf_phi[PF_TOTAL] __attribute__((no_ctor));
                                                               ^
../../../../../hls/tjott.hpp:165:65: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> complex_amp[PF_TOTAL] __attribute__((no_ctor));
                                                                 ^
../../../../../hls/tjott.cpp: In function 'std::complex<float> cexpf_hls(float)':
../../../../../hls/tjott.cpp:55:45: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> z __attribute__((no_ctor)) = {cosf(phi), sinf(phi)};
                                             ^
../../../../../hls/tjott.cpp: In function 'std::complex<float> polarf_hls(float, float)':
../../../../../hls/tjott.cpp:68:45: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> z __attribute__((no_ctor)) = {mag * cosf(phi), mag * sinf(phi)};
                                             ^
../../../../../hls/tjott.cpp: In function 'std::complex<float> polarf_complex(float, std::complex<float>)':
../../../../../hls/tjott.cpp:80:47: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> ret __attribute__((no_ctor)) = {mag * z.real() / z_abs,
                                               ^
../../../../../hls/tjott.cpp: In function 'void cfft(data_t&, data_t&)':
../../../../../hls/tjott.cpp:222:57: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> xn[NFFT] __attribute__((no_ctor));
                                                         ^
../../../../../hls/tjott.cpp:223:57: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> xk[NFFT] __attribute__((no_ctor));
                                                         ^
../../../../../hls/tjott.cpp: In member function 'void tjott::bvt(data_t&, data_t&)':
../../../../../hls/tjott.cpp:296:52: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> xn[NFFT] __attribute__((no_ctor));
                                                    ^
../../../../../hls/tjott.cpp:298:52: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> xk[NFFT] __attribute__((no_ctor));
                                                    ^
../../../../../hls/tjott.cpp:320:46: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> zz __attribute__((no_ctor));
                                              ^
../../../../../hls/tjott.cpp: In member function 'void tjott::particle_update(data_t&)':
../../../../../hls/tjott.cpp:343:62: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> complex_amp_i __attribute__((no_ctor));
                                                              ^
../../../../../hls/tjott.cpp:344:51: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> zz __attribute__((no_ctor));
                                                   ^
../../../../../hls/tjott.cpp:345:51: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> ss __attribute__((no_ctor));
                                                   ^
../../../../../hls/tjott.cpp: In member function 'void tjott::sextBRS_sf(data_t&, data_t&, XHAT&)':
../../../../../hls/tjott.cpp:405:62: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> complex_amp_i __attribute__((no_ctor));
                                                              ^
../../../../../hls/tjott.cpp:406:54: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> ctemp __attribute__((no_ctor));
                                                      ^
../../../../../hls/tjott.cpp:407:64: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     std::complex<float> complex_amp_sum __attribute__((no_ctor)) = {0.0, 0.0};
                                                                ^
../../../../../hls/tjott.cpp:456:47: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> ejk __attribute__((no_ctor));
                                               ^
../../../../../hls/tjott.cpp:457:57: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> complex_amp_y __attribute__((no_ctor)) = {0.0, 0.0};
                                                         ^
../../../../../hls/tjott.cpp:458:57: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> complex_amp_z __attribute__((no_ctor)) = {0.0, 0.0};
                                                         ^
../../../../../hls/tjott.cpp: In member function 'void tjott::cAmpMeasure_sf(data_t&, data_t&, XHAT&)':
../../../../../hls/tjott.cpp:486:57: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> complex_amp_y __attribute__((no_ctor)) = {0.0, 0.0};
                                                         ^
../../../../../hls/tjott.cpp:487:57: warning: 'no_ctor' attribute directive ignored [-Wattributes]
     complex<float> complex_amp_z __attribute__((no_ctor)) = {0.0, 0.0};
                                                         ^
d000012.o:(.idata$5+0x0): multiple definition of `__imp__ZN14cordic_apfixed21circ_table_arctan_128E'
d000006.o:(.idata$5+0x0): first defined here
d000012.o:(.idata$6+0x0): multiple definition of `__nm__ZN14cordic_apfixed21circ_table_arctan_128E'
d000006.o:(.idata$6+0x0): first defined here
d000013.o:(.idata$5+0x0): multiple definition of `__imp__ZN18log_apfixed_reduce13log_lut_tableI8ap_fixedILi29ELi7EL9ap_q_mode5EL9ap_o_mode3ELi0EELi4ELi4ELi16EE5arrayE'
d000007.o:(.idata$5+0x0): first defined here
d000013.o:(.idata$6+0x0): multiple definition of `__nm__ZN18log_apfixed_reduce13log_lut_tableI8ap_fixedILi29ELi7EL9ap_q_mode5EL9ap_o_mode3ELi0EELi4ELi4ELi16EE5arrayE'
d000007.o:(.idata$6+0x0): first defined here
d000014.o:(.idata$5+0x0): multiple definition of `__imp__ZN18log_apfixed_reduce14log0_lut_tableI8ap_fixedILi29ELi7EL9ap_q_mode5EL9ap_o_mode3ELi0EELi0ELi5ELi64EE5arrayE'
d000008.o:(.idata$5+0x0): first defined here
d000014.o:(.idata$6+0x0): multiple definition of `__nm__ZN18log_apfixed_reduce14log0_lut_tableI8ap_fixedILi29ELi7EL9ap_q_mode5EL9ap_o_mode3ELi0EELi0ELi5ELi64EE5arrayE'
d000008.o:(.idata$6+0x0): first defined here
d000015.o:(.idata$5+0x0): multiple definition of `__imp__ZN18log_apfixed_reduce21log_inverse_lut_table5arrayE'
d000009.o:(.idata$5+0x0): first defined here
d000015.o:(.idata$6+0x0): multiple definition of `__nm__ZN18log_apfixed_reduce21log_inverse_lut_table5arrayE'
d000009.o:(.idata$6+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [csim.exe] Error 1
ERR: [SIM 100] 'csim_design' failed: compilation error(s).
INFO: [SIM 3] *************** CSIM finish ***************
ramanan-radhakrishnan commented 1 year ago

This issue should be fixed in the 2023.2 release. Confirmed that the test runs on both Linux and Windows platforms.