This example is a simple "Autorun" kernel. It demonstrates:
Requirement | Version | OpenCL Kernel | Host Program | ||||
---|---|---|---|---|---|---|---|
Hardware Compile | Emulation Compile | Hardware | Emulation | ||||
Compile | Run | Compile | Run | ||||
Quartus Prime Design Software (Quartus II) | 17.0 or later | ✓ | ✓ | ||||
Intel(R) FPGA SDK for OpenCL(TM) | 17.0 or later | ✓ | ✓ | ✓ (either) | ✓ (either) | ✓ (either) | ✓ (either) |
Intel(R) FPGA Runtime Environment for OpenCL(TM) | 17.0 or later | ||||||
Board Support Package | 17.0-compatible | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Board Hardware | - | ✓ | |||||
gcc | 4.4.7 or later | ✓ | ✓ | ✓ | ✓ | ||
GNU Make | 3.8.1 or later | ✓ | ✓ |
Path | Description |
---|---|
autorun_kernel/ | |
Makefile | Makefile for host program |
bin/ | Host program, AOCX files |
device/ | OpenCL kernel files |
autorun_kernel.cl | Top-level OpenCL kernel file |
host/ | |
src/ | Host source files |
The top-level OpenCL kernel file is device/autorun_kernel.cl.
To compile the OpenCL kernel, run:
where <board> matches the board you want to target. The -o bin/autorun_kernel.aocx argument is used to place the compiled binary in the location that the host program expects.
If you are unsure of the boards available, use the following command to list available boards:
To use the emulation flow, the compilation command just needs to be modified slightly:
To compile the host program, run:
The compiled host program will be located at bin/host.
Before running the host program, you should have compiled the OpenCL kernel and the host program. Refer to the above sections if you have not completed those steps.
To run the host program on hardware, execute:
Prior to running the emulation flow, ensure that you have compiled the kernel for emulation. Refer to the above sections if you have not done so. Also, please set up your environment for emulation. Please see the Intel(R) FPGA SDK for OpenCL(TM) Programming Guide for more information.
For this example design, the suggested emulation command is:
The host program requires a OpenCL binary (AOCX) file to run. For this example design, OpenCL binary files should be placed in the bin directory.
By default, the host program will look for a binary file in the following order (earlier pattern matches take priority):
Example Version | SDK Version | Date | Changes |
---|---|---|---|
1.0 | 17.0 | August 2017 |
|