Visible to Intel only — GUID: ewa1452280808662
Ixiasoft
Visible to Intel only — GUID: ewa1452280808662
Ixiasoft
11.1. OpenCL Library
You can create an OpenCL library in OpenCL or register transfer level (RTL). You can then include this library file and use the functions inside your OpenCL kernels or in HLS components. For information about HLS libraries, refer to Intel High Level Synthesis Compiler: Reference Manual .
You may use a previously-created library or create your own library. To use an OpenCL library, you do not require in-depth knowledge in hardware design or in the implementation of library primitives. To create an OpenCL library, you need to create the following files:
File or Component | Description |
---|---|
RTL Components | |
RTL source files | Verilog, System Verilog, or VHDL files that define the RTL component. Additional files such as Intel® Quartus® Prime IP File (.qip), Synopsys Design Constraints File (.sdc), and Tcl Script File (.tcl) are not allowed. |
eXtensible Markup Language File (.xml) | Describes the properties of the RTL component. The Intel® FPGA SDK for OpenCL™ Offline Compiler uses these properties to integrate the RTL component into the OpenCL pipeline. |
Header file (.hcl) | A header file that contains valid OpenCL kernel language and declares the signatures of function(s) that are implement by the RTL component. |
OpenCL emulation model file (.cl) | Provides C model for the RTL component that is used only for emulation. Full hardware compilations use the RTL source files. |
OpenCL Functions | |
OpenCL source files (.cl) | Contains definitions of the OpenCL functions. These functions are used during emulation and full hardware compilations. |
Header file (.hcl) | A header file describing the functions to be called from OpenCL in the OpenCL kernel language syntax. |
HLS Functions | |
HLS source files (.cpp) | Contains definitions of the OpenCL functions. These functions are used during emulation and full hardware compilations. |
Header file (.hcl) | A header file describing the functions to be called from OpenCL in the OpenCL kernel language syntax. |
There is no difference in the header file used for RTL, OpenCL, and HLS library functions. A single header file can have all types of functions declared. A single library can contain any of the supported sources. You can create a library from mixed sources (OpenCL, HLS, or RTL) and target these Intel® high-level design products:
- Intel® FPGA SDK for OpenCL™ Pro Edition
- Intel® High Level Synthesis Compiler Pro Edition
Creating a OpenCL library is a two-step process:
- Each object file is created from input source files using the fpga_crossgen command. The required input source files depend on the type of source code you are creating the object from.
- An object is effectively an intermediate representation of your source code with both a CPU representation and an FPGA representation of your code.
- An object can be targeted for use with only one Intel® high-level design product. If you want to target more than one high-level design product, you must generate a separate object for each target product.
- Object files are combined into a library file using the fpga_libtool command.
Objects created from different types of source code can be combined into a library, provided all objects target the same high-level design product.
A library is assigned a version number, and can be used only with the targeted high-level design product with the same version number (for example, Intel® FPGA SDK for OpenCL™ Pro Edition version 21.4).
- Creating Library Objects From OpenCL Code
- Understanding RTL Modules and the OpenCL Pipeline
- Packaging an OpenCL Helper Function File for an OpenCL Library
- Packaging an RTL Component for an OpenCL Library
- Verifying the RTL Modules
- Specifying an OpenCL Library when Compiling an OpenCL Kernel
- Debugging Your OpenCL Library Through Simulation (Preview)
- Using an OpenCL Library that Works with Simple Functions (Example 1)
- Using an OpenCL Library that Works with External Memory (Example 2)
- OpenCL Library Command-Line Options