Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
666 Discussions

Error when compiling for Stratix USM

ManuelCostanzo2
1,947 Views

Hi all,

Thanks for this space. I'm having a problem since 2 months that I cant resolve. I have a simple code that uses USM and I want to compile it for FPGAs in the Devcloud. As I know, only Stratix has the USM feature (Arria don't). So, I use this commands:

qsub -l nodes=1:fpga_compile:ppn=2 -I

source /opt/intel/oneapi/setvars.sh

icpx -fsycl -fintelfpga -Xshardware -Xstarget=/opt/intel/oneapi/intel_s10sx_pac:pac_s10_usm test.cpp -o test -v



The error I'm getting is:

Error (23035): Tcl error:
Error (23031): Evaluation of Tcl script build/entry.tcl unsuccessful
Error: Quartus Prime Shell was unsuccessful. 2 errors, 0 warnings
For more details, full Quartus compile output can be found in files quartuserr.tmp and quartus_sh_compile.log.
Error: Compiler Error, not able to generate hardware.




the quartus log says:

This is the PAC OpenCL BSP run.sh script.
Compiling import revision flow...
ERROR: packager check failed with output ''
Info: *******************************************************************
Info: Running Quartus Prime Shell
    Info: Version 19.2.0 Build 57 06/24/2019 Patches 0.05dcp SJ Pro Edition
    Info: Copyright (C) 2019  Intel Corporation. All rights reserved.
    Info: Your use of Intel Corporation's design tools, logic functions 
    Info: and other software and tools, and any partner logic 
    Info: functions, and any output files from any of the foregoing 
    Info: (including device programming or simulation files), and any 
    Info: associated documentation or information are expressly subject 
    Info: to the terms and conditions of the Intel Program License 
    Info: Subscription Agreement, the Intel Quartus Prime License Agreement,
    Info: the Intel FPGA IP License Agreement, or other applicable license
    Info: agreement, including, without limitation, that your use is for
    Info: the sole purpose of programming logic devices manufactured by
    Info: Intel and sold by Intel or its authorized distributors.  Please
    Info: refer to the applicable agreement for further details, at
    Info: https://fpgasoftware.intel.com/eula.
    Info: Processing started: Thu Mar 23 14:08:08 2023
Info: Command: quartus_sh -t build/entry.tcl import
Info: Quartus(args): import
Info: Using INI file /tmp/test-f3f56b-e5d1ff/quartus.ini
Info: Compiling revision import
Error (23035): Tcl error: 
    while executing
"qexec "bash build/run.sh $revision_name""
    ("default" arm line 9)
    invoked from within
