Table Of Contents

Array Shift Register Initialization in Optimized FPGA VIs

Last Modified: August 9, 2019

You must initialize all array shift registers in Optimized FPGA VIs. Initializing an array shift register allows the compiler to determine initial values for the shift register and make optimizations, which helps increase throughput by preventing re-initialization on consecutive executions of the Optimized FPGA VI.

In complex designs, the compiler still might not be able to determine whether the initial array values are important and may not make the automatic optimizations it normally would when you initialize array shift registers. If your Optimized FPGA VI does not achieve the desired throughput, you can manually initialize the array shift register using a Feedback Node design to mimic the optimization the compiler would have made.


The following code demonstrates an example of original code and an equivalent representation after the compiler optimizes the code based on initialization values for the shift register.

Figure 1. Original Code

When the original code is compiled, the compiler determines that the loop overwrites every element of the array. Because of this determination, the compiler makes optimizations to the Optimized FPGA code where the value of the left shift register is not initialized on each execution of the VI, as demonstrated in the following image.

Figure 2. Equivalent Code after Compiler Optimizations

The previous image is also an example of how you might modify your code to mimic the optimization the compiler would have made in a complex design where the compiler cannot automatically make optimizations.

Recently Viewed Topics