Visible to Intel only — GUID: vdk1535464881957
Ixiasoft
Visible to Intel only — GUID: vdk1535464881957
Ixiasoft
11.1.7.2. Simulating Your OpenCL* Library
If you want to view the waveforms generated during simulation, you must install and configure Siemens* EDA QuestaSim* software.
You can also run the emulator and simulator from separate terminal or command prompt sessions.
To run your OpenCL* library through the simulator:
- Run the utility command aocl linkflags to find out which libraries are necessary for building a host application. The software lists the libraries for both emulation and regular kernel compilation flows.
- Build a host application and link it to the libraries from Step 1.
Tip: To emulate multiple devices alongside other OpenCL SDKs, link your host application to the Khronos ICD Loader Library before you link it to the host runtime libraries. Link the host application to the ICD Loader Library by modifying the Makefile for the host application. For more information, see Linking Your Host Application to the Khronos ICD Loader Library.
- If necessary, move the .aocx file to a location where the host can find easily, preferably the current working directory.
- Set the CL_CONTEXT_MPSIM_DEVICE_INTELFPGA environment variable to enable the simulation device:
- Windows:
set CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1
- Linux:
env CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1
Remember: When the environment variable CL_CONTEXT_MPSIM_DEVICE_INTELFPGA is set, only the simulation devices are available. That is, access to physical boards and the emulation device is disabled.You might need to set CL_CONTEXT_COMPILER_MODE_INTELFPGA=3 if the host program cannot find the simulator device.
- Windows:
- Run your host program.
To debug your host code and device, you can run your host code in gdb or Eclipse.
Running the host program gives you a waveform file, vsim.wif, that you can view in QuestaSim* software as your host code executes. The vsim.wif file is written to the same directory that you run your host program from.
- If you change your host or kernel program and you want to test it, only recompile the modified host or kernel program and then rerun simulation.