cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cerilet
Explorer
Explorer
2,702 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
u4223374
Advisor
Advisor
3,442 Views
Registered: ‎04-26-2015

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.

 

 

View solution in original post

0 Kudos
4 Replies
u4223374
Advisor
Advisor
2,630 Views
Registered: ‎04-26-2015

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
cerilet
Explorer
Explorer
2,594 Views
Registered: ‎08-26-2014

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
u4223374
Advisor
Advisor
3,443 Views
Registered: ‎04-26-2015

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.

 

 

View solution in original post

0 Kudos
cerilet
Explorer
Explorer
2,577 Views
Registered: ‎08-26-2014

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