In this series:
Nutaq provides rapid prototyping platforms equipped with an embedded PC and an FPGA. However, a platform’s hardware design alone does not enable rapid prototyping, the platform also requires the necessary software tools. On the FPGA side, Nutaq’s Board Software Development Kit (BSDK) includes IP cores that simplify the integration of a wide variety of FPGA mezzanine cards (FMCs) and implement specific functionalities. For example, the Radio420M FMC is a 2×2 MIMO radio transceiver for the PicoSDR platform. The functionalities provided by the FPGA cores include sending and receiving baseband IQ samples, managing the radio clock and configuring PLLs, disciplining the radio clock to a GPS PSS signal, and calibrating the DC offset and IQ imbalance.
On the PC side, Nutaq's BSDK includes the following application programming interfaces (API) for both Windows and Linux:
- C/C++ API
- Command line interface (CLI)
- GNU Radio plug-in (Linux only)
Each API exposes a set of functions for controlling the FPGA cores and streaming data over PCIe or Ethernet with low latency between the PC and the FPGA. Nutaq’s 2×2 MIMO OFDM reference design with QAM-64 modulation implements a physical layer (PHY) based on the IEEE 802.11a standard. This reference design is provided with the PicoSDR platform and makes use of the BSDK IP cores to interface the FPGA PHY to the radio transceivers.
Figure 1: FGPA cores for interfacing the radio digital-analog converters (DACs) in the transmitter path
Figure 2: FGPA cores for interfacing the radio analog-digital converters (ADCs) in the receiver path
The reference design uses the C/C++ API functions to configure and calibrate the transceivers externally from a PC and handle real-time data exchange between the FPGA PHY and the upper layers of a stack running on the PC. In Figure 3 and 4, RTDEx stands for Real-Time Data Exchange and the cores can be instanced for gigabit Ethernet or PCI Express.
Figure 3: FGPA cores for interfacing upper layers running on a PC, in the transmitter path
Figure 4: FGPA cores for interfacing upper layers running on a PC, in the receiver path
The reference design includes a C/C++ application that mimics the function of the upper layers. It feeds HD video data to the PHY for the Tx path and receives the data stream from the PHY for the Rx path. Visualization of the received data stream is handled with the VLC media player.
Figure 5: High-level FPGA cores and interface to the upper layers running on a PC
This C/C++ application is for Windows only. In this two-part blog series, I demonstrate the portability of the C/C++ applications developed with the Nutaq API. I take the provided Windows application, port it to Linux Fedora, and demonstrate real-time wireless video transmission in Linux using Nutaq’s OFDM PHY.
Compiling the FPGA design
The first step is to compile the System Generator FPGA design that implements the PHY in the form of a Simulink model. The compiled result is an FPGA binary file, ready to be loaded in the PicoSDR platform with Xilinx Impact or the Nutaq CLI.
Figure 6: PicoSDR FGPA bit file being compiled with Xilinx System Generator
What’s provided for Windows
Under Windows, the following files are included in the Nutaq reference design for the implementation, building, and launching of the C/C++ application that configures the radio and streams the data to the FPGA PHY:
- The C/C++ source code for the application responsible for configuring and calibrating the Radio420M, initializing the RTDEx streaming channels, reading and sending HD video data to the PHY, and receiving data from the PHY and writing it to a UDP socket for visualization in VLC media player.
- A Visual Studio project to compile the C/C++ source code and build the application’s executable.
- A launch script (batch file) to launch the application by invoking the executable with the proper parameters such as the IP addresses of the PicoSDR and the PC as well as the path to the HD video file used as a data source.
Figure 7: OFDM reference design files under Windows
Porting the Visual Studio project to a Linux make file
Knowing that the BSDK API and examples provided by Nutaq are cross-platform, I looked in my Nutaq installation folder on my Linux machine to see if I could find a Linux project to use as a baseline for my new project. Browsing the documentation folder (/opt/Nutaq/ADP6/ADP_MicroTCA/sdk/doc/API), I found an example that used the same boards as my PicoSDR: a Radio420X and the Perseus601X.
The example is documented in Perseus_Examples_Radio420.pdf. The path for the project folder is: /opt/Nutaq/ADP6/ADP_MicroTCA/sdk/examples/perseus6010_radio420x_rtdex_record_playback/host/prj_linux
The folder contains 3 files:
I created a new folder structure for my project and then copied the build script (build_demo.sh) and make file (Makefile).
Figure 8: Build script and make file copied over from the Radio420 project
As the purpose of the build script is to create a “bin” directory that stores the executable after it is built and to simply invoke the make file, I left script as-is.
Figure 9: Leaving the build script as-is
The function of the make file is to indicate the C source files to compile, the compiler options, the libraries to link, and the name of the new executable. I removed any unnecessary C files from the make file, changed the name of the main C file to the same name as used by the Windows OFDM project, and changed the name of the executable output file.
Figure 10: Updating the make file
Porting the launch script to Linux
To start, I copied the launch script from the Radio420X example and renamed it.
Figure 11: Launch script copied over from the Radio420 project
The launch script from the Radio420 project only invoked the executable with hard-coded arguments, whereas the launch script (batch file) from the Windows OFDM project uses variables to pass the IP addresses and data file as parameters:
%APP_ROOT%perseus6010_radio420x_ofdm.exe %IP_ADDR_PERSEUS% %IP_ADDR_HOST% %FILENAME%
I modified the Linux OFDM launch script in a similar way and changed the name of the executable to match the make file.
Figure 12: Edited launch script
In Part 2 of this blog series, I explain how to port the C code to Linux and build the application.