Intel® FPGA SDK for OpenCL™ Standard Edition: Programming Guide

ID 683342
Date 4/22/2019
Public
Document Table of Contents

12.1. OpenCL Library

An OpenCL™ library is a single file that contains multiple functions. Each function is comprised of data processing logic that works at any clock frequency. 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.
Figure 15. Overview of Intel® FPGA SDK for OpenCL™ 's Library Support

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 components. To create an OpenCL library, you need to create the following files and components:

Table 5.  Necessary Files and Components for Creating an OpenCL Library
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 (.h) A C-style header file that 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 (.h) A C-style header file that declares the signatures of function(s) that are defined in the OpenCL source files.
Remember: There is no difference in the header file used for RTL and OpenCL library functions. A single header file can have both types of functions declared. A single library can contain both RTL and OpenCL library functions.