The simulation runtime creates a simulation device based on the automatically discovered or specified board_spec.xml/ipinterfaces.xml file. You can apply two simulation environment variables to control the .xml file searching mechanism.
CL_CONTEXT_MPSIM_DEVICE_INTELFPGA: When you set this environment variable to 1, the simulation runtime attempts to automatically search for a board_spec.xml/ipinterfaces.xml file to use, based on the following rules:
If there is only one .prj directory in the current working directory, the compiler uses the board_spec.xml/ipinterfaces.xml file in that directory.
If there are multiple .prj directories in the current working directory, the compiler uses the board_spec.xml/ipinterfaces.xml file in the directory with the name matching the current executable name. When comparing the name, the compiler strips the extensions (.exe, .bin, .elf, and .out for Linux and .exe for Windows).
When the automatic search fails, the runtime emits a CL_DEVICE_NOT_AVAILABLE
INTELFPGA_SIM_DEVICE_SPEC_DIR: Use this environment variable to set the path to the directory containing the target .xml file when the automatic search mechanism fails or when the automatically found .xml file is not desired. This environment variable forces the value of the CL_CONTEXT_MPSIM_DEVICE_INTELFPGA variable to 1 so that you can avoid specifying both variables to run a design in simulation.
If you want to use the simulation flow and view the waveforms generated during simulation, you must have either the Siemens EDA* Questa Simulator or ModelSim SE installed and available.
To run your SYCL library through the simulator:
Set the CL_CONTEXT_MPSIM_DEVICE_INTELFPGA or INTELFPGA_SIM_DEVICE_SPEC_DIR environment variable to enable the simulation device:
When you set any of the simulation environment variables, only the simulation devices are available. That is, access to physical boards is disabled. To unset the environment variable, run the following command:
You might need to set CL_CONTEXT_COMPILER_MODE_INTELFPGA=3 if the host program cannot find the simulator device.
Run your host program. On Linux systems, you can use GDB or Eclipse to debug your host. If necessary, you can inspect the simulation waveforms for your kernel code to verify the functionality of the generated hardware.
If you compiled with the -Xsghdl flag, running your compiled program produces a waveform file (vsim.wlf) that you can view in the Questa*-Intel FPGA Edition software as your host code executes. The vsim.wlf file appears in the .prj directory.