Hardware Design Flow
Creating a Project
Creating a XiBIF project means that a new directory is created and set up for hardware design. The necessary project files are created.
xibif new -n <project name> -p <project path> -b <fpga board> -x <xilinx tool path> -v <xilinx version>
The project_path is the directory in which you want to create the project. If the directory already exists you have the option to
--forceor--nukethe project.--forcedeletes only the project-related files from the project path whereas--nukedeletes everything in the project path.Use project_name to give a meaningful (!) name to your new project.
The xilinx_path is the path to your Xilinx installation, which typically is
C:\Xilinx.The xilinx_version specifies which version to use, so if you have the Xilinx toolchain with version 2024.2 installed, then use 2024.2.
The board option allows you to select between the different boards supported by the XiBIF platform.
Warning
There are some restrictions on the name your project can have. The project name can only consist of alphanumeric characters (a-z, A-Z, and 0-9) and underscores. Any other character is illegal. Furthermore, the path to a project folder is also restricted to alphanumeric characters, underscores, dashes, and dots.
If you are still in the habit of using spaces in your project names and/or paths, please get rid of them! Spaces in names are a pain to deal with when programming, especially when going cross-platform.
Note
If you are interested, the Regex patterns to match are:
^[a-zA-Z0-9_]+$for the project name^[a-zA-Z0-9_/-\.]+$for project paths on Unix-based systems^[a-zA-Z]:[\\a-zA-Z0-9_/\-\.]+$for project paths on Windows
Building a Project
To generate something that can be used by the FPGA to boot from, you must build the project. Building refers to many steps: logic synthesis, place-and-route, bitstream generation, hardware export, software compilation, and finally bundling of the bitstream with the software to generate a boot file from which the FPGA can load its hardware and software configuration.
xibif build
This executes all Vivado and Vitis build stages for the project. Assuming that your design passes all timing checks and has no violations in Vivado, this step should succeed. Since this is a complete run-through of all Vivado and Vitis design stages, it takes a while, so go get a coffee (or tea, whichever you prefer).
Once finished, you will find a lot of reports in hw/results/ containing information about the design run, such as FPGA utilization, timing reports, and more. In the same folder, you will also find the aforementioned BOOT.bin file which you can copy to an SD card for the FPGA to boot from.
Hint
If you need to open Vivado or Vitis, this can be done with xibif start vivado or xibif start vitis. This will then open the respective tool with your project loaded.
Building in Steps
If you only wish to build the hardware project, you can use
xibif build --vivado all
to build the complete hardware project, or
xibif build --vivado synthesize
to only perform the synthesis stage of the hardware building step. There are other steps available, all of which you can see when running xibif build --help
It is also possible to combine multiple steps. They will be executed in the correct order, regardless of the order in which you specify them. For example, to build the bitstream and then export the hardware design for Vitis, and finally build the complete software project, use
xibif build --vivado bitstream --vivado export --vitis all
Note
Building in steps can be especially useful when things go wrong. You usually do not want to re-build everything every single time. But be aware: for many designs, a failure to build can come from earlier errors.
Flashing the Bitstream
The process of configuring the FPGA with the bitstream is referred to as flashing.
xibif flash
This uses the Xilinx Hardware server to flash the bitstream onto the FPGA. Be aware that the FPGA must already have an appropriate xibif software part for this to work. This command exists to speed up hardware iterations.
Hint
You can start the hardware server on your computer by running xibif start hardware_server.
Warning
The flashed bitstream is not persistent! If you wish to boot using a bitstream every time, you need to build the hardware and software part of the project and copy the BOOT.bin file to the FPGA’s SD card.