11.3.1. Creating an Object File From HLS Code
Use the fpga_crossgen command to create objects for your library from your HLS code. An object created from HLS code contains information required both for emulating the functions in the object and synthesizing the hardware for the object functions.
The fpga_crossgen command creates one object file from one input source file. The object created can be used only libraries that target the same Intel high-level design tool.
Objects are assigned the same version number as the version number of your Intel® HLS Compiler installation. Libraries can contain only objects with the same version number, and can only be used with Intel high-level design tools with the same version number.
extern "C" HLS_EXTERNAL int my_hls_func(int x);
fpga_crossgen <source_file> --target target_HLD_tool [-o <object_file_name>] [i++ command options}
The target Intel® high-level design tool for this library. This parameter can have one of the following values:
Target this object to be included in libraries for components developed with the Intel® HLS Compiler.
Objects built for the Intel® HLS Compiler are created as operating system specific object files (.o on Linux). You cannot use objects created on one operating system with the Intel® HLS Compiler running on a different operating system.
Target this object to be included in libraries for kernels developed with the Intel® FPGA SDK for OpenCL™ .
Objects built for the Intel® FPGA SDK for OpenCL™ are not operating system specific. The objects are created as Intel® FPGA SDK for OpenCL™ object files (.aoco).
You must have the Intel® FPGA SDK for OpenCL™ Pro Edition installed to use this option. The version of the SDK must be the same as your version of Intel® HLS Compiler.
- i++ command options
You can specify any Intel® HLS Compiler command (i++) options that you need to compile your library object. For a list of Intel® HLS Compiler command options, refer to Intel HLS Compiler Pro Edition Command Options.Restriction:You cannot specify the --simulator none i++ command option. Object files must contain simulation information. If you specify the --simulator none i++ command option, the fpga_crossgen command fails with an error message similar to the following message:
objcopy: error: the input file 'my_library_file.o' has no sections
If you do not specify an object file name with the -o option, the object file name defaults to be the same name as the source file name.
Did you find the information on this page useful?