Using Libraries in HLS Components - 2023.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2023-12-18
Version
2023.2 English

The Vitis unified IDE and v++ common command line support foundational C/C++ libraries allowing common hardware design constructs and functions to be easily modeled in C/C++ and synthesized to RTL. The following libraries are provided with with the tools as described in Vitis HLS Libraries Reference:

  • Arbitrary Precision Data Types Library: Arbitrary precision data types let your C code use variables with smaller bit-widths than standard C or C++ data types, to enable improved performance and reduced area in hardware.
  • HLS Math Library: Used to specify standard math operations for synthesis into RTL and implementation on AMD devices.
  • HLS Stream Library: For modeling and compiling streaming data structures.

You can use each of the C libraries in your design by including the library header file in your code. These header files are located in the include directory in the Vitis HLS installation area.

Important: The header files for the libraries do not have to be in the include path if the design is built in the AMD Vitis™ unfied IDE as the paths to the library header files are automatically added.

Vitis Libraries

In addition, the Vitis Libraries are available for use with Vitis unified IDE and v++ common command line. The libraries include common functions of math, statistics, linear algebra and DSP; and also supporting domain specific applications, like vision and image processing, quantitative finance, database, data analytics, and data compression. The libraries can be downloaded from https://github.com/Xilinx/Vitis_Libraries and setup for use in the Libraries view in the Vitis unified IDE, as described in Working with the Vitis Unified IDE in the Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393).

The libraries contain functions and constructs that are optimized for implementation on AMD devices. Using these libraries helps to ensure high quality of results (QoR); that the results of synthesis are a high-performance design that optimizes resource usage. Because the libraries are provided in C and C++, you can incorporate the libraries into your top-level function and simulate them to verify the functional correctness before synthesis.

Tip: The Vitis application acceleration libraries are not available for use on the Windows operating system.

Working with OpenCV

As described at https://github.com/Xilinx/Vitis_Libraries/tree/main/vision, to work with the Vitis Vision Library you must also have installed the OpenCV computer vision library. Vitis HLS does not come with OpenCV pre-installed, but the following link describes how to find and install it: Vitis Libraries - Compiling and Installing OpenCV libraries for use with Vision library.