"switch $tcl_platform(platform) {
  windows {
    post_message -type error "Full compiles to generate hardware for the FPGA are available on supported ..."
    (file "build/entry.tcl" line 19)
Error (23031): Evaluation of Tcl script build/entry.tcl unsuccessful
Error: Quartus Prime Shell was unsuccessful. 2 errors, 0 warnings
    Error: Peak virtual memory: 979 megabytes
    Error: Processing ended: Thu Mar 23 14:08:09 2023
    Error: Elapsed time: 00:00:01

 

Can you help me with this? Can anyone compile for Stratix USM and then execute it? Thank you very much.

Here is the code:

#include <sycl/sycl.hpp>
#include <array>
#include <iostream>
#include <string>

using namespace sycl;

size_t array_size = 10000;
//************************************
// Vector add in SYCL on device: returns sum in 4th parameter "sum".
//************************************
void VectorAdd(queue &q, const int *a, const int *b, int *sum, size_t size)
{
  // Create the range object for the arrays.
  range<1> num_items{size};

  auto e = q.parallel_for(num_items, [=](auto i)
                          { sum[i] = a[i] + b[i]; });

  e.wait();
}

//************************************
// Initialize the array from 0 to array_size - 1
//************************************
void InitializeArray(int *a, size_t size)
{
  for (size_t i = 0; i < size; i++)
    a[i] = i;
}

int main(int argc, char *argv[])
{
  try
  {
    sycl::queue q((sycl::device::get_devices()[std::stoi(argv[1])]));

    // Print out the device information used for the kernel code.
    std::cout << "Running on device: "
              << q.get_device().get_info<info::device::name>() << "\n";
    std::cout << "Running on device: "
              << q.get_device().get_info<info::device::max_compute_units>() << "\n";
    std::cout << "Running on device: "
              << q.get_device().get_info<info::device::max_work_group_size>() << "\n";
    std::cout << "Running on device: "
              << q.get_device().get_info<info::device::global_mem_size>() << "\n";

    int *a = malloc_shared<int>(array_size, q);
    int *b = malloc_shared<int>(array_size, q);
    int *sum_sequential = malloc_shared<int>(array_size, q);
    int *sum_parallel = malloc_shared<int>(array_size, q);

    if ((a == nullptr) || (b == nullptr) || (sum_sequential == nullptr) ||
        (sum_parallel == nullptr))
    {
      if (a != nullptr)
        free(a, q);
      if (b != nullptr)
        free(b, q);
      if (sum_sequential != nullptr)
        free(sum_sequential, q);
      if (sum_parallel != nullptr)
        free(sum_parallel, q);

      std::cout << "Shared memory allocation failure.\n";
      return -1;
    }

    InitializeArray(a, array_size);
    InitializeArray(b, array_size);

    for (size_t i = 0; i < array_size; i++)
      sum_sequential[i] = a[i] + b[i];

    VectorAdd(q, a, b, sum_parallel, array_size);

    for (size_t i = 0; i < array_size; i++)
    {
      if (sum_parallel[i] != sum_sequential[i])
      {
        std::cout << "Vector add failed on device.\n";
        return -1;
      }
    }

    int indices[]{0, 1, 2, (static_cast<int>(array_size) - 1)};
    constexpr size_t indices_size = sizeof(indices) / sizeof(int);

    for (int i = 0; i < indices_size; i++)
    {
      int j = indices[i];
      if (i == indices_size - 1)
        std::cout << "...\n";
      std::cout << "[" << j << "]: " << j << " + " << j << " = "
                << sum_sequential[j] << "\n";
    }

    free(a, q);
    free(b, q);
    free(sum_sequential, q);
    free(sum_parallel, q);
  }
  catch (exception const &e)
  {
    std::cout << "An exception is caught while adding two vectors.\n";
    std::terminate();
  }

  std::cout << "Vector add successfully completed on device.\n";
  return 0;
}

 

0 Kudos
7 Replies
hareesh
Employee
1,883 Views

Hi,

thank you for posting your issue here. please give me some I am working on this.


Thank you,


0 Kudos
ManuelCostanzo2
1,879 Views
0 Kudos
hareesh
Employee
1,811 Views

Hi,

can you please share your log file and tcl script file


0 Kudos
ManuelCostanzo2
1,804 Views

Hi @hareesh, yes. Could you reproduce it?

 

 

 

u180336@s001-n061:~/test2$ icpx -fsycl -fintelfpga -Xshardware -Xstarget=/opt/intel/oneapi/intel_s10sx_pac:pac_s10_usm test.cpp -o test -v
Intel(R) oneAPI DPC++/C++ Compiler 2023.0.0 (2023.0.0.20221201)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm
Configuration file: /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../bin/icpx.cfg
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang++" -cc1 -triple spir64_fpga-unknown-unknown -aux-triple x86_64-unknown-linux-gnu -fsycl-is-device -fdeclare-spirv-builtins -fno-sycl-early-optimizations -fenable-sycl-dae -fsycl-instrument-device-code -Wno-sycl-strict -fsycl-int-header=/tmp/icpx-1bd1ca/test-header-1f9bcb.h -fsycl-int-footer=/tmp/icpx-1bd1ca/test-footer-3234d0.h -sycl-std=2020 -fsycl-unique-prefix=7851da85a9f613b7 -fsycl-disable-range-rounding -fintelfpga -Wspir-compat -emit-llvm-bc -emit-llvm-uselists -disable-free -clear-ast-before-backend -disable-llvm-verifier -main-file-name test.cpp -mrelocation-model static -fveclib=SVML -mframe-pointer=all -menable-no-infs -menable-no-nans -fapprox-func -menable-unsafe-fp-math -fno-signed-zeros -mreassociate -freciprocal-math -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -fno-verbose-asm -mconstructor-aliases -aux-target-cpu x86-64 -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -v -resource-dir /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/lib/clang/16.0.0 -dependency-file /tmp/icpx-1bd1ca/test-efa644.d -MT test.o -internal-isystem /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../include/sycl -internal-isystem /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/vpl/2023.0.0/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/tbb/2021.8.0/env/../include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/mpi/2021.8.0//include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/mkl/2023.0.0/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/ipp/2021.7.0/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/ippcp/2021.6.3/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/ipp/2021.7.0/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/dpl/2022.0.0/linux/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/dpcpp-ct/2023.0.0/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/dnnl/2023.0.0/cpu_dpcpp_gpu_dpcpp/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/dev-utilities/2021.8.0/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/dal/2023.0.0/include -I/glob/development-tools/versions/oneapi/2023.0.1/oneapi/ccl/2021.8.0/include/cpu_gpu_dpcpp -cxx-isystem /glob/development-tools/versions/oneapi/2023.0.1/oneapi/clck/2021.7.2/include -internal-isystem /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../compiler/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/lib/clang/16.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/lib/clang/16.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -std=c++17 -fdeprecated-macro -fdebug-compilation-dir=/home/u180336/test2 -ferror-limit 19 -fheinous-gnu-extensions -fgnuc-version=4.2.1 -no-opaque-pointers -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -dwarf-debug-flags " --driver-mode=g++ --intel -fintelfpga -Xshardware -Xstarget=/opt/intel/oneapi/intel_s10sx_pac:pac_s10_usm test.cpp -o test -v -g -O2 -fveclib=SVML -fheinous-gnu-extensions" -D__GCC_HAVE_DWARF2_CFI_ASM=1 -fintel-compatibility -fintel-compatibility-disable=FakeLoad -fintel-libirc-allowed -mllvm -disable-hir-generate-mkl-call -mllvm -intel-abi-compatible=true -o /tmp/icpx-1bd1ca/test-5abc20.bc -x c++ test.cpp
clang -cc1 version 16.0.0 based upon LLVM 16.0.0git default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/include"
ignoring duplicate directory "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/ipp/2021.7.0/include"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward"
ignoring duplicate directory "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/lib/clang/16.0.0/include"
ignoring duplicate directory "/usr/local/include"
ignoring duplicate directory "/usr/include/x86_64-linux-gnu"
ignoring duplicate directory "/usr/include"
ignoring duplicate directory "/usr/local/include"
ignoring duplicate directory "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/lib/clang/16.0.0/include"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/vpl/2023.0.0/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/tbb/2021.8.0/env/../include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/mpi/2021.8.0//include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/mkl/2023.0.0/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/ipp/2021.7.0/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/ippcp/2021.6.3/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/dpl/2022.0.0/linux/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/dpcpp-ct/2023.0.0/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/dnnl/2023.0.0/cpu_dpcpp_gpu_dpcpp/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/dev-utilities/2021.8.0/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/dal/2023.0.0/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/ccl/2021.8.0/include/cpu_gpu_dpcpp
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/clck/2021.7.2/include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../include/sycl
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../include
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../compiler/include
 /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9
 /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9
 /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward
 /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/lib/clang/16.0.0/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/llvm-link" /tmp/icpx-1bd1ca/test-5abc20.bc -o /tmp/icpx-1bd1ca/test-03a166.bc --suppress-warnings
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-crt.o -output=/tmp/icpx-1bd1ca/libsycl-crt-875221.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-complex.o -output=/tmp/icpx-1bd1ca/libsycl-complex-d541a1.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-complex-fp64.o -output=/tmp/icpx-1bd1ca/libsycl-complex-fp64-1fbcce.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-cmath.o -output=/tmp/icpx-1bd1ca/libsycl-cmath-cad602.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-cmath-fp64.o -output=/tmp/icpx-1bd1ca/libsycl-cmath-fp64-b0552c.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-imf.o -output=/tmp/icpx-1bd1ca/libsycl-imf-ba30c6.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-imf-fp64.o -output=/tmp/icpx-1bd1ca/libsycl-imf-fp64-2ab6b5.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-cassert.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-cassert-7c5391.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-cstring.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-cstring-15becb.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-complex.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-complex-07c6ce.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-complex-fp64.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-complex-fp64-288585.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-cmath.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-cmath-baf70a.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-cmath-fp64.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-cmath-fp64-c861bf.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-imf.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-imf-2c5da1.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-fallback-imf-fp64.o -output=/tmp/icpx-1bd1ca/libsycl-fallback-imf-fp64-9b8514.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-itt-user-wrappers.o -output=/tmp/icpx-1bd1ca/libsycl-itt-user-wrappers-33cb85.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-itt-compiler-wrappers.o -output=/tmp/icpx-1bd1ca/libsycl-itt-compiler-wrappers-04ffb0.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/clang-offload-bundler" -type=o -targets=sycl-spir64_fpga-unknown-unknown -input=/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/../lib/libsycl-itt-stubs.o -output=/tmp/icpx-1bd1ca/libsycl-itt-stubs-978093.o -unbundle -allow-missing-bundles -base-temp-dir=/tmp/icpx-1bd1ca
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/llvm-link" -only-needed /tmp/icpx-1bd1ca/test-03a166.bc /tmp/icpx-1bd1ca/libsycl-crt-875221.o /tmp/icpx-1bd1ca/libsycl-complex-d541a1.o /tmp/icpx-1bd1ca/libsycl-complex-fp64-1fbcce.o /tmp/icpx-1bd1ca/libsycl-cmath-cad602.o /tmp/icpx-1bd1ca/libsycl-cmath-fp64-b0552c.o /tmp/icpx-1bd1ca/libsycl-imf-ba30c6.o /tmp/icpx-1bd1ca/libsycl-imf-fp64-2ab6b5.o /tmp/icpx-1bd1ca/libsycl-fallback-cassert-7c5391.o /tmp/icpx-1bd1ca/libsycl-fallback-cstring-15becb.o /tmp/icpx-1bd1ca/libsycl-fallback-complex-07c6ce.o /tmp/icpx-1bd1ca/libsycl-fallback-complex-fp64-288585.o /tmp/icpx-1bd1ca/libsycl-fallback-cmath-baf70a.o /tmp/icpx-1bd1ca/libsycl-fallback-cmath-fp64-c861bf.o /tmp/icpx-1bd1ca/libsycl-fallback-imf-2c5da1.o /tmp/icpx-1bd1ca/libsycl-fallback-imf-fp64-9b8514.o /tmp/icpx-1bd1ca/libsycl-itt-user-wrappers-33cb85.o /tmp/icpx-1bd1ca/libsycl-itt-compiler-wrappers-04ffb0.o /tmp/icpx-1bd1ca/libsycl-itt-stubs-978093.o -o /tmp/icpx-1bd1ca/test-fbf499.bc --suppress-warnings
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin/sycl-post-link" -emit-only-kernels-as-entry-points -emit-param-info -symbols -emit-exported-symbols -split-esimd -lower-esimd -O2 -spec-const=default -device-globals -o /tmp/icpx-1bd1ca/test-524d75.table /tmp/icpx-1bd1ca/test-fbf499.bc
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/file-table-tform" -extract=Code -drop_titles -o /tmp/icpx-1bd1ca/test-2a8e51.txt /tmp/icpx-1bd1ca/test-524d75.table
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/llvm-foreach" --in-file-list=/tmp/icpx-1bd1ca/test-2a8e51.txt --in-replace=/tmp/icpx-1bd1ca/test-2a8e51.txt --out-ext=spv --out-file-list=/tmp/icpx-1bd1ca/test-365350.txt --out-replace=/tmp/icpx-1bd1ca/test-365350.txt --out-dir=/tmp/icpx-1bd1ca -- /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/llvm-spirv -o /tmp/icpx-1bd1ca/test-365350.txt -spirv-max-version=1.3 -spirv-debug-info-version=ocl-100 -spirv-allow-extra-diexpressions -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=-all,+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max,+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls,+SPV_KHR_expect_assume,+SPV_KHR_linkonce_odr,+SPV_INTEL_subgroups,+SPV_INTEL_media_block_io,+SPV_INTEL_device_side_avc_motion_estimation,+SPV_INTEL_fpga_loop_controls,+SPV_INTEL_unstructured_loop_controls,+SPV_INTEL_fpga_reg,+SPV_INTEL_blocking_pipes,+SPV_INTEL_function_pointers,+SPV_INTEL_kernel_attributes,+SPV_INTEL_io_pipes,+SPV_INTEL_inline_assembly,+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_float_controls2,+SPV_INTEL_vector_compute,+SPV_INTEL_fast_composite,+SPV_INTEL_joint_matrix,+SPV_INTEL_arbitrary_precision_fixed_point,+SPV_INTEL_arbitrary_precision_floating_point,+SPV_INTEL_variable_length_array,+SPV_INTEL_fp_fast_math_mode,+SPV_INTEL_long_constant_composite,+SPV_INTEL_arithmetic_fence,+SPV_INTEL_global_variable_decorations,+SPV_INTEL_task_sequence,+SPV_INTEL_optnone,+SPV_INTEL_usm_storage_classes,+SPV_INTEL_runtime_aligned,+SPV_INTEL_fpga_cluster_attributes,+SPV_INTEL_loop_fuse,+SPV_INTEL_fpga_buffer_location,+SPV_INTEL_fpga_invocation_pipelining_attributes,+SPV_INTEL_fpga_dsp_control,+SPV_INTEL_fpga_memory_accesses,+SPV_INTEL_fpga_memory_attributes,-SPV_INTEL_optnone /tmp/icpx-1bd1ca/test-2a8e51.txt
 "/glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin-llvm/llvm-foreach" --out-ext=aocx --in-file-list=/tmp/icpx-1bd1ca/test-365350.txt --in-replace=/tmp/icpx-1bd1ca/test-365350.txt --out-file-list=/tmp/icpx-1bd1ca/test-3f7bf0.aocx --out-replace=/tmp/icpx-1bd1ca/test-3f7bf0.aocx --out-increment=test.prj -- /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/lib/oclfpga/bin/aoc -o /tmp/icpx-1bd1ca/test-3f7bf0.aocx /tmp/icpx-1bd1ca/test-365350.txt -sycl -dep-files=/tmp/icpx-1bd1ca/test-efa644.d -output-report-folder=test.prj -g -hardware -target=/opt/intel/oneapi/intel_s10sx_pac:pac_s10_usm
aoc: Compiling for FPGA. This process may take several hours to complete.  Prior to performing this compile, be sure to check the reports to ensure the design will meet your performance targets.  If the reports indicate performance targets are not being met, code edits may be required.  Please refer to the oneAPI FPGA Optimization Guide for information on performance tuning applications for FPGAs.
Error (23035): Tcl error: 
Error (23031): Evaluation of Tcl script build/entry.tcl unsuccessful
Error: Quartus Prime Shell was unsuccessful. 2 errors, 0 warnings
For more details, full Quartus compile output can be found in files quartuserr.tmp and quartus_sh_compile.log.
Error: Compiler Error, not able to generate hardware

llvm-foreach: 
icpx: error: fpga compiler command failed with exit code 1 (use -v to see invocation)

 

 

 

 

 

 

 

 

 

u180336@s001-n061:~/test2/test.prj/build$ cat compile_script.tcl 
# (c) 1992-2020 Intel Corporation.                            
# Intel, the Intel logo, Intel, MegaCore, NIOS II, Quartus and TalkBack words    
# and logos are trademarks of Intel Corporation or its subsidiaries in the U.S.  
# and/or other countries. Other marks and brands may be claimed as the property  
# of others. See Trademarks on intel.com for full list of Intel trademarks or    
# the Trademarks & Brands Names Database (if Intel) or See www.Intel.com/legal (if Altera) 
# Your use of Intel Corporation's design tools, logic functions and other        
# software and tools, and its AMPP partner logic functions, and any output       
# files any of the foregoing (including device programming or simulation         
# files), and any associated documentation or information are expressly subject  
# to the terms and conditions of the Altera Program License Subscription         
# Agreement, Intel MegaCore Function License Agreement, or other applicable      
# license agreement, including, without limitation, that your use is for the     
# sole purpose of programming logic devices manufactured by Intel and sold by    
# Intel or its authorized distributors.  Please refer to the applicable          
# agreement for further details.                                                 
post_message "Running compile_script.tcl script"

# get flow type (from quartus(args) variable)
set flow [lindex $quartus(args) 0]

# simplified PR Quartus flow
qexec "quartus_syn --read_settings_files=on --write_settings_files=off dcp -c afu_$flow"
qexec "quartus_fit --read_settings_files=on --write_settings_files=off dcp -c afu_$flow"
qexec "quartus_asm --read_settings_files=on --write_settings_files=off dcp -c afu_$flow"

post_message "Removing the relaxed freeze-wrapper region kernel clock constraints that were used during Fitter with the base-flow."
exec sed -i {s/set_max_delay/#set_max_delay/g} user_clock.sdc
post_message "Removing the added clock-uncertainty that was put in place during the Fitter to help reduce cross-talk."
exec sed -i {s/set_clock_uncertainty/#set_clock_uncertainty/g} opencl_bsp.sdc

qexec "quartus_sta dcp -c afu_$flow --force_dat"

if {$flow eq "base"} {
  post_message "OpenCL BSP base revision compile..."

  # export green region partition
  qexec "quartus_cdb dcp -c afu_base --export_partition green_region --snapshot final --file green_region.qdb --exclude_pr_subblocks"

  # Get the kernel FMAX in the static region (by false-pathing all kernel clock paths in the PR region so they will be ignored) and dump it to a file. This is to facilitate selecting the seed with the fastest static region.
  post_message "Checking Kernel FMAX in static/BSP region."
  qexec "quartus_sta -t scripts/get_static_region_kernel_fmax.tcl"
}

 

 

 

 

 

 

 

 

u180336@login-2:~/test2/test.prj$ cat quartus_sh_compile.log 
This is the PAC OpenCL BSP run.sh script.
Compiling import revision flow...
ERROR: packager check failed with output ''
Info: *******************************************************************
Info: Running Quartus Prime Shell
    Info: Version 19.2.0 Build 57 06/24/2019 Patches 0.05dcp SJ Pro Edition
    Info: Copyright (C) 2019  Intel Corporation. All rights reserved.
    Info: Your use of Intel Corporation's design tools, logic functions 
    Info: and other software and tools, and any partner logic 
    Info: functions, and any output files from any of the foregoing 
    Info: (including device programming or simulation files), and any 
    Info: associated documentation or information are expressly subject 
    Info: to the terms and conditions of the Intel Program License 
    Info: Subscription Agreement, the Intel Quartus Prime License Agreement,
    Info: the Intel FPGA IP License Agreement, or other applicable license
    Info: agreement, including, without limitation, that your use is for
    Info: the sole purpose of programming logic devices manufactured by
    Info: Intel and sold by Intel or its authorized distributors.  Please
    Info: refer to the applicable agreement for further details, at
    Info: https://fpgasoftware.intel.com/eula.
    Info: Processing started: Thu Mar 30 19:12:03 2023
Info: Command: quartus_sh -t build/entry.tcl import
Info: Quartus(args): import
Info: Using INI file /tmp/test-3f7bf0-fb5456/quartus.ini
Info: Compiling revision import
Error (23035): Tcl error: 
    while executing
"qexec "bash build/run.sh $revision_name""
    ("default" arm line 9)
    invoked from within
"switch $tcl_platform(platform) {
  windows {
    post_message -type error "Full compiles to generate hardware for the FPGA are available on supported ..."
    (file "build/entry.tcl" line 19)
Error (23031): Evaluation of Tcl script build/entry.tcl unsuccessful
Error: Quartus Prime Shell was unsuccessful. 2 errors, 0 warnings
    Error: Peak virtual memory: 982 megabytes
    Error: Processing ended: Thu Mar 30 19:12:04 2023
    Error: Elapsed time: 00:00:01
u180336@login-2:~/test2/test.prj$

 

 

 

u180336@login-2:~/test2/test.prj$ cat build/entry.tcl
# (c) 1992-2020 Intel Corporation.                            
# Intel, the Intel logo, Intel, MegaCore, NIOS II, Quartus and TalkBack words    
# and logos are trademarks of Intel Corporation or its subsidiaries in the U.S.  
# and/or other countries. Other marks and brands may be claimed as the property  
# of others. See Trademarks on intel.com for full list of Intel trademarks or    
# the Trademarks & Brands Names Database (if Intel) or See www.Intel.com/legal (if Altera) 
# Your use of Intel Corporation's design tools, logic functions and other        
# software and tools, and its AMPP partner logic functions, and any output       
# files any of the foregoing (including device programming or simulation         
# files), and any associated documentation or information are expressly subject  
# to the terms and conditions of the Altera Program License Subscription         
# Agreement, Intel MegaCore Function License Agreement, or other applicable      
# license agreement, including, without limitation, that your use is for the     
# sole purpose of programming logic devices manufactured by Intel and sold by    
# Intel or its authorized distributors.  Please refer to the applicable          
# agreement for further details.                                                 

#Full compiles are not supported on Windows
switch $tcl_platform(platform) {
  windows {
    post_message -type error "Full compiles to generate hardware for the FPGA are available on supported Linux platforms only. Please add -rtl to your invocation of aoc to compile without building hardware. Otherwise please run your compile on a supported Linux distribution."
    exit 2
  }
  default {
    #Get revision name from quartus args
    if { [llength $quartus(args)] > 0 } {
      set revision_name [lindex $quartus(args) 0]
    } else {
      set revision_name import
    }
    post_message "Compiling revision $revision_name"
    qexec "bash build/run.sh $revision_name"
  }
}

 

 

 

u180336@login-2:~/test2/test.prj$ cat build/run.sh
#!/bin/bash

# (C) 2017 Intel Corporation. All rights reserved.
# Your use of Intel Corporation's design tools, logic functions and other
# software and tools, and its AMPP partner logic functions, and any output
# files any of the foregoing (including device programming or simulation
# files), and any associated documentation or information are expressly subject
# to the terms and conditions of the Intel Program License Subscription
# Agreement, Intel MegaCore Function License Agreement, or other applicable
# license agreement, including, without limitation, that your use is for the
# sole purpose of programming logic devices manufactured by Intel and sold by
# Intel or its authorized distributors.  Please refer to the applicable
# agreement for further details.
echo "This is the PAC OpenCL BSP run.sh script."
# set BSP flow
if [ $# -eq 0 ]
then
    BSP_FLOW="flat"
else
    BSP_FLOW="$1"
fi
echo "Compiling $BSP_FLOW revision flow..."

#get exact script path
SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
#get director of script path
SCRIPT_DIR_PATH="$(dirname "$SCRIPT_PATH")"

cd "$SCRIPT_DIR_PATH"

#test packager bin first to make sure it is available and working and fail
#early if it can't run.
#it would be frustrating to find out at the end of the compilation
ADAPT_PACKAGER_BIN="python2.7 ./tools/packager.pyz"
FLOW_SUCCESS=1
PACKAGER_OUTPUT=$($ADAPT_PACKAGER_BIN)
FLOW_SUCCESS=$?
if [ $FLOW_SUCCESS != 0 ]; then
    echo "ERROR: packager check failed with output '$PACKAGER_OUTPUT'"
    exit 1
fi

#make sure bbs files exist
if [ ! -f "dcp.qdb" ]; then
	echo "ERROR: BSP is not setup"
fi

#copy quartus.ini
cp ../quartus.ini .

#import opencl kernel files
quartus_sh -t scripts/import_opencl_kernel.tcl 

#check for bypass/alternative flows
if [ "$DCP_BYPASS_OPENCL_RUN_SCRIPT" != "" ]; then
    sh $DCP_BYPASS_OPENCL_RUN_SCRIPT
    exit $?
fi

#add BBBs to quartus pr project
quartus_sh -t add_bbb_to_pr_project.tcl $BSP_FLOW

cp ../afu_opencl_kernel.qsf .

echo "qsys-generate board.qsys"
qsys-generate -syn --quartus-project=dcp --rev=afu_opencl_kernel --parallel=off board.qsys
# adding board.qsys and corresponding .ip parameterization files to opencl_bsp_ip.qsf
qsys-archive --quartus-project=dcp --rev=afu_opencl_kernel --add-to-project board.qsys

#append kernel_system qsys/ip assignments to all revisions
rm -f kernel_system_qsf_append.txt
echo >> kernel_system_qsf_append.txt
grep -A10000 OPENCL_KERNEL_ASSIGNMENTS_START_HERE afu_opencl_kernel.qsf >> kernel_system_qsf_append.txt
echo >> kernel_system_qsf_append.txt

cat kernel_system_qsf_append.txt >> afu_flat.qsf
cat kernel_system_qsf_append.txt >> afu_base.qsf
cat kernel_system_qsf_append.txt >> afu_import.qsf

# compile project
# =====================
quartus_sh -t compile_script.tcl $BSP_FLOW
FLOW_SUCCESS=$?

# Report Timing
# =============
if [ $FLOW_SUCCESS -eq 0 ]
then
    quartus_sh -t scripts/adjust_plls_mcp.tcl dcp afu_$BSP_FLOW
else
    echo "ERROR: kernel compilation failed. Please see quartus_sh_compile.log for more information."
    exit 1
fi

#run packager tool to create GBS
BBS_ID_FILE="fme-ifc-id.txt"
if [ -f "$BBS_ID_FILE" ]; then
    FME_IFC_ID=`cat $BBS_ID_FILE`
else
    echo "ERROR: fme id not found."
    exit 1
fi

PLL_METADATA=""
PLL_METADATA_FILE="pll_metadata.txt"
if [ -f "$PLL_METADATA_FILE" ]; then
    PLL_METADATA=`cat $PLL_METADATA_FILE`
    echo "run.sh: PLL_METADATA/PLL_METADATA_FILE is: "
    cat $PLL_METADATA_FILE
fi

#check for generated rbf and gbs files
if [ ! -f ./output_files/afu_$BSP_FLOW.green_region.rbf ]; then
    echo "ERROR: ./output_files/afu_$FLOW.green_region.rbf is missing!"
    exit 1
fi

rm -f afu.gbs
$ADAPT_PACKAGER_BIN create-gbs \
    --rbf ./output_files/afu_$BSP_FLOW.green_region.rbf \
    --gbs ./output_files/afu_$BSP_FLOW.gbs \
    --afu-json opencl_afu.json \
    --set-value \
        interface-uuid:$FME_IFC_ID \
        $PLL_METADATA
    
FLOW_SUCCESS=$?
if [ $FLOW_SUCCESS != 0 ]; then
    echo "ERROR: packager tool failed to create .gbs file."
    exit 1
fi

rm -rf fpga.bin

gzip -9c ./output_files/afu_$BSP_FLOW.gbs > afu_$BSP_FLOW.gbs.gz
aocl binedit fpga.bin create
aocl binedit fpga.bin add .acl.gbs.gz ./afu_$BSP_FLOW.gbs.gz

echo "run.sh: done zipping up the gbs into gbs.gz, and creating fpga.bin"

if [ -f afu_$BSP_FLOW.failing_clocks.rpt ]; then
    aocl binedit fpga.bin add .failing_clocks.rpt ./afu_$BSP_FLOW.failing_clocks.rpt
    cp ./afu_$BSP_FLOW.failing_clocks.rpt ../
    echo "run.sh: done appending failing clocks report to fpga.bin"
fi

if [ -f afu_$BSP_FLOW.failing_paths.rpt ]; then
    aocl binedit fpga.bin add .failing_paths.rpt ./afu_$BSP_FLOW.failing_paths.rpt
    cp ./afu_$BSP_FLOW.failing_paths.rpt ../
    echo "run.sh: done appending failing paths report to fpga.bin"
fi

if [ ! -f fpga.bin ]; then
    echo "ERROR: no fpga.bin found.  FPGA compilation failed!"
    exit 1
fi

#copy fpga.bin to parent directory so aoc flow can find it
cp fpga.bin ../
cp acl_quartus_report.txt ../

echo ""
echo "==========================================================================="
echo "OpenCL AFU compilation complete"
echo "==========================================================================="
echo ""
u180336@login-2:~/test2/test.prj$ 
u180336@login-2:~/test2/test.prj$ cat build/run.sh
#!/bin/bash

# (C) 2017 Intel Corporation. All rights reserved.
# Your use of Intel Corporation's design tools, logic functions and other
# software and tools, and its AMPP partner logic functions, and any output
# files any of the foregoing (including device programming or simulation
# files), and any associated documentation or information are expressly subject
# to the terms and conditions of the Intel Program License Subscription
# Agreement, Intel MegaCore Function License Agreement, or other applicable
# license agreement, including, without limitation, that your use is for the
# sole purpose of programming logic devices manufactured by Intel and sold by
# Intel or its authorized distributors.  Please refer to the applicable
# agreement for further details.
echo "This is the PAC OpenCL BSP run.sh script."
# set BSP flow
if [ $# -eq 0 ]
then
    BSP_FLOW="flat"
else
    BSP_FLOW="$1"
fi
echo "Compiling $BSP_FLOW revision flow..."

#get exact script path
SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
#get director of script path
SCRIPT_DIR_PATH="$(dirname "$SCRIPT_PATH")"

cd "$SCRIPT_DIR_PATH"

#test packager bin first to make sure it is available and working and fail
#early if it can't run.
#it would be frustrating to find out at the end of the compilation
ADAPT_PACKAGER_BIN="python2.7 ./tools/packager.pyz"
FLOW_SUCCESS=1
PACKAGER_OUTPUT=$($ADAPT_PACKAGER_BIN)
FLOW_SUCCESS=$?
if [ $FLOW_SUCCESS != 0 ]; then
    echo "ERROR: packager check failed with output '$PACKAGER_OUTPUT'"
    exit 1
fi

#make sure bbs files exist
if [ ! -f "dcp.qdb" ]; then
	echo "ERROR: BSP is not setup"
fi

#copy quartus.ini
cp ../quartus.ini .

#import opencl kernel files
quartus_sh -t scripts/import_opencl_kernel.tcl 

#check for bypass/alternative flows
if [ "$DCP_BYPASS_OPENCL_RUN_SCRIPT" != "" ]; then
    sh $DCP_BYPASS_OPENCL_RUN_SCRIPT
    exit $?
fi

#add BBBs to quartus pr project
quartus_sh -t add_bbb_to_pr_project.tcl $BSP_FLOW

cp ../afu_opencl_kernel.qsf .

echo "qsys-generate board.qsys"
qsys-generate -syn --quartus-project=dcp --rev=afu_opencl_kernel --parallel=off board.qsys
# adding board.qsys and corresponding .ip parameterization files to opencl_bsp_ip.qsf
qsys-archive --quartus-project=dcp --rev=afu_opencl_kernel --add-to-project board.qsys

#append kernel_system qsys/ip assignments to all revisions
rm -f kernel_system_qsf_append.txt
echo >> kernel_system_qsf_append.txt
grep -A10000 OPENCL_KERNEL_ASSIGNMENTS_START_HERE afu_opencl_kernel.qsf >> kernel_system_qsf_append.txt
echo >> kernel_system_qsf_append.txt

cat kernel_system_qsf_append.txt >> afu_flat.qsf
cat kernel_system_qsf_append.txt >> afu_base.qsf
cat kernel_system_qsf_append.txt >> afu_import.qsf

# compile project
# =====================
quartus_sh -t compile_script.tcl $BSP_FLOW
FLOW_SUCCESS=$?

# Report Timing
# =============
if [ $FLOW_SUCCESS -eq 0 ]
then
    quartus_sh -t scripts/adjust_plls_mcp.tcl dcp afu_$BSP_FLOW
else
    echo "ERROR: kernel compilation failed. Please see quartus_sh_compile.log for more information."
    exit 1
fi

#run packager tool to create GBS
BBS_ID_FILE="fme-ifc-id.txt"
if [ -f "$BBS_ID_FILE" ]; then
    FME_IFC_ID=`cat $BBS_ID_FILE`
else
    echo "ERROR: fme id not found."
    exit 1
fi

PLL_METADATA=""
PLL_METADATA_FILE="pll_metadata.txt"
if [ -f "$PLL_METADATA_FILE" ]; then
    PLL_METADATA=`cat $PLL_METADATA_FILE`
    echo "run.sh: PLL_METADATA/PLL_METADATA_FILE is: "
    cat $PLL_METADATA_FILE
fi

#check for generated rbf and gbs files
if [ ! -f ./output_files/afu_$BSP_FLOW.green_region.rbf ]; then
    echo "ERROR: ./output_files/afu_$FLOW.green_region.rbf is missing!"
    exit 1
fi

rm -f afu.gbs
$ADAPT_PACKAGER_BIN create-gbs \
    --rbf ./output_files/afu_$BSP_FLOW.green_region.rbf \
    --gbs ./output_files/afu_$BSP_FLOW.gbs \
    --afu-json opencl_afu.json \
    --set-value \
        interface-uuid:$FME_IFC_ID \
        $PLL_METADATA
    
FLOW_SUCCESS=$?
if [ $FLOW_SUCCESS != 0 ]; then
    echo "ERROR: packager tool failed to create .gbs file."
    exit 1
fi

rm -rf fpga.bin

gzip -9c ./output_files/afu_$BSP_FLOW.gbs > afu_$BSP_FLOW.gbs.gz
aocl binedit fpga.bin create
aocl binedit fpga.bin add .acl.gbs.gz ./afu_$BSP_FLOW.gbs.gz

echo "run.sh: done zipping up the gbs into gbs.gz, and creating fpga.bin"

if [ -f afu_$BSP_FLOW.failing_clocks.rpt ]; then
    aocl binedit fpga.bin add .failing_clocks.rpt ./afu_$BSP_FLOW.failing_clocks.rpt
    cp ./afu_$BSP_FLOW.failing_clocks.rpt ../
    echo "run.sh: done appending failing clocks report to fpga.bin"
fi

if [ -f afu_$BSP_FLOW.failing_paths.rpt ]; then
    aocl binedit fpga.bin add .failing_paths.rpt ./afu_$BSP_FLOW.failing_paths.rpt
    cp ./afu_$BSP_FLOW.failing_paths.rpt ../
    echo "run.sh: done appending failing paths report to fpga.bin"
fi

if [ ! -f fpga.bin ]; then
    echo "ERROR: no fpga.bin found.  FPGA compilation failed!"
    exit 1
fi

#copy fpga.bin to parent directory so aoc flow can find it
cp fpga.bin ../
cp acl_quartus_report.txt ../

echo ""
echo "==========================================================================="
echo "OpenCL AFU compilation complete"
echo "==========================================================================="
echo ""
0 Kudos
hareesh
Employee
1,695 Views

Hi,

sorry for the late response. I did not face any issues at execution time on s10.


please follow bellow article and once again try to execute the same code.


https://devcloud.intel.com/oneapi/get_started/baseToolkitSamples/#toolkitExample


0 Kudos
hareesh
Employee
1,611 Views

Hi,

can you please update status of your issue?



0 Kudos
hareesh
Employee
1,539 Views

As we do not receive any response from you on the previous question/reply/answer that we have provided. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


0 Kudos
Reply