Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 4/01/2024
Public
Document Table of Contents

11.2. Creating a Static-Object Library

Creating a static-object library is a multistep process where you create the objects that you want to include in a library and then collect the objects into a library file.

To create a static-object library:

  1. Create the objects for your library with the fpga_crossgen command. You can create your objects from a variety of sources:
  2. Collect the objects into an object library with the fpga_libtool command.
For example, if you wanted to create a Linux HLS object library called foobar from HLS code in a file called foo.cpp and OpenCL code in a file called bar.cl, run the following commands:
fpga_crossgen foo.cpp –target hls -o foo.o
fpga_crossgen bar.cl –target hls -o bar.o
fpga_libtool –target hls –create foobar.a foo.o bar.o

You can use the resulting library (foobar.a) in your component by including the header file or files that you created for the library (for example ,foobar.a, or foo.h and bar.h) in your component.

When you compile your component, specify the library in the option of the i++ command. For example, to compile a component baz.cpp that uses the foobar.a library, issue the following command:
i++ baz.cpp foobar.a