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
Explorer
Explorer
1,641 Views
Registered: ‎08-26-2014

Can HLS handle 3-dimension arrays?

Jump to solution

Hello,

 

I have defined a three dimensional array (i.e. Vcaps[3][2][4]). Then I enter in the debug mode. In the testbench file everything is shown properly in the Expressions tab (I mean all dimensions are shown correctly).

 

However, when I enter the HLS function, if I show the input array, it is only showing 2 dimensions.

 

Does HLS have any limitation on how many dimensions an input array can have?

 

I tried to create a similar array inside the HLS function and it is shown properly in the Expressions tab.

 

Very weird.

 

Thanks,

 

Cerilet

0 Kudos
1 Solution

Accepted Solutions
Scholar u4223374
Scholar
2,381 Views
Registered: ‎04-26-2015

Re: Can HLS handle 3-dimension arrays?

Jump to solution

I may be mistaken, but I think that behaviour is correct (or at least acceptable). It's just dropped one dimension of the array and changed it to a general pointer, leaving one dimension with size undefined. As long as HLS does actually keep track of its size somewhere (so it can use appropriate resources) this is not a problem for synthesis.

 

It is an issue for debugging, since it appears that HLS will only let you inspect the first element in that dimension. I have no idea what to do about that.

 

 

0 Kudos
4 Replies
Scholar u4223374
Scholar
1,569 Views
Registered: ‎04-26-2015

Re: Can HLS handle 3-dimension arrays?

Jump to solution

I've used five dimensions before, and that's worked fine.

 

It's possible that either array partitioning or reshaping has resulted in the reduction in dimensions. For example, if you fully partition one dimension of a 3D array, it'll end up as a set of individual 2D arrays. If you reshape one dimension of a 3D array, it'll end up as a much wider 2D one.

0 Kudos
Explorer
Explorer
1,533 Views
Registered: ‎08-26-2014

Re: Can HLS handle 3-dimension arrays?

Jump to solution

Thanks @u4223374 for your reply.

 

Well, then I have no idea what is happening. Check the attached image. I have an internal variable (bool gates[3][2][4]) which is properly shown in the expressions tab. Then I have the output array (int gates_out[3][2][4]) and no partitioning or reshaping pragmas.

 

As you can see in the expressions tab, gates_out is showing the type (*)[2][4] whereas gates is properly showing [3][2][4] and I don't know why. The function is declared as follows:

 

void full_control_mmc(const data_t ref[5], const data_t corriente[6],
	data_t Vcaps_out[3][2][4], int gates_out[3][2][4], data_t Uv[3])

I have the same behavior with Vcaps (data_t is defined as double).

 

Do you have any clue of what is happening?

debug error.png
0 Kudos
Scholar u4223374
Scholar
2,382 Views
Registered: ‎04-26-2015

Re: Can HLS handle 3-dimension arrays?

Jump to solution

I may be mistaken, but I think that behaviour is correct (or at least acceptable). It's just dropped one dimension of the array and changed it to a general pointer, leaving one dimension with size undefined. As long as HLS does actually keep track of its size somewhere (so it can use appropriate resources) this is not a problem for synthesis.

 

It is an issue for debugging, since it appears that HLS will only let you inspect the first element in that dimension. I have no idea what to do about that.

 

 

0 Kudos
Explorer
Explorer
1,516 Views
Registered: ‎08-26-2014

Re: Can HLS handle 3-dimension arrays?

Jump to solution

Yup! You were right!

 

I was getting strange results and I thought that the origin might be it, but now I had debugged the coded assuming that it worked well and after solving another minor problem, now I get proper results.

 

However, I think this issue should be somehow solved by @xilinx.

 

Thanks @u4223374 for your help!

 

Cerilet

0 Kudos