UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer drf777
Observer
140 Views
Registered: ‎11-16-2018

Please fix HLS linear algebra examples to work in SDSoC

The linear algebra examples in HLS work fine, but the very same C/C++ files in Vivado/2019.1/examples/design/linear_algebra do not work in SDSoC.

In particular, I cannot get cholesky_inverse to work in SDSoC.

cholesky_inverse.cpp

cholesky_inverse_tb.cpp

cholesky_inverse.h

More detail is provided in an earlier post: https://forums.xilinx.com/t5/SDSoC-Environment-and-reVISION/hls-math-h-error/m-p/881478/highlight/true#M2685

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
128 Views
Registered: ‎08-20-2018

Re: Please fix HLS linear algebra examples to work in SDSoC

Hi @drf777 

Please navigate to C/C++ build settings-> C/C++ General-> paths and symbols and check if below path is present or not.

Note: Please refer the tool version which you are using

hls_lib_path.PNG

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Observer drf777
Observer
109 Views
Registered: ‎11-16-2018

Re: Please fix HLS linear algebra examples to work in SDSoC

Apparently I do not have the full includes, or libraries (see attached screenshots).  I am using SDSoC/Vivado 2019.1

Strange since I did the full install.

What should I do to have all the pieces needed?

SDSoC_includes_pic.pngMissing 2019.1 includesSDSoC_libraries_pic.pngMIssing 2019.1 libraries

0 Kudos
Xilinx Employee
Xilinx Employee
97 Views
Registered: ‎08-20-2018

Re: Please fix HLS linear algebra examples to work in SDSoC

Hi @drf777 

There are two options in your case.

1. Refer my screenshot and add all the paths manually.

2. Create a new application project with below template and then replace the source files present inside this project with your files. (In this case all the settings will be taken care) 

 

hls_lib_fir_template.PNG

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Observer drf777
Observer
76 Views
Registered: ‎11-16-2018

Re: Please fix HLS linear algebra examples to work in SDSoC

I have tried your solution, and added the relevant paths. SDSoC Cholesky_Inverse still crashes.

First, I found the SDSoC tutorial for mmult_trace that does work on my SDSoC install, and used the same includes as that project, as shown in below screen shot:

mmult_paths.png

But that didn't work for running SDSoC on Cholesky_Inverse (source files taken directly from Vivado/2019.1/examples/linear_algebra).

Therefore, I went to Vivado HLS and ran (successfully) Cholesky_Inverse in that environment. Since it worked, I tried using its selection of libraries, as shown in below screenshot:

HLS_proj_cholesky_includes.pngHLS Cholesky_Inverse Example Problem

This run of SDSoC resulted in many errors, and I show a few below:

Test_HLS_Cholesky_Inverse_mingw64.pngSDSoC build attempt of HLS example cholesly_inverse adding mingw64 paths

As you can see, HLS relies on mingw64, whereas mmult_trace in SDSoC tutorial uses gnu/aarch32, and SDSoC does not seem to like 64-bit mingw64.

Also, note that SDSoC automatically loads the SDK/2019.1/gnu/aarch32/nt/gcc-arm paths upon build.

I think you may be correct that the proper libraries need to be in the SDSoC project path, but so far none of my attempts have worked for cholesky_inverse.

I used the Xilinx install tool for a 64-bit machine, and I have a x86-64 machine running Windows 10 (1803).

Please advise. Thanks.

0 Kudos
Xilinx Employee
Xilinx Employee
66 Views
Registered: ‎08-20-2018

Re: Please fix HLS linear algebra examples to work in SDSoC

Hi @drf777 

If you see the screenshot in my previous post, it is taking all aarch64 paths, I suggest you to select the example which I suggested and import the desired source files

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Observer drf777
Observer
55 Views
Registered: ‎11-16-2018

Re: Please fix HLS linear algebra examples to work in SDSoC

Thanks again. I now tried using your advised setting, shown in below screenshot. However, getting errors as shown in below log file. As you can see, it cannot find some members of the namespace, and some other errors.

