LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ARRAY WITH SHIFT REGISTER ISSUE

I have an issue with the LabVIEW FPGA Module. As shown in the attached figure, I'm working in a Fuzzy System, but there's something wrong with the implementation. The VI only calculates the set shape and should set in the indicator a 1D-array of 256 elements of 8-bits each one, from a cluster array which has the configuration of each set. No matter what this array is, the problem is that the resulting array is implemented in 8878 slices, 16306 slice registers and 12299 slice registers, which is too much for that simple function. If I change the size of the array from 256 to 1024, appears the compiler error -61332. I can realize that arrays (especially big arrays) are not well implemented in the FPGA because creates several 256-element arrays.

Do you have any idea of why? This simple design fits in a CRIO-9104, but I insist, those are too much resources.

Can you propose me an alternative idea without using only Memory Elements?

Thank you

0 Kudos
Message 1 of 8
(2,952 Views)

Is there any reason you have two separate For Loops each designed to run 256 times?  The second has an input which is 1 to 1 with the output of the first loop?

 

I think it would help to merge those into one loop.  But I don't know if it would completely solve your issues as I'm not an FPGA person.

0 Kudos
Message 2 of 8
(2,943 Views)

I'll try it. Thank you Smiley Wink

0 Kudos
Message 3 of 8
(2,937 Views)

I don't know what's inside your Trap, Min, and Max functions, but there may be room for optimization inside them. I highly recommend the use of single-cycle timed loops to replace the for loops, if your code allows. You'll have to index the array elements yourself, but the space saving is probably worth it.

0 Kudos
Message 4 of 8
(2,923 Views)

OK, that sounds great. Let me try it and I'll tell you what happened.

Thank you

0 Kudos
Message 5 of 8
(2,911 Views)

I realized that the shift register is not the problem. Check this portion of the program. This simple indexed assignment generates this same error. Can somebody explain me, cause I don't understand?

 

(NOTE: I tried with the Single-Cycle Timed Loop and it does not help me to save area in my device; almost the same amount of slices).

0 Kudos
Message 6 of 8
(2,875 Views)

Finally I understood why this error appears. You cannot make an indexed assignment with an array of clusters. Now the error has gone, but what about the slices? Why so huge?

Thank you

0 Kudos
Message 7 of 8
(2,871 Views)

@vitrion wrote:

Now the error has gone, but what about the slices? Why so huge?


If you post your code - the VI and all of its subVIs - then we can help find ways to optimize it. There's nothing we can do with the limited information you've provided.

0 Kudos
Message 8 of 8
(2,845 Views)