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
Visitor mahkoe
Visitor
231 Views
Registered: ‎02-08-2019

HLS never makes more than 3 floating point multiplier instances

Jump to solution

I have a loop like the following:

for (int i = 0; i < MAX; i++) {
	sum[i] += a*b[i];
}

where sum, a, and b are all in floating point. MAX is set to 10.

I have fully unrolled this loop, but for some reason vivado HLS only ever makes 3 floating point adders and 3 floating point multipliers. Why isn't it making 10?

0 Kudos
1 Solution

Accepted Solutions
Scholar xilinxacct
Scholar
211 Views
Registered: ‎10-23-2018

Re: HLS never makes more than 3 floating point multiplier instances

Jump to solution

@mahkoe

How many DSPs do you want to use up? Do you have enough to fully instantiate?

If you want to use more, you can use the pragma...

#pragma HLS allocation instances=fmul limit=10 operation
#pragma HLS allocation instances=fadd limit=10 operation

Hope that helps

If so, please mark as solution accepted. Kudos also welcomed. :-)

6 Replies
Scholar xilinxacct
Scholar
212 Views
Registered: ‎10-23-2018

Re: HLS never makes more than 3 floating point multiplier instances

Jump to solution

@mahkoe

How many DSPs do you want to use up? Do you have enough to fully instantiate?

If you want to use more, you can use the pragma...

#pragma HLS allocation instances=fmul limit=10 operation
#pragma HLS allocation instances=fadd limit=10 operation

Hope that helps

If so, please mark as solution accepted. Kudos also welcomed. :-)

Visitor mahkoe
Visitor
206 Views
Registered: ‎02-08-2019

Re: HLS never makes more than 3 floating point multiplier instances

Jump to solution
@xilinxacct
I tried this pragma, but it had no effect.

I know that the FPGA I am targeting has enough DSPs for 10 floating point multipliers (the synthesis report says I've used less than 5% of DSPs).
0 Kudos
Scholar xilinxacct
Scholar
198 Views
Registered: ‎10-23-2018

Re: HLS never makes more than 3 floating point multiplier instances

Jump to solution

@mahkoe

No difference of any kind?

What target device to you have?

You are saying the the DSP utilization does not go up, when you use the pragma?

Are your variables floats?

Do you have a typo on your pragma line?

prior to using the pragma do you see something like this in the log?

INFO: [RTGEN 206-100] Generating core module 'opTest_fmul_32ns_cud': 2 instance(s).

and after you don't see 

INFO: [RTGEN 206-100] Generating core module 'opTest_fmul_32ns_bkb': 10 instance(s).

 

Does your code look like this?

#define MAX 10
void opTest(float a, float b[MAX], float sum[MAX]) {
#pragma HLS allocation instances=fmul limit=10 operation
#pragma HLS allocation instances=fadd limit=10 operation
	for (int i = 0; i < MAX; i++) {
#pragma HLS unroll
		sum[i] += a * b[i];
	}
}

 

0 Kudos
Visitor mahkoe
Visitor
193 Views
Registered: ‎02-08-2019

Re: HLS never makes more than 3 floating point multiplier instances

Jump to solution
Yes, that is correct. A slight correction: I see three instances of floating point adders/multipliers.

I simplified my code quite a bit to make this post; this loop is actually the inner loop of a more complex operation. Could that have something to do with this problem?
0 Kudos
Scholar xilinxacct
Scholar
192 Views
Registered: ‎10-23-2018

Re: HLS never makes more than 3 floating point multiplier instances

Jump to solution

@mahkoe

If you could try the example code as is, in a new project, and prove/disprove the pragmas 'can' work on you system, that would be step one.

If the 'simplification' of the problem makes it not 'representative' of the real code anymore, then yes that might make a difference. For example, if you have any data dependancies, that would limit the ability to become more parallel.

 

0 Kudos
Visitor mahkoe
Visitor
181 Views
Registered: ‎02-08-2019

Re: HLS never makes more than 3 floating point multiplier instances

Jump to solution

I have tried it in a new project, and I can confirm the pragmas work.

I will go through the rest of my code more carefully: you have helped me narrow down the problem to another location.

 

Thanks very much!

0 Kudos