Were you able to get any of the HLS linear_algebra examples to work in SDSoC?

Thanks again for your continued help.

HLS_proj_cholesky_includes_new.pngAdded aarch64 include libraries

(c) Copyright 2012-2019 Xilinx, Inc. All Rights Reserved.
#-----------------------------------------------------------
# Tool version : sds++ 2019.1 SW Build 2552052 on Fri May 24 14:51:15 MDT 2019
# Start time : Thu Jul 11 10:33:53 -0700 2019
# Command line : sds++ -Wall -O0 -g -I../src {-IC:\Xilinx\Vivado\2019.1\examples\design\linear_algebra\cholesky_inverse} {-IC:\Xilinx\Vivado\2019.1\include\ap_sysc} {-IC:\Xilinx\Vivado\2019.1\include\etc} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\backward} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\lib\gcc\aarch64-linux-gnu\8.2.0\include} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\lib\gcc\aarch64-linux-gnu\8.2.0\include-fixed} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\libc\usr\include} {-IC:\Xilinx\Vivado\2019.1\win64\tools\auto_cc\include} {-IC:\Xilinx\Vivado\2019.1\win64\tools\systemc\include} -c -fmessage-length=0 -MTsrc/cholesky_inverse.o -MMD -MP -MFsrc/cholesky_inverse.d -MTsrc/cholesky_inverse.o -o src/cholesky_inverse.o ../src/cholesky_inverse.cpp -sds-sys-config standalone -sds-proc standalone -sds-pf zc702
# Log file : C:/Users/David/workspace/test_HLS_cholesky_inverse/Debug/_sds/reports/sds_cholesky_inverse.log
# Journal file : C:/Users/David/workspace/test_HLS_cholesky_inverse/Debug/_sds/reports/sds_cholesky_inverse.jou
# Report file : C:/Users/David/workspace/test_HLS_cholesky_inverse/Debug/_sds/reports/sds_cholesky_inverse.rpt
#-----------------------------------------------------------

