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
Scholar pedro_uno
Scholar
28,926 Views
Registered: ‎02-12-2013

HLS arbitrary precision floating point math?

Jump to solution

Hello All,

 

I am building some blocks in HLS that require floating point math.  Early experiments indicate that single precision floating point accumulates unacceptable errors. For example, I tested a 4x4 matrix inversion block by filling it with random numbers taking the inversion and then mutliplying the result by the original to get back an identity matrix.

 

I then checked the resulting identity matrix against an ideal identity matrix and recorded the maximum error.  On a run of 1 million matrix inversions, single precision math gave a maximum error of  about 1.3e-1.  Double precision math gave an error of about 1e-10.

 

Going from single precision to double precision doubled the logic utilization and doubled the latency.

 

I know that the Xilinx floating point logicore blocks support arbitrary precision floating point numbers.  I am guessing that my algorithm doesn't need the full 56 bit mantissa of double precision but the 24 bits of single precision is too little.

 

I did not find any mention of it in UG902. Does HLS support arbitrary precision floating point types?

 

    Pete

 

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
32,753 Views
Registered: ‎08-17-2011

Re: HLS arbitrary precision floating point math?

Jump to solution
hello Pete,

<<Does HLS support arbitrary precision floating point types?>>
I don't think so, however you may be able to use the appropriate ap_fixed type?
you can maybe experiment with changing typedefs in your code; as you'll know with fixed size you'll have to allow for bitwidth expansion.
- Hervé

SIGNATURE:
* New Dedicated Vivado HLS forums* http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/bd-p/hls
* Readme/Guidance* http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

* 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
2 Replies
Xilinx Employee
Xilinx Employee
32,754 Views
Registered: ‎08-17-2011

Re: HLS arbitrary precision floating point math?

Jump to solution
hello Pete,

<<Does HLS support arbitrary precision floating point types?>>
I don't think so, however you may be able to use the appropriate ap_fixed type?
you can maybe experiment with changing typedefs in your code; as you'll know with fixed size you'll have to allow for bitwidth expansion.
- Hervé

SIGNATURE:
* New Dedicated Vivado HLS forums* http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/bd-p/hls
* Readme/Guidance* http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

* 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
Moderator
Moderator
28,860 Views
Registered: ‎04-17-2011

Re: HLS arbitrary precision floating point math?

Jump to solution
Do you still have question? If not kindly close this post by selecting the answer which helped you as an Accepted Solution.
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