Step 1 - Creating Custom RTL Kernels with the Vivado Design Suite - Step 1 - Creating Custom RTL Kernels with the Vivado Design Suite - 2025.2 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2026-03-27
Version
2025.2 English

Follow these steps to package your RTL code as a Vivado IP and generate a Vitis RTL kernel:

  1. Open the polar_clip_rtl_kernel.tcl file.

    This Tcl script creates an IP following the Vivado IP Packaging flow as described in the Creating and Packaging Custom IP User Guide (UG1118).

    Note the following points:

    • The script creates a Vivado Design Suite project. This is required to create any IP because all source and constraint files must be local to the IP.

    • Lines 34 and 35 associate the correct clock pins to the interfaces. This is required for the Vitis compiler which links those interfaces to the platform clocking.

      ipx::associate_bus_interfaces -busif in_sample -clock ap_clk [ipx::current_core]
      ipx::associate_bus_interfaces -busif out_sample -clock ap_clk [ipx::current_core]
      
    • On lines 38 and 39 the FREQ_HZ bus parameter is removed. The Vivado IP integrator uses this parameter for correct association of the clock interface. The Vitis compiler sets this during the compilation process. Having it set in the IP can cause the compiler to incorrectly link the clocks.

      ipx::remove_bus_parameter FREQ_HZ [ipx::get_bus_interfaces in_sample -of_objects [ipx::current_core]]
      ipx::remove_bus_parameter FREQ_HZ [ipx::get_bus_interfaces out_sample -of_objects [ipx::current_core]]
      
    • At the end of the script notice the package_xo command. This command analyzes the newly created IP to make sure it contains the proper AXI interfaces. It then creates the XO file in the same location as the IP repository. A key function used in this command is the -output_kernel_xml. The kernel.xml file is key to the RTL kernel as it describes to the Vitis tool how the kernel should be controlled. You can find more information on RTL kernels and their requirements.

      package_xo -kernel_name $kernelName \
          -ctrl_protocol ap_ctrl_none \
          -ip_directory [pwd]/ip_repo/$kernelName \
          -xo_path [pwd]/ip_repo/${kernelName}.xo \
          -force -output_kernel_xml [pwd]/ip_repo/kernel_${kernelName}_auto.xml
      
  2. To complete this step run the following command:

    vivado -source polar_clip_rtl_kernel.tcl -mode batch
    

    or

    make polar_clip.xo