FPGA Build Instructions - jhu-cisst/mechatronics-firmware GitHub Wiki

Build using CMake

Building with CMake (and the Xilinx command line tools) is straighforward if you already know how to use CMake. If not, please see the CMake documentation. The only possible issue is finding the Xilinx command line tools.

CMake will automatically find the Xilinx command line tools if the Xilinx binary directory is in the PATH. Otherwise, the easiest way to find them is to first set the XILINX_ISE_BINARY_DIR variable in CMake and then configure again, which allows CMake to automatically find them. It is also necessary to set the XILINX_ISE_ROOT_DIR variable to the path of your ISE installation (on Linux, make sure it is something like .../Xilinx/14.7/ISE_DS and not .../Xilinx/14.7/ISE_DS/ISE).

It is not necessary to add the Xilinx binary directory to your PATH (or LD_LIBRARY_PATH on Linux) to be able to compile the software using the CMake-generated makefiles. On Linux, it is better not to modify your environment (e.g., do not run source settings64.sh, as recommended by Xilinx) because the Xilinx versions of the system libraries, such as libstdc++.so.6, are likely to be incompatible with other software.

When using CMake on Windows, you can choose the NMake Makefiles generator, or you can generate a Visual Studio solution file.

Running make (on Linux) or nmake (on Windows) will build all versions of firmware. Note that if you have forgotten to get a Xilinx ISE license file, the first few steps will work and the build will fail when running the map tool.

CMake implementation

The cmake subdirectory contains the files FindXilinxISE.cmake and UseXilinxISE.cmake. The UseXilinxISE file defines the following macros:

  • ise_ipcoregen: this builds the IP Core files used by the firmware
  • edk_platgen: this builds the IP files created in Xilinx Platform Studio (XPS), for FPGA V3
  • ise_compile_fpga: this is the main macro that compiles the FPGA firmware, using the Xilinx xflow tool with customized .flw and .opt files
  • ise_compile_fpga_old: this is a previous implementation (no longer maintained) that compiles the FPGA firmware by invoking the individual Xilinx command line tools, such as xst, ngdbuild, map and par