Executing an opencl kernel on an fpga, Executing an opencl kernel on an fpga -8 – Altera RTE for OpenCL User Manual
Page 27

you power up the system, it configures the FPGA circuitry based on this hardware image in the flash
memory. Therefore, it is imperative that an OpenCL-compatible hardware configuration file is loaded
into the flash memory of your FPGA.
Preloading an OpenCL image into the flash memory is necessary for the proper functioning of many
Custom Platforms. For example, most PCI Express (PCIe)-based boards require a valid OpenCL image in
flash memory so that hardware on the board can use the image to configure the FPGA device when the
host system powers up for the first time. If the FPGA is not configured with a valid OpenCL image, the
system will fail to enumerate the PCIe endpoint, or the driver will not function.
Before running any designs, ensure that the flash memory of your board has an valid OpenCL image that
is compatible with the current OpenCL software version. Consult your board vendor's documentation for
board-specific requirements.
Caution:
When you load the hardware configuration file into the flash memory of the FPGA, maintain
system power for the entire loading process, which might take a few minutes. Also, do not
launch any host code that calls OpenCL kernels or might otherwise communicate with the
FPGA board.
To load your hardware configuration file into the flash memory of your FPGA board, perform the
following tasks:
1. Install any drivers or utilities that your Custom Platform requires.
2. Ensure that you set the AOCL_BOARD_PACKAGE_ROOT environment variable to point to the
subdirectory in your Custom Platform that contains the
board_env.xml
file.
3. Download an example design for your Custom Platform.
Remember: You can download example designs from the OpenCL Design Examples page, and extract
the example to a location to which you have write access.
4. To load the hardware configuration file into the flash memory, invoke the
aocl flash
command, where
refers to the acl number (e.g. acl0 to acl15) that corresponds to your FPGA device, and
is the precompiled hardware configuration file you can find in the
example design package.
5. Power down your device or computer and then power it up again.
Power cycling ensures that the FPGA configuration device retrieves the hardware configuration file
from the flash memory and configures it into the FPGA.
Warning:
Some Custom Platforms require you to power cycle the entire host system after program‐
ming the flash memory. For example, PCIe-based Custom Platforms might require a host
system reboot to reenumerate the PCIe endpoint. Altera recommends that you power cycle
the complete host system after programming the flash memory.
Related Information
Executing an OpenCL Kernel on an FPGA
You must build your OpenCL host application with the
Makefile
file, and run the application by invoking
the
hello_world
executable. You need GNU development tools such as
gcc
and
make
to build the
OpenCL application.
3-8
Executing an OpenCL Kernel on an FPGA
OCL005-15.0.0
2015.05.04
Altera Corporation
Getting Started with the Altera RTE for OpenCL for x86_64 Linux and 64-Bit Linux Big-Endian System