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: 
Explorer
Explorer
237 Views
Registered: ‎03-22-2017

Call to 'tanh' is ambiguous (ap_fixed)

In Vivado HLS, I am getting the following error. Is there a solution for that?

Analyzing source for RTL template usage
src/wrapper.cc:182:22: error: call to 'tanh' is ambiguous
      FDATA_T tmp1 = hls::tanh<FXD_W_LENGTH, FXD_I_LENGTH>(tmp);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tools/Xilinx-SDSoC/Vivado/2019.1/include/hls_math.h:1562:17: note: candidate function [with W = 16, I = 7]
  ap_fixed<W,I> tanh(ap_fixed<W,I> x){
                ^
/tools/Xilinx-SDSoC/Vivado/2019.1/include/hls_math.h:1568:18: note: candidate function [with W = 16, I = 7]
  ap_ufixed<W,I> tanh(ap_ufixed<W,I> x){
                 ^
Error while processing test/src/wrap
0 Kudos
3 Replies
Visitor thomas66
Visitor
184 Views
Registered: ‎12-05-2009

Re: Call to 'tanh' is ambiguous (ap_fixed)

How does the typedef of FDATA_T look like and how looks the declaration for tmp?

-Thomas

Highlighted
Voyager
Voyager
172 Views
Registered: ‎03-28-2016

Re: Call to 'tanh' is ambiguous (ap_fixed)

The variables tmp and tmp1 both need to be of type ap_fixed<16,7> or ap_ufixed<16,7>.

Ted Booth - Tech. Lead FPGA Design Engineer
www.designlinxhs.com
Explorer
Explorer
159 Views
Registered: ‎03-22-2017

Re: Call to 'tanh' is ambiguous (ap_fixed)

@thomas66 

I just realized that I defined

 

#define FDATA_T ap_fixed<16, 7, AP_RND, AP_SAT>

If I remove the rounding and saturation options, it works:

 

#define FDATA_T ap_fixed<16, 7>

Are the HLS fixed-point operators defined without taking into account the specific rounding and saturation options that a designer may want to choose?

 

0 Kudos