Table Of Contents

Using Arrays in FPGA Applications

Version:
    Last Modified: February 27, 2020

    You can use up to three-dimensional arrays with a fixed size or a variable size that resolves to a fixed size at compile time in your FPGA application.

    To configure an array constant, control, or indicator to be fixed-sized, select the array object and select Fixed in the Compiled size option in the Item tab.

    To use a variable-sized array, make sure the array size can be determined at compile time. This might mean that certain properties of the array, such as the length or indexes of the elements you read or write, must be constant values. For example, if you use the Array Subset node, the index and length inputs must be constant so that the size for the output subarray can be determined.

    The following table describes behaviors, caveats, and restrictions for using variable-sized arrays with some nodes or functionalities in FPGA applications.

    Nodes or Functionalities Behavior, Caveats, and Restrictions
    Array Operations

    For each node that supports array inputs or outputs, LabVIEW NXG determines the size of an array output by examining the inputs of the node. If a node includes only scalar or fixed-size array inputs, LabVIEW NXG infers a fixed-size array output. LabVIEW NXG returns an error if it cannot infer a fixed size.

    The following Array nodes can return arrays that resolve to a fixed size at compile time, regardless of constant or non-constant inputs:

    • Build Array
    • Cluster to Array
    • Decimate 1D Array
    • Interleave 1D Arrays
    • Replace Array Subset
    • Reverse 1D Array
    • Rotate 1D Array

    The following Array nodes can return arrays that resolve to a fixed size at compile time if one or more inputs are constants:

    • Array Subset—The index and length inputs must be constant.
    • Delete from Array—The length and index inputs must be constant.
    • Initialize Array—The dimension size input must be constant.
    • Insert into Array—The index input must be constant.
    • Reshape Array—The dimension size input must be constant.
    • Split 1D Array—The index input must be constant.
    Classes and Clusters You can embed arrays that resolve to a fixed size at compile time in clusters and classes.
    SubVIs LabVIEW NXG tracks inferred array sizes of subVIs in order to propagate them in and out of an FPGA VI. For subVIs with VI reentrancy set to None, if an array size inferred through one call does not match the size of another call, LabVIEW NXG returns an error for the panel control along with all calls to that VI.
    Shift Registers LabVIEW NXG infers the array size by examining the input terminals. If the array size of the initial value input does not match the size of the array passed from the right border, LabVIEW NXG returns an error.
    Feedback Nodes LabVIEW NXG compares the array size on the input terminal of the Feedback Node to the size of the initializer terminal. If the sizes do not match, LabVIEW NXG returns an error.
    Select Node LabVIEW NXG infers the output array size only if both input array sizes statically resolve to the same fixed size at compile time. Otherwise, LabVIEW NXG returns an error.
    Case Structures LabVIEW NXG infers the array size of a Case structure output tunnel only if the input array sizes of all diagrams within the Case structure statically resolve to the same fixed size at compile time. Otherwise, LabVIEW NXG returns an error.
    For Loops LabVIEW NXG infers the array size of an auto-indexed output tunnel based on the number of times the For Loop executes. You must wire a constant value to the count terminal. LabVIEW NXG returns an error if the size of the array output is not statically resolved.
    Coercions Wiring a variable-sized array to a fixed-size terminal where the array sizes do not match, as with subVI terminals and indicators, results in coerced data that is padded or truncated to the terminal size. When you wire a fixed-size array to a variable-sized terminal, the array size of the fixed type propagates forward.

    Recently Viewed Topics