This chapter serves as documentation for the XiBIF package.
XiBIF API
from xibif import api
to import api into your Python script.
api.setup
The setup API populates an initialized XiBIF workspace with a valid project file.
Warning
Some of the APIs depend on files being present that are created through different API calls.
Commands
Setup API for XiBIF.
- setup_constraint_files(board: XilinxBoard, constraint_folder: XibifPath = XibifPath('hw/constraints'), link: bool = False) None
Setup XiBIF constraint files.
Copies the constraint files for an FPGA board to the specified folder. XiBIF uses chips rather than boards as targets. As a consequence, certain settings (e.g. the clock pin) must be manually defined in the constraint file.
The constraint files are specific to one target only! There is no guarantee for compatibility when switching to another chip or board revision.
- Parameters:
board (XilinxBoard) – The board for which the constraint files should be copied.
constraint_folder (XibifPath) – The target folder where the constraint files should be copied. Defaults to XibifDefaults.CONSTRAINT_FOLDER.
link (bool) – If True, create symbolic links instead of copying the files. Defaults to False.
- setup_demo_files(demo_folder: XibifPath = XibifPath('sw'), link: bool = False)
Set up demo files.
Copies demo software files to the specified folder. The demo files contain explanatory code snippets.
- Parameters:
demo_folder (XibifPath) – The target folder where the demo software files should be copied. Defaults to XibifDefaults.SW_FOLDER.
link (bool) – If True, create symbolic links instead of copying the files. Defaults to False.
- setup_git_files(git_folder: XibifPath = XibifPath('.'), link: bool = False) None
Copy Git configuration files.
Copies the Git configuration files to the specified destination folder. The main file to copy it the .gitignore file that is set up to ignore all files generated by the toolchain.
- Parameters:
git_folder (XibifPath) – The target folder where the Git files should be copied. Defaults to XibifDefaults.GIT_FOLDER.
link (bool) – If True, create symbolic links instead of copying the files. Defaults to False.
- setup_git_repository(git_folder: XibifPath = XibifPath('.')) None
Initialize a Git repository.
Initializes a Git repository in the specified folder if it does not exist.
- Parameters:
git_folder (XibifPath) – The target folder where the Git repository should be initialized. Defaults to XibifDefaults.GIT_FOLDER.
- Raises:
XibifEnvironmentError – If Git is not installed or not found in the system path.
- setup_hdl_files(src_folder: XibifPath = XibifPath('hw/src'), tb_folder: XibifPath = XibifPath('hw/tb'), link: bool = False) None
Setup XiBIF HDL files.
Initiailies the XiBIF HDL dependencies in the specified folders. The XiBIF HDL dependencies contain all hardware descriptions of the FIFOs that are used for data streaming in the PL as well as open-source HDL code for AXI handling (see open-logic https://github.com/open-logic/open-logic)
- Parameters:
src_folder (XibifPath) – The target folder where the HDL source files should be copied. Defaults to XibifDefaults.HDL_SRC_FOLDER.
tb_folder (XibifPath) – The target folder where the HDL testbench files should be copied. Defaults to XibifDefaults.HDL_TB_FOLDER.
link (bool) – If True, create symbolic links instead of copying the files. Defaults to False.
- setup_openlogic_files(openlogic_folder: XibifPath = XibifPath('hw/open-logic'))
Add open-logic as a sub-module to the project.
Adds open-logic as a sub-module to the project in the specified directory such that open-logic blocks can be used in the HDL design.
- Parameters:
openlogic_folder (XibifPath) – The target folder where the OpenLogic repository should be cloned as a Git submodule. Defaults to XibifDefaults.OPENLOGIC_FOLDER.
- Raises:
XibifEnvironmentError – If Git is not installed or not found in the system path.
XibifRuntimeError – If no Git repository is found in the target folder or any of its parent directories.
- setup_openlogic_vivado(project_name: str, xilinx_version: XilinxVersion, vivado_folder: XibifPath = XibifPath('hw/vivado'), openlogic_folder: XibifPath = XibifPath('hw/open-logic'), runtime: VivadoTclShell | None = None, xilinx_path: XibifPath | None = None) None
Set up Vivado to use open-logic files.
Sets up the XiBIF-required open-logic files in the Vivado project by importing the design files.
- Parameters:
project_name (str) – The name of the Vivado project where the OpenLogic files should be imported.
xilinx_version (XilinxVersion) – The Xilinx version to determine the appropriate commands and shell configuration.
vivado_folder (XibifPath, optional) – The folder where the Vivado project is located. Defaults to XibifDefaults.VIVADO_FOLDER.
openlogic_folder (XibifPath, optional) – The folder where the OpenLogic files are located. Defaults to XibifDefaults.OPENLOGIC_FOLDER.
runtime (Union[VivadoShell, None], optional) – An existing VivadoShell instance to use for executing commands. If None, a new shell will be created. Defaults to None.
xilinx_path (XibifPath | None, optional) – The path to the Xilinx installation directory. Required if runtime is None. Defaults to None.
- Raises:
XibifEnvironmentError – If xilinx_path is not provided when runtime is None.
- setup_register_files(reg_folder: XibifPath = XibifPath('hw/regs'), link: bool = False) None
Set up register dependencies.
Copies the XiBIF user register configuration and definition files to the specified directory.
- Parameters:
reg_folder (XibifPath) – The target folder where the register files should be copied. Defaults to XibifDefaults.REG_FOLDER.
link (bool) – If True, create symbolic links instead of copying the files. Defaults to False.
- setup_sigasi_project(project_name: str, sigasi_folder: XibifPath = XibifPath('.'), link: bool = False) None
Set up a Sigasi project for the XiBIF project.
Copies the Sigasi project files to the specified destination folder. The Sigasi project is set up such that all libraries and include directories are set up to work with a default XiBIF setup.
- Parameters:
project_name (str) – The name of the Sigasi project to be created.
sigasi_folder (XibifPath) – The target folder where the Sigasi project files should be copied. Defaults to XibifDefaults.SIGASI_FOLDER.
link (bool) – If True, create symbolic links instead of copying the files. Defaults to False.
- setup_vitis_project(project_name: str, board: XilinxBoard, xilinx_version: XilinxVersion, platform_name: str = 'xibif_platform', app_name: str = 'xibif', vitis_folder: XibifPath = XibifPath('hw/vitis'), results_folder: XibifPath = XibifPath('hw/results'), runtime: VitisPythonShell | VitisTclShell | None = None, xilinx_path: XibifPath | None = None, link: bool = False)
Set up a Vitis project.
Sets up a Vitis project with the specified name for a given toolchain version. The project setup consists of creating the workspace, platform and application. The source files required for a XiBIF application to run are added automatically, the linker script is adjusted for the project’s hardware target.
After setup, the application is built. :param project_name: The name of the Vitis project to be created. :type project_name: str :param board: The target FPGA board for the project. :type board: XilinxBoard :param xilinx_version: The Xilinx version to determine the appropriate commands and shell configuration. :type xilinx_version: XilinxVersion :param platform_name: The name of the platform to be created. Defaults to XibifDefaults.PLATFORM_NAME. :type platform_name: str, optional :param app_name: The name of the application to be created. Defaults to XibifDefaults.APP_NAME. :type app_name: str, optional :param vitis_folder: The folder where the Vitis project should be created. Defaults to XibifDefaults.VITIS_FOLDER. :type vitis_folder: XibifPath, optional :param results_folder: The folder where the generated application files should be saved. Defaults to XibifDefaults.RESULTS_FOLDER. :type results_folder: XibifPath, optional :param runtime: An existing VitisShell instance to use for executing commands. If None, a new shell will be created. Defaults to None. :type runtime: Union[VitisShell, None], optional :param xilinx_path: The path to the Xilinx installation directory. Required if runtime is None. Defaults to None. :type xilinx_path: XibifPath | None, optional :param link: If True, create symbolic links instead of copying the files. Defaults to False. :type link: bool
- Raises:
XibifEnvironmentError – If xilinx_path is not provided when runtime is None.
XibifGeneratedFileError – If the expected application file is not generated after running the Vitis commands.
- setup_vivado_project(project_name: str, board: XilinxBoard, xilinx_version: XilinxVersion, blockdesign: str = 'xibif_bd', vivado_folder: XibifPath = XibifPath('hw/vivado'), src_folder: XibifPath = XibifPath('hw/src'), constraint_folder: XibifPath = XibifPath('hw/constraints'), results_folder: XibifPath = XibifPath('hw/results'), runtime: VivadoTclShell | None = None, xilinx_path: XibifPath | None = None) None
Set up a Vivado project.
Sets up a Vivado project with a specified name for a given Xilinx version. The project is created inside vivado_folder, source and constraint files are added automatically.
- Parameters:
project_name (str) – The name of the Vivado project to be created.
board (XilinxBoard) – The target FPGA board for the project.
xilinx_version (XilinxVersion) – The Xilinx version to determine the appropriate commands and shell configuration.
blockdesign (str, optional) – The name of the block design to be created. Defaults to XibifDefaults.BLOCKDESIGN_NAME.
vivado_folder (XibifPath, optional) – The folder where the Vivado project should be created. Defaults to XibifDefaults.VIVADO_FOLDER.
src_folder (XibifPath, optional) – The folder containing the HDL source files to be added to the project. Defaults to XibifDefaults.HDL_SRC_FOLDER.
constraint_folder (XibifPath, optional) – The folder containing the constraint files to be added to the project. Defaults to XibifDefaults.CONSTRAINT_FOLDER.
results_folder (XibifPath, optional) – The folder where the generated hardware files should be saved. Defaults to XibifDefaults.RESULTS_FOLDER.
runtime (Union[VivadoShell, None], optional) – An existing VivadoShell instance to use for executing commands. If None, a new shell will be created. Defaults to None.
xilinx_path (XibifPath | None, optional) – The path to the Xilinx installation directory. Required if runtime is None. Defaults to None.
- Raises:
XibifEnvironmentError – If xilinx_path is not provided when runtime is None.
XibifGeneratedFileError – If the expected hardware file is not generated after running the Vivado commands.
- setup_vunit_python_files(vunit_folder: XibifPath = XibifPath('hw/tb'), link: bool = False) None
Setup Vunit files.
Copies the XiBIF Vunit dependencies to the specified folder.
- Parameters:
vunit_folder (XibifPath) – The target folder where the VUNIT Python files should be copied. Defaults to XibifDefaults.HDL_TB_FOLDER.
link (bool) – If True, create symbolic links instead of copying the files. Defaults to False.
api.register
The register API interfaces with Corsair and let’s you generate project-specific register files.
Commands
Register API for XiBIF.
- register_generate_custom(cfg_path: XibifPath, reg_path: XibifPath | None = None) None
Generate register files for a custom target.
- Parameters:
cfg_path (XibifPath) – The path to the configuration file for the custom target, which defines the generator and path information for each target.
reg_path (XibifPath | None, optional) – An optional path to the register map file to use for the generation. If not provided, the register map path specified in the configuration file will be used.
- register_generate_stream(uuid: XibifUUID) None
Generate register files for the stream target.
The given UUID is added to the register to validate their existence during runtime.
- Parameters:
uuid (XibifUUID) – The UUID value to set as the reset value for the UUID register in the stream target.
- register_generate_user(uuid: XibifUUID, cfg_path: XibifPath = XibifPath('hw/regs/config-regs'), reg_path: XibifPath | None = None) None
Generate register files for the user target.
The given UUID is added to the registers to validate their existence during runtime. By default, the XiBIF default user registers are generated, which can be overwritten with the default parameters.
- Parameters:
uuid (XibifUUID) – The UUID value to set as the reset value for the UUID register in the user target.
cfg_path (XibifPath, optional) – The path to the configuration file for the user target, which defines the generator and path information for each target. Defaults to XibifDefaults.REGISTER_USER_CFG.
reg_path (XibifPath | None, optional) – An optional path to the register map file to use for the generation. If not provided, the register map path specified in the configuration file will be used.
- register_generate_user_vivado(project_name: str, xilinx_version: XilinxVersion, blockdesign: str = 'xibif_bd', vivado_folder: XibifPath = XibifPath('hw/vivado'), disable_open_close: bool = False, runtime: VivadoTclShell | None = None, xilinx_path: XibifPath | None = None) None
Update the Vivado project with the user-generated register files.
- Parameters:
project_name (str) – The name of the Vivado project to update.
xilinx_version (XilinxVersion) – The Xilinx version to determine the correct commands and tool paths.
blockdesign (str, optional) – The name of the block design in the Vivado project to update. Defaults to XibifDefaults.BLOCKDESIGN_NAME.
vivado_folder (XibifPath, optional) – The folder where the Vivado project is located. Defaults to XibifDefaults.VIVADO_FOLDER.
disable_open_close (bool, optional) – Whether to disable opening and closing the project in Vivado, which can be useful if this function is called multiple times in a row. Defaults to False.
runtime (VivadoShell | None, optional) – An optional VivadoShell instance to use for running the commands. If not provided, a new shell will be created. Defaults to None.
xilinx_path (XibifPath | None, optional) – An optional path to the Xilinx installation directory, required if no runtime shell is provided. Defaults to None.
- register_get_checksum(cfg_path: XibifPath, reg_path: XibifPath | None = None) XibifChecksum
Calculate checksum for a register configuration.
The checksum for the register configuration can be used to validate a register configuration against a project file, verifying that they are compatible or have at the very least been generated at the same time.
- Parameters:
cfg_path (XibifPath) – The path to the configuration file for the register map, which defines the generator and path information for each target.
reg_path (XibifPath | None, optional) – An optional path to the register map file to use for the checksum calculation. If not provided, the register map path specified in the configuration file will be used.
- Returns:
XibifChecksum – The calculated checksum for the register map.
api.build
The build API allows you to build your project in Vivado and Vitis.
Commands
Build API for Vivado and Vitis project generation.
- build_vitis(project_name: str, board: XilinxBoard, xilinx_version: XilinxVersion, stages: list[VitisStage] | None = None, platform_name: str = 'xibif_platform', app_name: str = 'xibif', vitis_folder: XibifPath = XibifPath('hw/vitis'), results_folder: XibifPath = XibifPath('hw/results'), disable_open_close: bool = False, runtime: VitisPythonShell | VitisTclShell | None = None, xilinx_path: XibifPath | None = None) None
Build a Vitis project.
Builds a Vitis project for the given project name with the specified Xilinx version. When specific stages are given, only those stages are executed. When no stages are given, the complete Vitis flow is executed.
- Parameters:
project_name (str) – The name of the project to build.
board (XilinxBoard) – The target Xilinx board for the build.
xilinx_version (XilinxVersion) – The version of the Xilinx tools to use for the build.
stages (list[VitisStage] | None) – The stages of the build process to execute. If None, all stages will be executed.
platform_name (str) – The name of the platform to build. Default is XibifDefaults.PLATFORM_NAME.
app_name (str) – The name of the application to build. Default is XibifDefaults.APP_NAME.
vitis_folder (XibifPath) – The folder where the Vitis project is located. Default is XibifDefaults.VITIS_FOLDER.
results_folder (XibifPath) – The folder where the build results will be stored. Default is XibifDefaults.RESULTS_FOLDER.
disable_open_close (bool) – Whether to disable opening and closing the Vitis project during the build process. Default is False.
runtime (VitisShell | None) – An optional VitisShell instance to use for executing the build commands. If None, a new shell will be created. Default is None.
xilinx_path (XibifPath | None) – The path to the Xilinx tools installation. Required if runtime is None. Default is None.
- build_vitis_regenerate(project_name: str, board: XilinxBoard, xilinx_version: XilinxVersion, platform_name: str = 'xibif_platform', app_name: str = 'xibif', vitis_folder: XibifPath = XibifPath('hw/vitis'), results_folder: XibifPath = XibifPath('hw/results'), runtime: VitisPythonShell | VitisTclShell | None = None, xilinx_path: XibifPath | None = None) None
Regenerate a Vitis project.
Regenerates a Vitis project from a given project name. When working with Vitis, it can occur that a Vitis project file gets corrupted. The usual, best workaround is to re-generate the existing project from scratch.
Before the Vitis project is regenerated, a backup of the current Vitis project is generated.
- Parameters:
project_name (str) – The name of the project to regenerate.
board (XilinxBoard) – The target Xilinx board for the project.
xilinx_version (XilinxVersion) – The version of the Xilinx tools to use for the project.
platform_name (str) – The name of the platform to build. Default is XibifDefaults.PLATFORM_NAME.
app_name (str) – The name of the application to build. Default is XibifDefaults.APP_NAME.
vitis_folder (XibifPath) – The folder where the Vitis project is located. Default is XibifDefaults.VITIS_FOLDER.
results_folder (XibifPath) – The folder where the build results will be stored. Default is XibifDefaults.RESULTS_FOLDER.
runtime (VitisShell | None) – An optional VitisShell instance to use for executing the build commands. If None, a new shell will be created. Default is None.
xilinx_path (XibifPath | None) – The path to the Xilinx tools installation. Required if runtime is None. Default is None.
- build_vivado(project_name: str, xilinx_version: XilinxVersion, stages: list[VivadoStage] | None = None, blockdesign: str = 'xibif_bd', vivado_folder: XibifPath = XibifPath('hw/vivado'), results_folder: XibifPath = XibifPath('hw/results'), synthesize_run: str = '', implementation_run: str = '', disable_report: bool = False, disable_open_close: bool = False, runtime: VivadoTclShell | None = None, xilinx_path: XibifPath | None = None) None
Build a Vivado project.
Builds a Vivado project for the specified project name with the specified Xilinx version. If specific build stages are specified, only these stages are executed. When no stages are specified, the complete Vivado flow is executed.
- Parameters:
project_name (str) – The name of the project to build.
xilinx_version (XilinxVersion) – The version of the Xilinx tools to use for the build.
stages (list[VivadoStage] | None) – The stages of the build process to execute. If None, all stages will be executed.
blockdesign (str) – The name of the block design to build. Default is XibifDefaults.BLOCKDESIGN_NAME.
vivado_folder (XibifPath) – The folder where the Vivado project is located. Default is XibifDefaults.VIVADO_FOLDER.
results_folder (XibifPath) – The folder where the build results will be stored. Default is XibifDefaults.RESULTS_FOLDER.
synthesize_run (str) – The name of the synthesis run. Default is XibifDefaults.SYNTHESIS_NAME.
implementation_run (str) – The name of the implementation run. Default is XibifDefaults.IMPLEMENTATION_NAME.
disable_report (bool) – Whether to disable the generation of reports during the build process. Default is False.
disable_open_close (bool) – Whether to disable opening and closing the Vivado project during the build process. Default is False.
runtime (VivadoShell | None) – An optional VivadoShell instance to use for executing the build commands. If None, a new shell will be created. Default is None.
xilinx_path (XibifPath | None) – The path to the Xilinx tools installation. Required if runtime is None. Default is None.
api.flash
The flash API allows you to flash an FPGA.
Warning
The flashed bitstream is not persistent.
Commands
Flash API for XiBIF.
- flash_hardware_server(project_name: str, board: XilinxBoard, xilinx_version: XilinxVersion, ip: IPvAnyAddress = '127.0.0.1', port: Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=65535)])] = 3121, app_name: str = 'xibif', results_folder: XibifPath = XibifPath('hw/results'), runtime: VitisPythonShell | VitisTclShell | None = None, xilinx_path: XibifPath | None = None)
Flash an application to the FPGA.
Flashes an application file (defaults to generated project application) to an FPGA using Xilinx Hardware Server. The server may run locally or remote, if so, the IP of the remote host must be specified.
Note that the flashed application does not persist on the FPGA and is no longer available after a reboot.
- Parameters:
project_name (str) – The name of the project to flash.
board (XilinxBoard) – The target board for flashing.
xilinx_version (XilinxVersion) – The Xilinx version used for the project.
ip (IPvAnyAddress, optional) – The IP address of the hardware server. Defaults to ‘127.0.0.1’.
port (int, optional) – The port number of the hardware server. Defaults to 3121.
app_name (str, optional) – The name of the application to flash. Defaults to XibifDefaults.APP_NAME.
results_folder (XibifPath, optional) – The folder where the build results are located. Defaults to XibifDefaults.RESULTS_FOLDER.
runtime (VitisShell | None, optional) – An optional VitisShell instance to use for flashing. If None, a new shell will be created. Defaults to None.
xilinx_path (XibifPath | None, optional) – The path to the Xilinx tools installation. Required if runtime is None. Defaults to None.
- Raises:
XibifEnvironmentError – If no runtime shell is provided and the Xilinx path is not given.
XibifInvalidPathError – If any of the required files for flashing do not exist or are outdated.
api.simulate
The simulate API allows you to simulate your design in vunit.
Commands
Simulation API for XiBIF.
- simulation_clean_up_xml(junit_file: XibifPath = XibifPath('hw/results/test_output.xml'))
Clean up the JUnit XML file generated by VUnit.
- Parameters:
junit_file (XibifPath, optional) – The path to the JUnit XML file to clean up. Defaults to XibifDefaults.simulation_xml_file().
- simulation_compile(library_folder: XibifPath = XibifPath('hw/results/libraries'), simulator: VunitSimulator = VunitSimulator.MODELSIM) None
Compile the simulation libraries using VUnit.
- Parameters:
library_folder (XibifPath, optional) – The folder where the compiled libraries should be stored. Defaults to XibifDefaults.SIMULATION_LIBRARY_FOLDER.
simulator (VunitSimulator, optional) – The simulator to use for compilation. Defaults to VunitSimulator.MODELSIM.
- simulation_list_testbenches(run_file: XibifPath = XibifPath('hw/tb/run.py'), simulator: VunitSimulator = VunitSimulator.MODELSIM) None
List all available testbenches in the project using VUnit.
- Parameters:
run_file (XibifPath, optional) – The path to the VUnit run.py file. Defaults to XibifDefaults.SIMULATION_RUN_SCRIPT.
simulator (VunitSimulator, optional) – The simulator to use for listing testbenches. Defaults to VunitSimulator.MODELSIM.
- simulation_run(testbench: list[str] | None = None, gui: bool = False, run_file: XibifPath = XibifPath('hw/tb/run.py'), junit_file: XibifPath = XibifPath('hw/results/test_output.xml'), simulator: VunitSimulator = VunitSimulator.MODELSIM) bool
Run the simulation using VUnit.
- Parameters:
testbench (list[str], optional) – The name of the testbench to run. If None, all testbenches will be run. Defaults to None.
gui (bool, optional) – Whether to run the simulation in GUI mode. Defaults to False.
run_file (XibifPath, optional) – The path to the VUnit run.py file. Defaults to XibifDefaults.vunit_run_file_path().
junit_file (XibifPath, optional) – The path to the JUnit XML file to generate. Defaults to XibifDefaults.simulation_xml_file().
simulator (VunitSimulator, optional) – The simulator to use for running the simulation. Defaults to VunitSimulator.MODELSIM.
- Returns:
bool – True if the simulation was successful, False otherwise.
- Raises:
XibifRuntimeError – If the simulation fails.
api.testbench
The testbench API allows you to generate testbenches for your design.
Commands
Testbench API for XiBIF.
- testbench_analyze_source_file(hdl_vhdl_file: XibifPath) dict[str, list[str]]
Analyze a VHDL source file to extract information about its ports and generics.
- Parameters:
hdl_vhdl_file (XibifPath) – Path to the VHDL file to be analyzed.
- Returns:
dict[str, list[str]] – A dictionary containing lists of input ports, output ports, and generics found in the VHDL file.
- Raises:
XibifRuntimeError – An error occurred while analyzing the VHDL file.
- testbench_generate(hdl_vhdl_file: XibifPath, hdl_tb_folder: XibifPath = XibifPath('hw/tb'), clock: list[str] | None = None, resetn: list[str] | None = None, resetp: list[str] | None = None) None
Generate a testbench from a VHDL file.
- Parameters:
hdl_vhdl_file (XibifPath) – Path to the VHDL file.
hdl_tb_folder (XibifPath, optional) – Path to the directory containing the testbench files. Defaults to XibifDefaults.HDL_TB_FOLDER.
clock (list[str] | None, optional) – List of clocks. Defaults to None.
resetn (list[str] | None, optional) – List of negative resets. Defaults to None.
resetp (list[str] | None, optional) – List of positive resets. Defaults to None.
- Raises:
XibifRuntimeError – An error occurred while creating the testbench.
api.upgrade
The upgrade API allows you to upgrade the project to the latest version of XiBIF.
Commands
Upgrade API for XiBIF.
- upgrade(board: XilinxBoard, xilinx_version: XilinxVersion, uuid: XibifUUID, settings: XibifSettings, app_name: str = 'xibif', src_folder: XibifPath = XibifPath('hw/src'), tb_folder: XibifPath = XibifPath('hw/tb'), vitis_folder: XibifPath = XibifPath('hw/vitis'), backup_folder: XibifPath = XibifPath('backup')) None
Upgrade the VHDL and C source-files to the newest XiBIF version.
- Parameters:
board (XilinxBoard) – The target FPGA board for the project.
xilinx_version (XilinxVersion) – Version of the Xilinx tools.
uuid (XibifUUID) – UUID of the project, used for generating unique register files.
settings (XibifSettings) – Current project settings, used for updating the Vitis header file.
app_name (str, optional) – Name of the application folder in the Vitis workspace. Defaults to XibifDefaults.APP_NAME.
src_folder (XibifPath, optional) – Path to the new HDL source files. Defaults to XibifDefaults.HDL_SRC_FOLDER.
tb_folder (XibifPath, optional) – Path to the new HDL testbench files. Defaults to XibifDefaults.HDL_TB_FOLDER.
vitis_folder (XibifPath, optional) – Path to the Vitis workspace. Defaults to XibifDefaults.VITIS_FOLDER.
backup_folder (XibifPath, optional) – Path to store backups before upgrading. Defaults to XibifDefaults.BACKUP_FOLDER.
api.misc
The misc API contains utility and project-setup helpers that are used across commands.
Commands
Misc API for various utility functions that do not fit into other categories.
- misc_create_backup(backup_folder: XibifPath = XibifPath('backup')) XibifPath
Create a backup of the current project.
Copies all contents of a XiBIF project directory (where the project file .xibif resides) to a backup directory, leaving the original directory untouched.
- Parameters:
backup_folder (XibifPath, optional) – The folder where the backup should be created. Defaults to XibifDefaults.BACKUP_FOLDER.
- Returns:
XibifPath – The path to the created backup folder.
- Raises:
XibifRuntimeError – If the generated backup sub-folder already exists.
- misc_create_project_folder(vivado_folder: XibifPath = XibifPath('hw/vivado'), vitis_folder: XibifPath = XibifPath('hw/vitis'), src_folder: XibifPath = XibifPath('hw/src'), tb_folder: XibifPath = XibifPath('hw/tb'), reg_folder: XibifPath = XibifPath('hw/regs'), constraint_folder: XibifPath = XibifPath('hw/constraints'), results_folder: XibifPath = XibifPath('hw/results'), demo_folder: XibifPath = XibifPath('sw'), sigasi_folder: XibifPath = XibifPath('.'), git_folder: XibifPath = XibifPath('.'), project_folder: XibifPath = XibifPath('.'))
Create a XiBIF project directory.
A XiBIF project directory contains all sub-directories that are relevant to a specific XiBIF project. When this function is invoked, all required directories are created if they do not exist.
This command does not generate a .xibif project file!
- Parameters:
vivado_folder (XibifPath) – The folder where the Vivado project is located. Defaults to XibifDefaults.VIVADO_FOLDER.
vitis_folder (XibifPath) – The folder where the Vitis project is located. Defaults to XibifDefaults.VITIS_FOLDER.
src_folder (XibifPath) – The folder where the HDL source files are located. Defaults to XibifDefaults.HDL_SRC_FOLDER.
tb_folder (XibifPath) – The folder where the HDL testbench files are located. Defaults to XibifDefaults.HDL_TB_FOLDER.
reg_folder (XibifPath) – The folder where the register configuration files are located. Defaults to XibifDefaults.REG_FOLDER.
constraint_folder (XibifPath) – The folder where the constraint files are located. Defaults to XibifDefaults.CONSTRAINT_FOLDER.
results_folder (XibifPath) – The folder where the results are stored. Defaults to XibifDefaults.RESULTS_FOLDER.
demo_folder (XibifPath) – The folder where the demo software files are located. Defaults to XibifDefaults.SW_FOLDER.
sigasi_folder (XibifPath) – The folder where the Sigasi project files are located. Defaults to XibifDefaults.SIGASI_FOLDER.
git_folder (XibifPath) – The folder where the Git repository is located. Defaults to XibifDefaults.GIT_FOLDER.
project_folder (XibifPath) – The folder where the project is located. Defaults to XibifDefaults.PROJECT_PATH.
- misc_nuke_project_folder(project_folder: XibifPath = XibifPath('.')) None
Delete all files in the project folder.
- Parameters:
project_folder (XibifPath, optional) – The folder where the project is located. Defaults to XibifDefaults.PROJECT_PATH.
- misc_reset_project_folder(backup_folder: XibifPath = XibifPath('backup'), vivado_folder: XibifPath = XibifPath('hw/vivado'), vitis_folder: XibifPath = XibifPath('hw/vitis'), src_folder: XibifPath = XibifPath('hw/src'), tb_folder: XibifPath = XibifPath('hw/tb'), reg_folder: XibifPath = XibifPath('hw/regs'), constraint_folder: XibifPath = XibifPath('hw/constraints'), results_folder: XibifPath = XibifPath('hw/results'), demo_folder: XibifPath = XibifPath('sw'), sigasi_folder: XibifPath = XibifPath('.'), git_folder: XibifPath = XibifPath('.'), project_folder: XibifPath = XibifPath('.')) None
Reset the project by deleting all generated files and folders, while keeping the project configuration file intact. A backup of the current project will be created before resetting.
Be aware that whilst changing the overall project structure is possible, the workflow is best tested with the default folder configuration.
- Parameters:
backup_folder (XibifPath) – The folder where the backup should be created. Defaults to XibifDefaults.BACKUP_FOLDER.
vivado_folder (XibifPath) – The folder where the Vivado project is located. Defaults to XibifDefaults.VIVADO_FOLDER.
vitis_folder (XibifPath) – The folder where the Vitis project is located. Defaults to XibifDefaults.VITIS_FOLDER.
src_folder (XibifPath) – The folder where the HDL source files are located. Defaults to XibifDefaults.HDL_SRC_FOLDER.
tb_folder (XibifPath) – The folder where the HDL testbench files are located. Defaults to XibifDefaults.HDL_TB_FOLDER.
reg_folder (XibifPath) – The folder where the register configuration files are located. Defaults to XibifDefaults.REG_FOLDER.
constraint_folder (XibifPath) – The folder where the constraint files are located. Defaults to XibifDefaults.CONSTRAINT_FOLDER.
results_folder (XibifPath) – The folder where the results are stored. Defaults to XibifDefaults.RESULTS_FOLDER.
demo_folder (XibifPath) – The folder where the demo software files are located. Defaults to XibifDefaults.SW_FOLDER.
sigasi_folder (XibifPath) – The folder where the Sigasi project files are located. Defaults to XibifDefaults.SIGASI_FOLDER.
git_folder (XibifPath) – The folder where the Git repository is located. Defaults to XibifDefaults.GIT_FOLDER.
project_folder (XibifPath) – The folder where the project is located. Defaults to XibifDefaults.PROJECT_PATH.
- misc_update_vitis_header_file(settings: XibifSettings, app_name: str = 'xibif', vitis_folder: XibifPath = XibifPath('hw/vitis')) None
Update the project configuration header file
Some project settings must be communicated to the processing system in a compatible format, i.e. a C-header file. When this function is invoked, a C-header file is generated that contains the relevat settings extracted from the settings parameter.
- Parameters:
settings (XibifSettings) – The current project settings to be applied to the Vitis header file.
app_name (str, optional) – The name of the application. Defaults to XibifDefaults.APP_NAME.
vitis_folder (XibifPath, optional) – The path to the Vitis project folder. Defaults to XibifDefaults.VITIS_FOLDER.