cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Contributor
Contributor
571 Views
Registered: ‎11-10-2017

SW-Emulation Error using hls math function in C++ Kernel on SDAccel

Hi, I'm new to SDAccel (2019.1) on Ubuntu 18.04.

I am developing some applications using lgamma() function.

I created application by modifying vadd example project.

In C++ Kernel, I want to use lgamma() function, so I include "hls_math.h".

SW-Emulation build was successfully completed, but when running, application stops and show the following error message.

 

Software emulation of compute unit(s) exited unexpectedly

When I remove lgamma() function, SW-Emulation works successfully. 

 

I thought this problem was related to loading libraries, so I tested lgamma() function in host code.

I also included "hls_math.h" in host code, and wrote lgamma() function in main(). Compile works successfully.

But SW-Emulation also failed with the following error.

 

/home/nittax/Desktop/dp_sdx/Emulation-SW/dp_sdx.exe: error while loading shared libraries: libIp_floating_point_v7_0_bitacc_cmodel.so: cannot open shared object file: No such file or directory

I looked for "libIp_floating_point_v7_0_bitacc_cmodel.so". I found the file in "/tools/Xilinx/Vivado/2019.1/lnx64/tools/fpo_v7_0/libIp_floating_point_v7_0_bitacc_cmodel.so". I added this directory to PATH, but the problem was not solved.

 

screenshot (2).png

Any ideas?? Thanks in advance.

 

0 Kudos
Reply
5 Replies
Teacher
Teacher
527 Views
Registered: ‎06-16-2013

Hi @nittax 

 

> I looked for "libIp_floating_point_v7_0_bitacc_cmodel.so". I found the file in "/tools/Xilinx/Vivado/2019.1/lnx64/tools/fpo_v7_0/libIp_floating_point_v7_0_bitacc_cmodel.so". I added this directory to PATH, but the problem was not solved.

 

I'm not familiar with SDAccel.

But I ask you how do you add this directory.

In his case, at least you add this directory into LD_LIBRARY_PATH. Not PATH.

Have you already added it into LD_LIBRARY_PATH ?

 

Best regards,

 

0 Kudos
Reply
Contributor
Contributor
511 Views
Registered: ‎11-10-2017

@watari Thanks for your reply.

Oh, I misunderstand the LD_LIBRARY_PATH... So I add "/tools/Xilinx/Vivado/2019.1/lnx64/tools/fpo_v7_0" to LD_LIBRARY_PATH.

export LD_LIBRARY_PATH=/tools/Xilinx/Vivado/2019.1/lnx64/tools/fpo_v7_0:$LD_LIBRARY_PATH

Using lgamma() function in host code works successfully by this solution. Thanks. 

But in kernel code, I still can't use lgamma() function.

 

I will try a little more.

0 Kudos
Reply
Teacher
Teacher
501 Views
Registered: ‎06-16-2013

Hi @nittax 

 

BTW, did you make sure errno ?

Also, you might change function from lgamma to lgamma_r, if it's relevant some error...

 

Best regards,

0 Kudos
Reply
Contributor
Contributor
452 Views
Registered: ‎11-10-2017

Hmm.. I  found that lgamma() for specific argument value crash the kernel.

I think the implementation of lgamma() and tgamma() in hls library is wrong..

In HLS use guide (UG902 v2019.1) , the limitation for input argument is as follows.

ug902.png

 

I have tested these functions on Vivado HLS 2019.1.hls_result.png

Case1 and Case 3 is incorrect. only case2 is correct. 

Although both ap_fixed<32,10> and ap_fixed<10.5> satisfies the input argument limitation, I can't obtain correct result..

 

I will post this problem as new post.

 

 

0 Kudos
Reply
Contributor
Contributor
449 Views
Registered: ‎11-10-2017

0 Kudos
Reply