Forum Discussion

HKim27's avatar
HKim27
Icon for Occasional Contributor rankOccasional Contributor
7 years ago

PAC Arria 10 GX, aoc compilation error

Hi, all

I installed acceleration stack, followed guide to install bsp and setup environment variables.

"aocl diagnose" detects device well, and pre-compiled aocx examples run well.

But when I try to compile some OpenCL kernel examples, it prints the following error:

[heehoon@localhost vector_add]$ aoc device/vector_add.cl -o bin/vector_add.aocx --board pac_a10
Warning: Command has been deprecated. Please use -board=<value> instead of --board <value>
aoc: Running OpenCL parser....
/home/heehoon/exm_opencl_vector_add_x64_linux/vector_add/device/vector_add.cl:23:48: warning: declaring kernel argument with no 'restrict' may lead to low kernel performance
__kernel void vector_add(__global const float *x,
                                               ^
/home/heehoon/exm_opencl_vector_add_x64_linux/vector_add/device/vector_add.cl:24:48: warning: declaring kernel argument with no 'restrict' may lead to low kernel performance
                         __global const float *y,
                                               ^
2 warnings generated.
aoc: Optimizing and doing static analysis of code...
Compiling for FPGA. This process may take a long time, please be patient.
Error (16045): Instance "ccip_std_afu|bsp_logic_inst|board_inst" instantiates undefined entity "board" File: /home/heehoon/exm_opencl_vector_add_x64_linux/vector_add/bin/vector_add/build/bsp_logic.sv Line: 238
Error (16185): Can't elaborate user hierarchy "ccip_std_afu|bsp_logic_inst|board_inst" File: /home/heehoon/exm_opencl_vector_add_x64_linux/vector_add/bin/vector_add/build/bsp_logic.sv Line: 238
Error (16185): Can't elaborate user hierarchy "ccip_std_afu|bsp_logic_inst" File: /home/heehoon/exm_opencl_vector_add_x64_linux/vector_add/bin/vector_add/build/BBB_cci_mpf/hw/rtl/cci-mpf-if/cci_mpf_if.vh Line: 38
Error (16185): Can't elaborate user hierarchy "ccip_std_afu" File: /home/heehoon/exm_opencl_vector_add_x64_linux/vector_add/bin/vector_add/build/platform/green_bs.sv Line: 183
Error (16186): Can't elaborate top-level user hierarchy
Error: Flow failed:
Error: Quartus Prime Synthesis was unsuccessful. 6 errors, 129 warnings
Error (23031): Evaluation of Tcl script a10_partial_reconfig/flow.tcl unsuccessful
Error: Quartus Prime Shell was unsuccessful. 12 errors, 129 warnings
Error: Compiler Error, not able to generate hardware

Do somebody know why this error happens?

Thanks in advance.

4 Replies

  • HKim27's avatar
    HKim27
    Icon for Occasional Contributor rankOccasional Contributor

    @HSING11

    But what I compiled is just OpenCL kernel:

    __kernel void vector_add(__global const float *x, 
                             __global const float *y, 
                             __global float *restrict z)
    {
        // get index of the work item
        int index = get_global_id(0);
     
        // add the vector elements
        z[index] = x[index] + y[index];
    }

    So there is no RTL design

  • HRZ's avatar
    HRZ
    Icon for Frequent Contributor rankFrequent Contributor

    Your problem is likely due to a version mismatch between your BSP and the OpenCL compiler you are using, rather than the OpenCL kernel itself. Can you post the version of BSP, quartus and aoc you are using and also attach the quartus_sh_compile.log file generated during your failed compilation?

  • HKim27's avatar
    HKim27
    Icon for Occasional Contributor rankOccasional Contributor

    I found the problem. I need to set env variable ALTERAOCLSDKROOT.

    export ALTERAOCLSDKROOT=$INTELFPGAOCLSDKROOT

    since init_env.sh and init_opencl.sh do not set it, you should do it by yourself.