FPGA simulation run fails if <binary>.fpga_sim.prj not in same location
Summary
If a <binary>.fpga_sim is run from a directory where <binary>.fpga_sim.prj does not exist then the runtime throws an exception:
-2 (PI_ERROR_DEVICE_NOT_AVAILABLE) -2 (PI_ERROR_DEVICE_NOT_AVAILABLE).
This must be because the simulation_raw.json file generated by Modelsim is written to <binary>.fpga_sim.prj/reports/resources/json/simulation_raw.json instead of to the current directory. Maybe erroring out is the intended behaviour, but in that case the specific runtime error is misleading.
Version
oneAPI Toolkit version 2023.1.0 (2023.1.0.20230320) oneAPI Sample hash 5be94fc7db259dafd54e8aedfcc99b39dc025cfc
Environment
Ubuntu 22.04, Quartus 22.4, Questa Starter Edition 22.1
Steps to reproduce
Following the GettingStarted guide:
cd DirectProgramming/C++SYCL_FPGA/Tutorials/GettingStarted/fpga_compile/part4_dpcpp_lambda_buffers/src
icpx -fsycl -fintelfpga -DFPGA_SIMULATOR -I../../../../include vector_add.cpp -Xssimulation -Xstarget=Arria10 -Xsghdl -o vector_add_sim.fpga_sim
cd ..
./src/vector_add_sim.fpga_sim
Observed behavior
-2 (PI_ERROR_DEVICE_NOT_AVAILABLE) -2 (PI_ERROR_DEVICE_NOT_AVAILABLE)
Expected behavior
Simulation runs. <binary>.fpga_sim.prj is found based on the binary path. If not found, either write simulation_raw.json to the current directory or give a meaningful error.