L1 Library Wizard Flow - 2024.2 English - UG1399

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2024-11-13
Version
2024.2 English

The L1 Library Wizard Flow feature provides a tool-assisted approach to access a subset of the Vitis Accelerated Libraries HLS functions. You can select library functions and generate examples as well as parametrized template functions that can be incorporated into your design. In this way, you can quickly add IP-based functionality to their design from pre-built HLS-based IP.

The Vitis Libraries contain an extensive set of open-source, performance-optimized libraries that offer out-of-the-box acceleration with minimal to zero-code changes to your existing applications. The common Vitis accelerated libraries for Math, Statistics, Linear Algebra, and digital signal processing (DSP) offer a set of core functionality for a wide range of diverse applications. The domain-specific Vitis accelerated libraries offer out-of-the-box acceleration for workloads like Vision and Image Processing, Quantitative Finance, Database and Data Analytics, and Data Compression.

Figure 1. Vitis Libraries

Three types of implementations are provided in the Vitis libraries, namely L1 primitives, L2 kernels and L3 software APIs. These implementations are organized in their corresponding directories L1, L2 and L3. The L1 primitive implementations can be leveraged by FPGA hardware developers. The L2 kernel implementations provide usage examples for Vitis host code developers. The L3 software API implementations provide C, C++, and Python function interfaces to allow pure software developers to offload operations to pre-built FPGA images, also called overlays. The Vitis vision library provides a software interface for computer vision functions accelerated on FPGA and AI Engine devices.

For Vitis v2024.1, the Vitis L1 Library Flow feature offers a tool-assisted approach to quickly incorporate L1 Library HLS functions into your design for the Vitis Solver and Vision Library subfolders only. The Solver Library provides a collection of matrix decomposition operations, linear solvers, and eigenvalue solvers. The Vitis vision library has been designed to work in the Vitis development environment and provides a software interface for computer vision functions accelerated on an FPGA using Vitis HLS. Vitis vision library functions are mostly similar in functionality to their OpenCV equivalent.

Note:

To use the Vitis Vision library, the OpenCV library v4.4.0 must be installed and accessible on your system. For instructions on how to install the OpenCV library on Windows, see Install/Setup OpenCV on Windows 10 and for Linux, see Compiling and Installing OpenCV libraries for use with Vision library.

There are three tool-assisted flows to access the L1 HLS functions:

  1. Examples view
  2. Create component from Library from the Welcome Page
  3. Auto-completion from xf:: namespace in Vitis Unified IDE editor
Tip: To ensure access to the L1 Library HLS functions, ensure the Solver and Vision subfolders of the Vitis Libraries have been downloaded.

Flow 1 - Examples - Create L1 HLS function examples

The Examples VIEW flow allows you to select and generate an L1 Library example. The result is a specified L1 Library HLS component project with both test bench and source code files.

To generate an L1 Library Example:

  1. Select the EXAMPLES icon in the Vitis Unified IDE.
  2. In the EXAMPLES panel, go to the HLS Examples > Vitis Accelerated Libraries Repository > Vitis Vision Library > L1 > examples.
  3. Select the desired example, for example, AMD 3D LUT L1 Test.
  4. Click on the "Create HLS Component Template" button.
  5. Set the component name and location. Select Next.
  6. Select Finish to generate the example HLS component.

Flow 2 - Create component from Library

The "Create component from Library" flow allows you to select an HLS template function and parametrize it. An HLS component project is created with the instantiated template function in a C++ wrapper for the synthesizable file. No test bench file is provided. To perform this flow:

  1. Select "Create Component from Library" from the Welcome page.
  2. Enter the component name and location in the "Create Component from Library" pop-up panel and select "Next."
  3. Select the desired L1 HLS function and select "Next."
  4. In the parametrization panel, configure the parameters.
    1. Grey text fields are required. In some cases, legal integer ranges are specified. For example, "int(16~2160)" means the field value can be an integer in the range 16 to 2160 inclusive.

  5. After defining the parameters, select "Next."
  6. Select the Part then select "Next." You can use the default part by selecting "Next" immediately.
  7. Edit the Settings then select "Next." You can use default settings by selecting "Next" immediately.
  8. Review the new HLS component settings and select "Finish."

Flow 3 - Auto-completion from the xf:: namespace in IDE Editor

The "auto-completion from the xf:: namespace" flow provides a way to insert a parametrized HLS template function into source code that is being actively edited.

  1. In the Vitis Unified IDE editor, open a C++ source code file.
  2. Type "xf::" in an empty line in the file editor panel.
  3. A list of available HLS functions will be displayed for auto-completion. Select a function, for example, xf::cv::absdiff.
  4. Once the function is selected, the HLS function's parametrization window opens, fill in the Parameters and Ports sections of the panel.
    1. In the Parameters section, grey text fields are required. In some cases, legal integer ranges are specified. For example, "int(16~2160)" means the field value can be an integer in the range 16 to 2160 inclusive.
    2. In the Ports section, you can rename the arguments to match the source code context.