Table Of Contents

Simplified Array Indexing for Increased Throughput in an Optimized FPGA VI

Last Modified: August 9, 2019

You can increase the throughput of an Optimized FPGA VI by simplifying the indexing logic for arrays in the VI.

When you compile the code in an Optimized FPGA VI, the compiler looks for opportunities to increase parallelism and thereby increase the throughput of the code. In particular, the compiler easily recognizes the following indexing patterns and can make optimizations to process array data in parallel:

  • Simple arithmetic for array indexing based on the iteration terminal of For Loops
  • Nested For Loops that use multiplication and addition operations to index an array

Refer to the following example sections for code that demonstrates these patterns.

Indexing Arrays through the Iteration Terminal of For Loops

When you compile the following code, the compiler analyzes the access pattern of the Coefficients - Weighted Average array and determines that each iteration of the loop depends on different subsets of the array. As a result, the compiler splits the array into these subsets that can be processed in parallel, and the Optimized FPGA VI achieves an initiation interval of one clock cycle. If the compiler did not make any optimizations for the parallel processing of array data, the initiation interval for this example would be four clock cycles because the presence of the Feedback Node would not allow a new sample to be processed until all loop iterations completed.

Indexing Arrays with Nested For Loops and Multiplication and Addition Operations

When you compile the following code, the compiler determines that Index Array reads elements sequentially from the array. Based on this information, the compiler can unroll the For Loops and implement memory more efficiently.

Recently Viewed Topics