Analyzing source for RTL template usage
C:/Xilinx/SDx/2019.1/bin/rtl_template_extract C:/Users/David/workspace/test_HLS_cholesky_inverse/src/cholesky_inverse.cpp -save-query C:/Users/David/workspace/test_HLS_cholesky_inverse/Debug/_sds/.llvm/src/cholesky_inverse.rtlx -- -c -I../src {-IC:\Xilinx\Vivado\2019.1\examples\design\linear_algebra\cholesky_inverse} {-IC:\Xilinx\Vivado\2019.1\include\ap_sysc} {-IC:\Xilinx\Vivado\2019.1\include\etc} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\backward} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\lib\gcc\aarch64-linux-gnu\8.2.0\include} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\lib\gcc\aarch64-linux-gnu\8.2.0\include-fixed} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include} {-IC:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\libc\usr\include} {-IC:\Xilinx\Vivado\2019.1\win64\tools\auto_cc\include} {-IC:\Xilinx\Vivado\2019.1\win64\tools\systemc\include} -Wall -g -fmessage-length=0 -MMD -MP -D __SDSCC__
-target arm-none-eabi -mcpu=cortex-a9 -mfpu=vfpv3 -O0 -g -w -I C:/Xilinx/SDx/2019.1/target/aarch32-none/include -D HLS_NO_XIL_FPO_LIB -I C:/Xilinx/Vivado/2019.1/include -IC:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/8.2.0 -IC:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/8.2.0/arm-none-eabi -IC:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/8.2.0/backward -IC:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/8.2.0/include -IC:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/8.2.0/include-fixed -IC:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include -IC:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/libc/usr/include -std=c++11
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:146:11: error: no member named 'fwide' in the global namespace
using ::fwide;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:147:11: error: no member named 'fwprintf' in the global namespace; did you mean 'fprintf'?
using ::fwprintf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\libc\usr\include\stdio.h:326:12: note: 'fprintf' declared here
extern int fprintf (FILE *__restrict __stream,
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:148:11: error: no member named 'fwscanf' in the global namespace
using ::fwscanf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:158:11: error: no member named 'swprintf' in the global namespace
using ::swprintf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:160:11: error: no member named 'swscanf' in the global namespace
using ::swscanf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:162:11: error: no member named 'vfwprintf' in the global namespace; did you mean 'vfprintf'?
using ::vfwprintf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\libc\usr\include\stdio.h:341:12: note: 'vfprintf' declared here
extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:167:11: error: no member named 'vswprintf' in the global namespace
using ::vswprintf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:172:11: error: no member named 'vwprintf' in the global namespace
using ::vwprintf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:202:11: error: no member named 'wprintf' in the global namespace
using ::wprintf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\cwchar:203:11: error: no member named 'wscanf' in the global namespace
using ::wscanf;
~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu\bits/gthr-default.h:118:9: error: use of undeclared identifier 'pthread_mutex_timedlock'; did you mean 'pthread_mutex_trylock'?
__gthrw(pthread_mutex_timedlock)
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\libc\usr\include\pthread.h:759:12: note: 'pthread_mutex_trylock' declared here
extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu\bits/gthr-default.h:134:9: error: use of undeclared identifier 'pthread_mutexattr_settype'; did you mean 'pthread_mutexattr_destroy'?
__gthrw(pthread_mutexattr_settype)
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\libc\usr\include\pthread.h:811:12: note: 'pthread_mutexattr_destroy' declared here
extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu\bits/gthr-default.h:768:12: error: no matching function for call to '__gthrw_pthread_mutex_timedlock'
return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu\bits/gthr-default.h:92:25: note: expanded from macro '__gthrw_'
# define __gthrw_(name) __gthrw_ ## name
^~~~~~~~~~~~~~~~
<scratch space>:143:1: note: expanded from here
__gthrw_pthread_mutex_timedlock
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu\bits/gthr-default.h:118:1: note: candidate function not viable: requires 1 argument, but 2 were provided
__gthrw(pthread_mutex_timedlock)
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu\bits/gthr-default.h:99:32: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
^
<scratch space>:95:1: note: expanded from here
__gthrw_pthread_mutex_timedlock
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\aarch64-linux-gnu\bits/gthr-default.h:796:10: error: use of undeclared identifier 'PTHREAD_MUTEX_RECURSIVE'
PTHREAD_MUTEX_RECURSIVE);
^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\bits/basic_string.h:6548:51: error: no member named 'vswprintf' in namespace 'std'
{ return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(int),
~~~~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\bits/basic_string.h:6553:51: error: no member named 'vswprintf' in namespace 'std'
{ return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
~~~~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\bits/basic_string.h:6559:51: error: no member named 'vswprintf' in namespace 'std'
{ return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(long),
~~~~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\bits/basic_string.h:6564:51: error: no member named 'vswprintf' in namespace 'std'
{ return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
~~~~~^
C:\Xilinx\SDK\2019.1\gnu\aarch64\nt\aarch64-linux\aarch64-linux-gnu\include\c++\8.2.0\bits/basic_string.h:6570:51: error: no member named 'vswprintf' in namespace 'std'
{ return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Error while processing C:\Users\David\workspace\test_HLS_cholesky_inverse\src\cholesky_inverse.cpp.
ERROR: [TemplateExtract 83-3509] Failed to run clang frontend action of rtl_template_extract!
ERROR: [SdsCompiler 83-5176] RTL template analysis exited with non-zero code processing C:/Users/David/workspace/test_HLS_cholesky_inverse/src/cholesky_inverse.cpp
sds++ log file saved as C:/Users/David/workspace/test_HLS_cholesky_inverse/Debug/_sds/reports/sds_cholesky_inverse.log
ERROR: [SdsCompiler 83-5004] Build failed
sds++ completed at Thu Jul 11 10:34:16 -0700 2019

0 Kudos