Why Does It Take So Long to Compile an FPGA VI for a CompactRIO in Hybrid Mode?

Updated Aug 1, 2023

Reported In

Hardware

  • CompactRIO Controller

Software

  • LabVIEW FPGA Module
  • LabVIEW Real-Time Module

Driver

  • NI-RIO

Issue Details

I have a CompactRIO (cRIO) set up such that some of my modules are utilizing Scan Mode and some of my modules have custom code written in an FPGA VI.  My project looks similar to the one pictured below with some modules under the Real-Time (RT) Target and some modules under the FPGA Target.  The custom code for my FPGA VI is very simple but the compile time is much longer than I would have expected. Why does it take so long to compile the FPGA code?

 

Solution

In the project configuration you have modules that will utilize both the RIO Scan Engine and FPGA mode. Therefore, the FPGA bit file will need to incorporate both of these elements.  The result of your compilation is a single bitfile that supports the Scan Mode features for modules configured to use Scan Mode as well as your custom FPGA logic that communicates directly with the remaining I/O modules.  

During an FPGA compile, LabVIEW performs a great deal of optimization to reduce digital logic and create an optimal implementation of the LabVIEW application.  Behind the scenes, your graphical code is translated to text-based VHDL code. Then industry standard Xilinx ISE compiler tools are invoked and the VHDL code is optimized, reduced, and synthesized into a hardware circuit realization of your LabVIEW design. 

This configuration with modules under the RT target (utilizing the RIO Scan Interface Framework) and under the FPGA target is known as hybrid mode.  It is important to note that when in this Hybrid Mode, the RIO Scan Engine will still utilize two of your DMA (Direct Memory Access) channels.  These DMA channels are reserved and will not be available for use in your FPGA code. 

To learn how to setup Hybrid Mode, please see this Knowledge Base How Can I Use Scan Engine and FPGA Simultaneously on a CompactRIO (Hybrid Mode)?

Learn about different options for compiling FPGA code as well as how to compile faster in Compile Faster with the LabVIEW Compile Cloud Service