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: 
Observer angu_sewa
Observer
1,423 Views
Registered: ‎07-16-2017

How to handle large 3D matrices in HLS?

Hello,

         I am having a problem in working with large 3D matrices  (mat[128][100][360]), in HLS. I am not able to carry out the C-simulation. The possible reason I found HLS manual for this is that HLS was running out of memory. I tried the method of using malloc() as suggested in the user manual. But the problem still persists. How to overcome this problem?. PLease help.

0 Kudos
5 Replies
Scholar u4223374
Scholar
1,406 Views
Registered: ‎04-26-2015

Re: How to handle large 3D matrices in HLS?

Can you post the code? 128x100x360 is large but not ridiculous - much smaller than a 4K image, for example.

0 Kudos
Observer angu_sewa
Observer
1,390 Views
Registered: ‎07-16-2017

Re: How to handle large 3D matrices in HLS?

Here I have attached my codes.

0 Kudos
Scholar u4223374
Scholar
1,346 Views
Registered: ‎04-26-2015

Re: How to handle large 3D matrices in HLS?

What is the exact error that HLS gives? Is it this one?

cc1plus.exe: out of memory ...

 

If so, that's a very simple fix: upgrade to HLS 2017.3 or downgrade to HLS 2016.4. HLS 2017.1 and HLS 2017.2 are broken (under Windows, anyway) and can't compile the hls_math.h header.

0 Kudos
Highlighted
Observer angu_sewa
Observer
1,327 Views
Registered: ‎07-16-2017

Re: How to handle large 3D matrices in HLS?

This is the error.

err.JPG
0 Kudos
Participant valato
Participant
1,309 Views
Registered: ‎09-29-2017

Re: How to handle large 3D matrices in HLS?

It is definitely the problem of static allocation of all matrices on stack. I had similiar problem. You should use something like this:

#ifdef __SYNTHESIS__
float bigmatrix[1000];
#else
float * bigmatrix = (float*)malloc(1000*sizeof(float));
#endif

Or you can just move all matrices outside top function and make them static global variables.

----- Please mark the post as an answer "Accept as solution" in case it helped to solve your problem. Give kudos in case the post guided you to the solution.