Intel® FPGA SDK for OpenCL™ Standard Edition: Cyclone® V SoC Getting Started Guide

ID 683030
Date 4/20/2022
Document Table of Contents

3.9. Creating the Hardware Configuration File of an OpenCL Kernel for SoC FPGA

The hardware configuration file of an OpenCL™ kernel is in the form of a .aocx executable file. To create the .aocx file for the hello_world example OpenCL application, you must first download and extract the example design from the OpenCL Design Examples page on the Intel® FPGA website. Then, compile the kernel source file using the Intel® FPGA SDK for OpenCL™ Offline Compiler.

After you successfully install your FPGA board, you can create a .aocx file that executes on the device. Cyclone V SoC Development Kit Programming Overview outlines the procedure for programming the hello_world design example onto the Cyclone® V SoC FPGA. For more information about the OpenCL design examples, refer to the OpenCL Design Examples page.

Important: Before you program your Cyclone V SoC FPGA with the hardware image, ensure that your SoC FPGA contains an image created using the current version of the SDK.
  1. Verify that you set the environment variable AOCL_BOARD_PACKAGE_ROOT to point to the Cyclone V SoC Development Kit Reference Platform (that is, INTELFPGAOCLSDKROOT/board/c5soc).
    The init_opencl script you ran when installing the Cyclone V SoC Development Kit should have set the AOCL_BOARD_PACKAGE_ROOT environment variable. If the returned path does not include INTELFPGAOCLSDKROOT/board/c5soc, modify the AOCL_BOARD_PACKAGE_ROOT setting.
  2. Verify that you set the environment variable QUARTUS_ROOTDIR_OVERRIDE to point to the installation directory of the correct Intel® Quartus® Prime Standard Edition software.
  3. At a command prompt, navigate to the hello_world design.
  4. To list the SoC FPGA boards available in the Cyclone V SoC Development Kit Reference Platform, invoke the aoc -list-boards command.
    You should see an output similar to the one below:
    Board list:
  5. To compile the kernel for your Cyclone V SoC Development Kit, invoke the following command:
    aoc -board=c5soc device/ -o=bin/hello_world.aocx
    This command performs the following tasks:
    • Generates the Intel® Quartus® Prime design project files from the OpenCL source code.
    • Checks for initial syntax errors.
    • Performs basic optimizations.
    • Creates a hello_world subfolder or subdirectory containing necessary intermediate files.
    • Creates the .aoco object file.
    • Creates the .aocx hardware configuration file and saves it in the bin subfolder or subdirectory.

    The .aocx file might take hours to build, depending on the complexity of the kernel. To view the progress of the compilation on-screen, include the -v flag in your aoc command (that is, aoc -v <your_kernel_filename>.cl).

    The offline compiler displays the line aoc: Hardware generation completed successfully. to signify the completion of the compilation process.

For more information about the -list-boards, -board=<board_name> , -v, and -o=<filename> options of the aoc command, refer to the Intel FPGA SDK for OpenCL Standard Edition Programming Guide.