Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 10/04/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.2. Using Libraries in Your Component

Use libraries to reuse functions created by you or others without needing to know the function implementation details.

To use the functions in a library, you must have the C/C++ header files (.h or .hpp) for the library available. For object libraries, you must also have the object library archive file (.a on Linux systems or .lib on Windows systems) available.

Any object libraries that you use in your component must be built and used by the same version number Intel FPGA high-level design tool. For example, to compile your component with the Intel HLS Compiler Version 21.3, the libraries included in your component must have been created with a version 21.3 Intel FPGA high-level design tool. If you use a library with a different version, you get a version mismatch error when you compile your component.

To include a library in your component:

  1. Review the header files corresponding to the library that you want to include in your component.

    The header file shows you the functions available to call in the library and how to call the functions.

  2. Include the header files in your component code.

    For example, #include "primitives.h"

  3. Compile your component with the Intel® HLS Compiler as follows::
    • For source code (that is, header-only) libraries, there is no additional library file name to specify.

      For example, i++ -march=arria10 MyComponent.cpp

    • For object libraries, ensure that you add the object library archive file name to the i++ command.

      For example, i++ -march=arria10 MyComponent.cpp libprim.a (Linux) or i++ -march=arria10 MyComponent.cpp libprim.lib (Windows).