LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Fixed Array Size Error

I'm trying to implement an Matrix x Vector function but using the array subset function results in an error about fixed size arrays. I see from the help file this is because it requires constants for the index and length inputs. But... why does the index need to be a constant? and if it does need to be is this function really ready for the pallette?

FPGA Array Error.png

0 Kudos
Message 1 of 2
(2,799 Views)

Hi Steve,

 

I see the problem, the index and length inputs need to be fixed so that the FPGA compiler knows how much memory to assign for the array. If you use context help and hover over the wires you will see that the arrays you defined outside the loop are (1-D fixed-size arrays) whereas the array that comes out of the Array Subset function is a (1-D bounded-size array). I believe the code will compile correctly if all the array data lines are of this fixed type.

 

With that in mind I created this solution, which uses the Replace Array Subset and Rotate 1D array functions to maintain the fixed-size data type.

 

The index of the Replace Array Subset function must remain at zero for it to replace the initial values, and it must be initialised to a 6 element array (in this case the input vector). The elements however are immediately replaced with the first 6 elements of the 1DMatrix, in each iteration of the loop, the 1DMatrix is rotated to address the next 6 elements. To ensure the Replace Array Subset function starts with the first 6 values in the 1DMatrix, it is first rotated in the opposite direction (outside the loop).

 

Hope this helps, let me know how it goes.

 

fpgaforumpost.png

Joel G
Applications Engineer
National Instruments UK & Ireland
Message 2 of 2
(2,767 Views)