Programming Guide


Compile and Emulate Your Design

To compile and emulate your FPGA kernel design, perform the following steps:
  1. Modify the host part of your program to declare the
    device selector. Use this
    when instantiating a device queue for enqueuing your FPGA device kernel.
  2. Compile your design by including the
    option in your
    command to generate an executable.
  3. Run the resulting executable:
    • For Windows:
      1. Define the number of emulated devices by invoking the following command:
        set CL_CONFIG_CPU_EMULATE_DEVICES=<number_of_devices>
      2. Run the executable.
      3. Invoke the following command to unset the variable:
    • For Linux, invoke the following command:
      env CL_CONFIG_CPU_EMULATE_DEVICES=<number_of_devices> <executable_filename>
      This command specifies the number of identical emulation devices that the emulator must provide.
      If you want to use only one emulator device, you need not set the
      environment variable.
  • The Intel® FPGA Emulation Platform for OpenCL™ does not provide access to physical boards. Only the emulated devices are available.
  • The emulator is built with GCC 7.4.0 as part of the Intel® oneAPI DPC++/C++ Compiler. When running the executable for an emulated FPGA device, the version of
    must be at least that of GCC 7.4.0. In other words, the
    environment variable must ensure that the correct version of
    is found.
    If the correct version of
    is not found, the call to
    function fails to load the FPGA emulator platform and returns
    (error code
    ). Depending on which version of
    is found, the call to
    may succeed, but a later call to the
    function may fail with
    (error code
    If the
    does not point to a compatible
    , use the following syntax to invoke the host program:
    env LD_LIBRARY_PATH=<path to compatible>:$LD_LIBRARY_PATH <executable> [executable arguments]
  • To enable debugging of kernel code, optimizations are disabled by default for the FPGA emulator. This can lead to sub-optimal execution speed when emulating kernel code. You can pass the
    flag to the
    compile command to disable debugging and enable optimizations. This enables faster emulator execution.
  • When targeting the FPGA emulator device, use the
    compiler flag to turn on optimizations and speed up the emulation. To turn off optimizations (for example, to facilitate debugging), pass

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at