ID 683846
Date 12/19/2022
Public

## 11.1.1.1. Creating an Object File From OpenCL Code

Use the fpga_crossgen command to create library objects from your OpenCL code. An object created from OpenCL code contains information required both for emulating the functions in the object and synthesizing the hardware for the object functions.

Note: When the aoc command links non-library object files, it checks that all files are compiled with the same command line options to avoid conflicting directions to the compiler. The exception to this are the -ffp-reassociate and -ffp-contract=fast flags that must be passed at parse time (that is, when the .cl or .cpp file is passed into the aoc or the fpga_crossgen command). Different commands can have different settings, and the setting applied to a given source file are determined by the options provided when that source file was parsed.

The fpga_crossgen command creates one object file from one input source file. The object created can be used only in libraries that target the same Intel high-level design tool. Also, objects are versioned. That is, each object is assigned a compiler version number and be used only with Intel high-level design tools with the same version number.

Create a library object using the following command:

fpga_crossgen <source_file> --target target_HLD_tool [-o <object_file>]

where, target_HLD_tool is the target Intel® high-level design tool for this library. This parameter can have one of the following values:

• aoc

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 combined as Intel® FPGA SDK for OpenCL™ object files (.aoco).

• hls

Target this object to be included in libraries for components developed with the Intel® HLS Compiler.

Objects built for the Intel® HLS Compiler are combined 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.

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 code file name.

Did you find the information on this page useful?

Characters remaining:

Feedback Message