LabVIEW FPGA IP Export Utility Getting Started Guide
LabVIEW FPGA IP Export Utility Getting Started Guide
Export Utility
March 2020
The LabVIEW FPGA IP Export Utility allows you to develop an FPGA algorithm in the LabVIEW
FPGA Module and export the algorithm as IP (Intellectual Property) to be used on Xilinx Vivado FPGA
devices. The Utility provides two editions: LabVIEW FPGA Netlist Export Utility and LabVIEW FPGA
VHDL Export Utility. Use the LabVIEW FPGA Netlist Export Utility to export the algorithm in
encrypted netlist format. Use the LabVIEW FPGA VHDL Export Utility to export the algorithm in
encrypted netlist or plaintext VHDL format. You can then integrate the IP in your Vivado project and use
the IP on any Xilinx Vivado FPGA device of the same family.
This getting started manual assumes you are familiar with the LabVIEW FPGA module and Vivado
Design Suite.
Contents
Installation..................................................................................................................................................... 2
Getting Started with an Example .................................................................................................................. 2
Developing FPGA Algorithm ....................................................................................................................... 2
Determining Run-Time Behavior of Your FPGA VI ............................................................................... 2
Creating FPGA VIs ................................................................................................................................... 4
Exporting IP .................................................................................................................................................. 6
Choosing an Export Mode ........................................................................................................................ 6
Exporting IP .............................................................................................................................................. 6
Understanding IP Ports ................................................................................................................................. 8
Clock Ports ................................................................................................................................................ 9
Reset and Enable Ports.............................................................................................................................. 9
Data Ports .................................................................................................................................................. 9
Using IP in a Vivado Project ...................................................................................................................... 10
Importing IP Source Files ....................................................................................................................... 10
Instantiating IP ........................................................................................................................................ 10
Running Behavioral Simulation .............................................................................................................. 13
Appendix A, Using Single Shot IP ............................................................................................................. 13
Appendix B, Handling Multiple Clock Domains........................................................................................ 14
Exporting Every Clock Domain Separately ............................................................................................ 14
Using Synchronous Clocks ..................................................................................................................... 15
Installation
Refer to the readme file at labview\readme\readme_FPGA_IPExport.html for information about
system requirements, installation and activation instructions.
Page 2 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
If you export this VI as IP, the IP runs freely and does not stop.
| ni.com | Getting Started with the LabVIEW FPGA IP Export Utility Page 3 of 17
Creating FPGA VIs
Creating an FPGA VI for IP export is similar to creating any other FPGA VI. The following are special
considerations for creating an FPGA VI for IP export:
FPGA Target Family
Make sure the FPGA target that your FPGA VI runs on belongs to the same FPGA family as the target
where you will run the exported IP.
To check the family of your FPGA target in LabVIEW, right click the FPGA target in the project tree and
select Properties.
Page 4 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
Properties>>Top-Level Clock, and select the clock that you created as the top-level clock.
| ni.com | Getting Started with the LabVIEW FPGA IP Export Utility Page 5 of 17
o Peer-to-Peer (P2P) FIFO
o DRAM Memory
o I/O nodes
o Interrupt
o User-Defined Variable
o User-defined component level IP (CLIP)
o Local variables in the top-level FPGA VI. You can use local variables in non top-level VIs.
Refer to the FPGA Module Help for more information about creating FPGA VIs.
Exporting IP
After you complete your FPGA algorithm in the FPGA Module, you can export the algorithm as IP for
integration with your Vivado project.
Exporting IP
In LabVIEW, complete the following steps to export your FPGA VI as IP:
1. From the Project Explorer window, right-click Build Specifications under your FPGA target
and select New>>Compilation from the shortcut menu.
2. In the Compilation Properties dialog box, specify the following options that configure how to
export the FPGA algorithm as IP. Ignore the other options.
o Information page
o Build specification name
o Allow removal of implicit enable signals inside single-cycle Timed Loops
Note This option is only visible for targets that support removing implicit enable
signals.
o
Source Files page
o Top-Level VI
3. Click OK to close the dialog box.
4. Right-click the build specification you created and select one of the following options:
Page 6 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
o Export VI to Netlist File—Exports the IP in encrypted netlist mode.
Note If you do not see this option, check the activation status of the FPGA IP Export
Utility in NI License Manager.
o Export VI to Intermediate Files—Exports the IP in plaintext mode.
Note This option is available only if you have a valid license for the LabVIEW FPGA
VHDL Export Utility. Refer to the readme file at
labview\readme\readme_FPGA_IPExport.html for activation instructions.
| ni.com | Getting Started with the LabVIEW FPGA IP Export Utility Page 7 of 17
Figure 6, output files for encrypted netlist mode
If you export the IP in encrypted netlist mode, the intermediate files directory includes two files.
NiFpgaIPWrapper_<name>.vhd is the VHDL wrapper to help you integrate the IP in Vivado. Use it as
the top-level entity of exported IP. NiFpgaAG_<name>.dcp is the implementation of exported IP.
If you export the IP in plaintext mode, the intermediate files directory includes more files. The VHDL
wrapper is the same the encrypted netlist mode. The other files are IP source files. You can synthesize the
IP source files into an unencrypted netlist by running the .tcl file from Vivado Tcl Console. The netlist
file has same name as the one generated in encrypted netlist mode.
Notes
• LabVIEW overwrites the intermediate files directory the next time you build or export your
FPGA VI.
• LabVIEW does not export Xilinx design constraints (.xdc). Exported IP does not have physical
constraints. If the algorithm is contained in one clock domain, the IP does not require extra timing
constraints. If there are multiple clock domains, refer to Appendix B, Handling Multiple Clock
Domains.
Understanding IP Ports
The VHDL wrapper file provides detailed description for each port of exported IP. They are organized in
three groups: reset and enable ports, data ports, clock ports. Here is an example port description, exported
from the VI in Figure 1.
Page 8 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
Clock Ports
This group contains all clocks in design. The VHDL wrapper shows the clock names and the frequencies
as configured in LabVIEW. One clock is marked with “base clock”, which is the top-level clock of the
FPGA target in LabVIEW. enable_in, enable_out, enable_clr ports belong to this clock domain.
If your algorithm uses multiple clocks, refer to Appendix B, Handling Multiple Clock Domains for more
information.
• reset: asynchronous reset port. Use this port in combination with the enable_in port to reset
the IP.
• enable_in: enable in port. Must be synchronous to the base clock. Assert this signal to start
running the IP. This signal must remain asserted when the IP is running. De-assert this signal
when you reset the IP.
• enable_out: (output) enable out port. It is synchronous to the base clock. When this signal is
asserted, the IP stops. Ignore this signal for free running IP.
• enable_clr: enable clear port. Must be synchronous to the base clock. Assert this signal for one
cycle to prepare the single shot IP for restart. Tie this signal to ‘0’ for free running IP.
Data Ports
Data ports map to user-created controls and indicators in the top-level VI. The VHDL wrapper shows the
name, data type, and clock domain defined in your FPGA VI for every data port. The VHDL port name
has the “ctrlind_” prefix to avoid name conflict with non-user ports.
A LabVIEW data type is mapped to an std_logic_vector in VHDL. The direction of range is
descending, or (X downto 0). For scalars, Most Significant Bit (MSB) is placed at the left side of the
std_logic_vector. For arrays and clusters, the first element maps to the left-most bits and the last
element maps to the right-most bits. In the following example, Cluster has 33 bits. Bit 32 downto 25 is
Elem 0. Bit 24 downto 17 is Elem 1. Bit 16 downto 1 is Numeric. Bit 0 is Boolean.
When reading or writing data ports, if the corresponding controls and indicators are placed outside a
SCTL, there is no external indication at which clock cycles they are accessed by the IP. If the
| ni.com | Getting Started with the LabVIEW FPGA IP Export Utility Page 9 of 17
corresponding controls and indicators are placed inside a SCTL, the ports are accessed at every clock
cycle when the corresponding SCTL is running.
Note NI recommends that you use the Xilinx Vivado version that’s compatible with the corresponding
LabVIEW version. Visit ni.com/info and enter the Info Code XilinxCompileTools for the version of Xilinx
Vivado compilation tool that’s recommended by each NI hardware and LabVIEW version.
Behavioral correctness and synthesizability of IPs exported from FPGA IP Export Utility are all validated
against the version of LabVIEW FPGA Module Xilinx Vivado Compilation Tool that is released together
with the same version of LabVIEW FPGA Module. Please note that this Vivado tool can contain patches
specific to NI and be different from the standard Xilinx Vivado version.
Instantiating IP
After you import the IP source files into your Vivado project, complete the following steps to instantiate
the top-level entity of exported IP (NiFpgaIPWrapper_<name>.vhd) in your design:
1. Connect the clock port to the existing clock signal in your design. NI recommends that you use
a frequency that matches the one defined in your FPGA VI and set proper timing constraints for
the clock signal. Otherwise, some functions may not behave in the same way as in the FPGA VI.
2. Connect the reset signal to the reset port. Connect enable ports to appropriate signals.
3. Connect data ports to appropriate signal sources and sinks. Make sure the clock domains are
correct.
Resetting IP
You need to reset the IP after power on or when you want to re-initialize the internal states. In your
VHDL code, complete the following steps to reset an IP:
1. De-assert reset, enable_in and enable_clr.
2. Wait until clock signal is available.
3. De-assert all data valid signals on input data ports.
4. Assert reset for minimum reset assertion length clock cycles.
5. De-assert reset for minimum reset de-assertion length clock cycles.
Page 10 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
6. Keep enable_in de-asserted for minimum re-initialization length clock cycles.
You can find the minimum clock cycles information in the VHDL wrapper.
The following figure shows a typical reset sequence for the IP exported from the VI in Figure 1. You can
see its VHDL wrapper in Figure 7. Minimum reset assertion length is 1 base clock cycle. De-assertion
length is 40 base clock cycles. Minimum enable_in re-initialization length is 7 base clock cycles.
Starting IP
In your VHDL code, complete the following steps to start a free running IP:
1. Tie enable_clr to ‘0’, leave enable_out open, and keep reset and enable_in de-
asserted.
2. De-assert all input valid signals on data ports.
3. Assert enable_in to start the IP and keep it asserted.
4. Monitor the output ports that correspond to the indicators that are connected to the SCTL loop
iteration
5. When the values start changing, read or write other data ports.
, as described in the Creating FPGA VIs section.The following figure shows a typical startup sequence for
the IP exported from the VI in Figure 1. The ctrlind_06_teration signal corresponds to the
iteration indicator in Figure 1. Do not change any data input signals or read any data output signals
until iteration is greater than 0.
| ni.com | Getting Started with the LabVIEW FPGA IP Export Utility Page 11 of 17
Figure 10, typical IP start sequence
Interfacing AXI IP
Complete following actions if your VI uses four-wire handshaking signals and you want to interface the
exported IP with another AXI4-Stream IP in VHDL. Four-wire protocol and AXI protocol have the
following differences:
• AXI data signals are byte aligned. The bit width must be integer multiple of 8 bits.
• ready for input in four-wire means the IP is ready to accept new data in the next clock cycle.
s_axis_tready in AXI means the IP is ready to accept new data in current clock cycle.
Page 12 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
Running Behavioral Simulation
NI recommends that you create a VHDL test bench for the exported IP and run behavioral simulation to
verify that its functionality matches your expectation before integrating the IP in your design. After the
integration, create test benches at different levels of your design to verify the IP works correctly with
other parts of your design.
• You need the enable_out signal to indicate the IP is stopped and the enable_clr signal to
restart the IP.
• Do not change input data when the IP is running because you do not know at which clock cycles
the input data is read.
• Do not read output data until enable_out asserts for the same reason.
• Just like re-running a VI in LabVIEW, First Call? and Feedback Node configured with Initialize
on First Call are re-initialized after IP restarts.
In your VHDL code, complete the following steps to restart the IP after it is stopped:
1. When the IP is running, ensure enable_in is asserted, reset, enable_clr and enable_out
are de-asserted.
2. When enable_out asserts, the IP is stopped. Then read output data signals.
3. Assert enable_clr for one clock cycle. The earliest time to assert enable_clr is the same
clock cycle when enable_out asserts.
4. De-assert enable_in signal at the same cycle enable_clr asserts. Keep enable_in de-
asserted for minimum re-initialization length clock cycles.
5. Set new input data signals.
6. Assert enable_in to restart the IP. You can set input data signals and assert enable_in at the
same clock cycle.
The following figure shows the header of VHDL wrapper for the IP exported from the VI in Figure 2.
You can see the minimum re-initialization length is 7 clock cycles.
| ni.com | Getting Started with the LabVIEW FPGA IP Export Utility Page 13 of 17
Figure 13, VHDL wrapper for the IP exported from the VI in Figure 2
The following figure shows a typical restart sequence for the IP.
Page 14 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
2. For every portion, set the top-level clock of the FPGA target to the clock you intend to use. Then
export that portion into an IP.
3. In Vivado, re-create all clocks with the same frequencies as in LabVIEW. Create clock period
timing constraints for each clock.
4. Import all IPs, implement clock domain crossing in VHDL with appropriate methods.
5. Create appropriate timing constraints for the implemented clock domain crossing paths.
The following is an example of rewriting your FPGA VI to export every clock domain separately.
In the original VI, as shown in the following figure, there are two SCTLs running at 90 MHz and 70
MHz, respectively. The FIFO implements the clock domain crossing.
Figure 16, split original VI to two separate VIs running in their own clock domains
In Vivado, connect the two IP blocks with a FIFO, as depicted in the following figure.
| ni.com | Getting Started with the LabVIEW FPGA IP Export Utility Page 15 of 17
In the following example, the 80 MHz clock is derived from 40 MHz Onboard Clock and frequency
multiplier is 2, hence the two clocks are synchronous. You can select 40 MHz Onboard Clock as the top-
level clock for the FPGA target and then export this VI.
Since the two clocks are synchronous, Vivado is able to analyze all clock domain crossing paths between
the two clock domains.
Page 16 of 17 | ni.com | Getting Started with the LabVIEW FPGA IP Export Utility
Refer to the NI Trademarks and Logo Guidelines at ni.com/trademarks for more information on NI trademarks. Other product and company names
mentioned herein are trademarks or trade names of their respective companies. For patents covering NI products/technology, refer to the appropriate
location: Help»Patents in your software, the patents.txt file on your media, or the NI Patent Notice at ni.com/patents. You can find information
about end-user license agreements (EULAs) and third-party legal notices in the readme file for your NI product. Refer to the Export Compliance
Information at ni.com/legal/export-compliance for the National Instruments global trade compliance policy and how to obtain relevant HTS codes,
ECCNs, and other import/export data. NI MAKES NO EXPRESS OR IMPLIED WARRANTIES AS TO THE ACCURACY OF THE INFORMATION
CONTAINED HEREIN AND SHALL NOT BE LIABLE FOR ANY ERRORS. U.S. Government Customers: The data contained in this manual was
developed at private expense and is subject to the applicable limited rights and restricted data rights as set forth in FAR 52.227-14, DFAR 252.227-
7014, and DFAR 252.227-7015.