Visible to Intel only — GUID: uuw1552184352093
Ixiasoft
Visible to Intel only — GUID: uuw1552184352093
Ixiasoft
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 22.2, the libraries included in your component must have been created with a version 22.2 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:
- 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.
- Include the header files in your component code.
For example, #include "primitives.h"
- 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).
- For source code (that is, header-only) libraries, there is no additional library file name to specify.