1. FPGA Development
The introduction of FPGAs into embedded system design has made it possible to create high-performance digital logic without the need for custom ASIC design. Traditionally, FPGA development is performed with text-based hardware description languages such as VHDL or Verilog, which is written by digital design engineers. Unfortunately, due to challenging language semantics, these hardware description languages make it difficult to take advantage of the full capabilities of FPGA design. This is evidenced by the embedded industries quest to find higher-level abstractions for FPGA design, such as C to gates tools, or graphical programming languages such as LabVIEW FPGA.
Because LabVIEW is a full-featured programming language, developers familiar with traditional text-based programming languages such as C will feel comfortable while using the environment, while at the same time be able to take advantage of a new hardware platform – FPGA.
Figure 1. Develop FPGA code using LabVIEW FPGA
2. CompactRIO Platform
The NI CompactRIO platform offers a low-cost reconfigurable embedded system designed for applications that require high performance and reliability. The system combines an open embedded architecture with small size, extreme ruggedness, and hot-swappable industrial I/O modules. The platform is a packaged embedded system that has been ruggedized for industrial environments. In addition to the CompactRIO platform, NI Single-Board RIO offers the same architecture without the packaging.
Figure 2. CompactRIO and NI Single-Board RIO Embedded Hardware Platforms
The RIO platform comprises two programmable targets: PowerPC-based processor and an FPGA. LabVIEW is distinctly suited for FPGA programming because it clearly represents parallelism and data flow. With the LabVIEW FPGA Module, you can create custom measurement and control hardware without low-level hardware description languages or board-level design. You can use this custom hardware for unique timing and triggering routines, ultrahigh-speed control, interfacing to digital protocols, digital signal processing (DSP), and many other applications requiring high-speed hardware reliability and tight determinism.
Figure 3. RIO Embedded Hardware Architecture
The PowerPC processor in the CompactRIO architecture runs the VxWorks operating system from Wind River. There are two methods to develop software for the VxWorks target: LabVIEW Real-Time and C. With LabVIEW Real-Time, you can develop LabVIEW applications to run on the embedded system and communicate easily with the FPGA target through high-level abstraction. With the latest version of the NI-RIO drivers, C programmers can directly program the PowerPC processor and interface with the FPGA.
Figure 4. Develop C or LabVIEW Code to the Target Real-Time Processor of RIO Architecture
3. Using the C Interface to LabVIEW FPGA
With the C Interface to LabVIEW FPGA, you can program the real-time VxWorks operating system C tools such as Wind River Workbench or the GNU GCC tool chain for VxWorks.
You can obtain the GNU tool chain for VxWorks either by purchasing a VxWorks development license from Wind River or by downloading the redistributable GNU tool chain attached to this document. By purchasing VxWorks, you can use the Wind River Workbench IDE, featuring source code-level debugging and build management. The redistributable GNU tool chain offers debugging only at the assembly code level, and you must use the included GNU Make to build binaries.
Figure 5. Software Tools Stack for C Code Development
Once the LabVIEW FPGA code is developed, a header file is generated. This provides an interface for accessing controls, indicators, DMA FIFOs, interrupts, and arrays. The header file must be included in the C-based application.
Figure 6. Wind River Workbench IDE Option for Developing Embedded Applications
Including the provided header file into the VxWorks project helps the programmatic interface to communicate with LabVIEW FPGA.
To learn more about configuring your VxWorks development environment and deploying compiled C code, visit Deploying Applications to VxWorks Targets.
4. Additional Resources