oneapi-src / oneapi-src/oneAPI-samples
FPGA simulation run fails if <binary>.fpga_sim.prj not in same location
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 745
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the GettingStarted fpga_compile/part4_dpcpp_lambda_buffers example and its src/vector_add.cpp, then reproduce the FPGA simulator run from the parent directory using the documented commands. Trace where simulation_raw.json is expected relative to vector_add_sim.fpga_sim and verify that running outside the project directory either succeeds or reports a specific, meaningful error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100