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: 
Adventurer
Adventurer
8,759 Views
Registered: ‎12-18-2012

expf error with Vivado HLS 20123.3..bug?

Hello,

 

I downloaded the new vivado version and I encountered a bug in the expf() function that was not present in the previous versions. Both C and RTL simulation failed or has garbage results for negative arguments in the expf() function. exp() runs normally but synthesizes double floating and not single floating poitn module on hardware. 

 

expf() run without problems in 2013.2. Is this a new issued bug perhaps?

 

Cheers...

0 Kudos
9 Replies
Moderator
Moderator
8,741 Views
Registered: ‎04-17-2011

Re: expf error with Vivado HLS 20123.3..bug?

This issue occurs when you set the RTL Tool to ISE. expf() is a Vivado based core and you need to set RTL tool setting to Vivado. This has been flagged as an error from Vivado HLS 2013.3.
Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
8,734 Views
Registered: ‎12-18-2012

Re: expf error with Vivado HLS 20123.3..bug?

The RTL tool was set to auto...I have changed it to vivado explicitly by the gui (set_part {xc7vx485tffg1761-2} -tool vivado in script.tcl) but both errors still occure.

 

Both simulations still crash with unknown errors

 

 

0 Kudos
Adventurer
Adventurer
8,716 Views
Registered: ‎12-18-2012

Re: expf error with Vivado HLS 20123.3..bug?

Bumping this up...Does anyone know if it is a bug or not? It is not much of a problem since one can use the 2013.2 version for generating IPs and using the IP in vivado 2012.3 but still it is an issue....

 

0 Kudos
Xilinx Employee
Xilinx Employee
8,703 Views
Registered: ‎11-28-2007

Re: expf error with Vivado HLS 20123.3..bug?

Just tested it and expf works for me (see the attached test case). Can you please provide your testcase? PM me if needed.

 


@adanathel wrote:

Bumping this up...Does anyone know if it is a bug or not? It is not much of a problem since one can use the 2013.2 version for generating IPs and using the IP in vivado 2012.3 but still it is an issue....

 




Cheers,
Jim
0 Kudos
Adventurer
Adventurer
8,695 Views
Registered: ‎12-18-2012

Re: expf error with Vivado HLS 20123.3..bug?

I have managed to narrow down the bug. The problematic code is actually sth like this:

 

res = 1 /(expf(-0.086 * prevV - 14.6) + expf(0.070 * prevV - 1.87));

 


If I use expf for both expressions then I get the error in simulation.

The issue here is that I cannot re-create the bug standalone because I do not get these errors when i use this expression on its own in am simpler example. 

 

There is also sth interesting too. If i use the a temp variable for one of the expfs, for example:

 

float temp;

temp = expf(-0.086 * prevV - 14.6);

res = 1 /( temp + expf(0.070 * prevV - 1.87));

 


The simulation runs properly but then I get results that have a precision(?) deviation from those I would expect from the computations in single float format. Resutls different from the numbers I get from running the program in C with single floats in gcc.

On the other hand the single float resutls using the exp() in 2013.3 and both exp() and expf() in 2013.2 are identical to the C code results. The code running in vivado is identical in all cases.

 

There must be an issue with certain computations done in the math of the model I am implementing because I could not seem to be able to re-create these issues in simpler code as of yet.  Unfortunately I am not at liberty to disclose the model.

 

What were the changes made in the expf() function between versions?

   

 

 

0 Kudos
Teacher muzaffer
Teacher
8,685 Views
Registered: ‎03-31-2012

Re: expf error with Vivado HLS 20123.3..bug?

One thing I can suggest is to put the denominator in a temp variable and do the 1/x on the temp result, if you haven't tried already.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Adventurer
Adventurer
8,679 Views
Registered: ‎12-18-2012

Re: expf error with Vivado HLS 20123.3..bug?

Same thing then...Works but with a precision(?) error...

 

0 Kudos
Teacher muzaffer
Teacher
8,673 Views
Registered: ‎03-31-2012

Re: expf error with Vivado HLS 20123.3..bug?

how many bits of ulp error are you seeing? are you sure this is not just the standard floating point reordering kind of issue? One final thing to try would be to make the 1/x into 1.0/x and see if this changes anything.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Adventurer
Adventurer
8,669 Views
Registered: ‎12-18-2012

Re: expf error with Vivado HLS 20123.3..bug?

I can the error in the result of the first interation of the code. Later error just accumulates and results go haywire:

 

Unfortunately this is a result of several uses in the exp in the code. I have to see individually where deviations occur. It will take me some time.

 

I tried using 1.0 instead of 1 but again there was an error in the resutls. Different error i must say but still there.

 

 

With exp() or 2013.2 HLS : 11000010011011111110011101100100
With expf() in 2013.3         : 11000010011011111110110000111001

Using 1.0                             : 11000010011011111110110000100000

 

0 Kudos