Kria™ SOM Logo
2022.1

SOM

  • Landing Page
  • Kria Adventure Map
  • Application Development
  • Ubuntu Support
  • Boot Firmware
  • OpenAMP
  • Dynamic Function eXchange
  • Yocto Support
  • XEN Support
  • FreeRTOS Support
  • Frequently Asked Questions
  • Kria KD240
  • Kria KV260
  • Kria KR260
  • Kria Robotics Stack

Flows

  • Development Overview
  • Vitis Accelerator Flow
  • Vitis Platform Flow
  • Vivado Accelerator Flow
  • Custom Carrier Card Flow
  • Examples
  • Baremetal Flow Example

Kria Vitis Acceleration Flow

  • Kria Vitis Acceleration Tutorial
    • Kria Vitis Acceleration (Version: Vitis 2022.1)
    • Vitis Acceleration Flow
    • Vitis PL Kernel Development Flow
    • Vitis Compile and Link
      • Compilation of HLS Kernels
      • System Configuration
      • Linking
      • Build the Resize Kernel
      • Next Steps
    • Overview of VVAS Plug-ins
    • PetaLinux Firmware
    • Running on the KV260 Board
    • Adding a ML Inference Pipeline
    • Adding DPU IP
    • Next Steps
    • Overview of the Smartcam VVAS Plug-in
    • PetaLinux Firmware
    • Running on the KV260 Board

Common Utilities

  • On-target Utilities and Firmware
  • Setting Boot-modes
  • Generating DTSI and DTBO Overlay Files
  • Bitstream Management on Kria SOM
  • AI Customization
  • Generate a Vivado Project from Board Files
  • Generate a Vivado Project from Example Project
  • Kria SOM EEPROM Design Guide
  • Kria SOM EEPROM Content
  • Kria SOM CC FTDI Design Guide
  • Soft IP for Kria Notes

Other Releases

  • 2021.1
Kria™ SOM
  • »
  • Kria Vitis Acceleration Tutorial »
  • Vitis Compile and Link
  • View page source

Vitis Compile and Link¶

In this step, you will use Vitis to compile and link the resize kernel. The Vitis compile and the link is outlined as follows:

  1. Compile the kernel source code into AMD object files

  2. Define the system configuration.

  3. After compilation, the v++ -l command links kernel objects (.xo), together with the hardware platform XPFM file, to produce the .xclbin file.

Compilation of HLS Kernels¶

PL kernels written in C++ can be compiled into .xo files using the v++ --compile command described in Compiling C/C++ PL Kernels in the []](https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Compiling-C/C-PL-Kernels). The synthesized kernel object (.xo) is used in linking with the system as described in Linking the Kernels section. Multiple options need to be used to compile the PL kernel code using the Vitis compiler. The v++ -c -k kernel_name command compiles a kernel.

System Configuration¶

As described in Linking the Kernels, the process of linking kernels (.xo)  and the extensible platform (.xpfm) starts with a description of the architecture of the system using a configuration file. This file defines the number of kernel instances, or CUs, the memory layout of kernels, and the connection of streaming interfaces.

In this step, you define the system configurations for the resizing application smartcam/prj_conf to replace the prj_config_1dpu with the prj_config_1dpu file; it contains a clock, connectivity, and Vivado implementation strategies for the resize kernel.

cd prj_conf 
cp ../../../../../../../code_repo_kria_vitis_acceleration_flow_2022.1/image_resizing/vitis_platform_files/prj_config_1dpu .

The contents of the file are described in the Vitis-compiler-configuration section.

[clock]

freqHz=300000000:pp_pipeline_accel_1.ap_clk

[connectivity]

sp=pp_pipeline_accel_1.m_axi_gmem1:HP3
sp=pp_pipeline_accel_1.m_axi_gmem2:HP3
sp=pp_pipeline_accel_1.m_axi_gmem3:HP3

[advanced]
misc=:solution_name=link
param=compiler.addOutputTypes=hw_export

[vivado]
prop=run.impl_1.strategy=Performance_ExploreWithRemap

Linking¶

After the resize kernel .xo and system configuration are available, the system can be built using the v++ --link command. The Vitis compiler links the kernel .xo files to create a device executable (.xclbin) for Kria SOM devices.

Build the Resize Kernel¶

IMPORTANT: Replace the files.

Replace the SmartCam kv260/overlays/examples/smartcam/Makefile with the resizing kernel Makefile. The default Makefile contains sources to the DPU and the image pre-processing kernel. Replacing the makefile and system configuration builds only the image resize kernel. Run the following command to compile and build the resize application:

cd ..
cp ../../../../../../code_repo_kria_vitis_acceleration_flow_2022.1/image_resizing/vitis_platform_files/Makefile .
cd ../../../
make overlay OVERLAY=smartcam

The above Makefile uses the following command to compile the resize kernel:

v++ -t hw --platform kv260_ispMipiRx_vcu_DP -c -k pp_pipeline_accel -I $(XFOPENCV_INCDIR) -o'pp_pipeline_accel.xo' ./xf_pp_pipeline_accel.cpp

The above Makefile uses the following command to link the resize kernel to create a device executable (.xclbin):

v++ -t hw --platform kv260_ispMipiRx_vcu_DP --save-temps --config ${DIR_PRJ}/prj_conf/prj_config_1 -l --temp_dir binary_container_1 --log_dir binary_container_1/logs --remote_ip_cache binary_container_1/ip_cache

The generated bitfile and  dpu.xclbin are located at the following location:

ls overlays/examples/smartcam/binary_container_1/link/int/system.bit   
ls overlays/examples/smartcam/binary_container_1/dpu.xclbin

The generated Vivado project will be located at. You can open the Vivado project to see how to resize the kernel that is connected to the system.

cd overlays/examples/smartcam/binary_container_1/link/vivado/vpl/prj

vivado prj.xpr

Next Steps¶

This completes the Vitis Compile and Link. The next step is the Overview of VVAS Plug-ins.


Copyright © 2023-2025 Advanced Micro Devices, Inc.

Terms and Conditions

Previous Next

© Copyright 2021-2025, Advanced Micro Devices, Inc. Last updated on April 10, 2025.

Terms and Conditions | Privacy | Cookie Policy | Trademarks | Statement on Forced Labor | Fair and Open Competition | UK Tax Strategy | Inclusive Terminology | Cookies Settings


Built with Sphinx using a theme provided by Read the Docs.