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
Participant sean.durkin
Participant
6,469 Views
Registered: ‎05-15-2013

Vivado HLS: problem with ap_fixed.h

Jump to solution

Hi *,

 

I'm doing first test designs with HLS. I looked at the examples in UG902 and more or less copied that with small modifications to my design, but I get compilation errors.

 

The example code in UG902 (page 661 in v2015.4) is as follows:

 

ap_ufixed<256, 77> MyAPFixed = 333.789;
ap_uint<77> Result;

Result = MyAPFixed.to_ap_int(); //Yields 333

This is my code:

 

#include <ap_fixed.h>
…
static ap_ufixed<PX_RESOLUTION+6,PX_RESOLUTION+4> tmp_calc;
static ap_uint<PX_RESOLUTION+4> tmp_result[NUM_PX_PARALLEL];
…
tmp_result[i] = tmp_calc.to_ap_int();

When I compile that, I get the following error:

 

Compilation errors found:
filter_hls/src/smoothing_filter.cpp:53:28: error: no member named 'to_ap_int' in 'ap_ufixed<16, 14, 5, 3, 0>'
                tmp_result[i] = tmp_calc.to_ap_int();
                                ~~~~~~~~ ^

 

So basically, it looks like the member function is not recognized, for whatever reason...

 

I'm stuck here... what am I doing wrong? Or is this a bug?

 

Regards,

Sean

0 Kudos
1 Solution

Accepted Solutions
Teacher muzaffer
Teacher
11,922 Views
Registered: ‎03-31-2012

Re: Vivado HLS: problem with ap_fixed.h

Jump to solution
I am not sure you are doing anything wrong. This member seems to have been removed. Now ap_uint has a constructor which takes a ap_ufixed reference. So try ap_uint <...> foo(tmp_calc); and see if that works. If it does as it should, then you can say tmp_result[i] = foo;
- 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
Teacher muzaffer
Teacher
11,923 Views
Registered: ‎03-31-2012

Re: Vivado HLS: problem with ap_fixed.h

Jump to solution
I am not sure you are doing anything wrong. This member seems to have been removed. Now ap_uint has a constructor which takes a ap_ufixed reference. So try ap_uint <...> foo(tmp_calc); and see if that works. If it does as it should, then you can say tmp_result[i] = foo;
- 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
Participant sean.durkin
Participant
6,385 Views
Registered: ‎05-15-2013

Re: Vivado HLS: problem with ap_fixed.h

Jump to solution

@muzaffer wrote:
I am not sure you are doing anything wrong. This member seems to have been removed. Now ap_uint has a constructor which takes a ap_ufixed reference. So try ap_uint <...> foo(tmp_calc); and see if that works. If it does as it should, then you can say tmp_result[i] = foo;

Hi,

 

indeed, that way it works, thanks! So I guess the documentation should be updated accordingly...

 

Regards,

Sean

0 Kudos