Application Acceleration With FPGAs
Programmable Acceleration Cards (PACs), DCP, FPGA AI Suite, Software Stack, and Reference Designs
477 Discussions

How to use modelsim simulation openCL kernel ???

zjinf
New Contributor I
2,120 Views

I running openCL kernel function on Arria 10gx board successfully!

now i want to simulation the kernel by by modelsim ! how can i do this ??

or any hint ?

0 Kudos
8 Replies
MuhammadAr_U_Intel
1,125 Views
Hi, In order to run kernel simulation and view waveforms, please follow the steps as mentioned in OpenCL programming guide. https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf Page 161 Topic: 12.1.7. Debugging Your OpenCL Library Through Simulation (Preview) Thanks, Arslan
0 Kudos
zjinf
New Contributor I
1,125 Views

Hi Musman

Thanks for your reply ! that is not what i want!

i want simulation my own kernel , not the .*libraries*

 

take vector add for example:

 

_kernel void vector_add(__global const float *x,

                        __global const float *y,

                        __global float *restrict z)

{

   // get index of the work item

   int index = get_global_id(0);

 

   // add the vector elements

   z[index] = x[index] + y[index];

}

 

 

It must have related RTL code for the kernel ! where is the code ? intel not provide the code ? thanks again

 

0 Kudos
HRZ
Valued Contributor III
1,125 Views

@MUsman​ That is for OpenCL *libraries* (i.e. HDL code), not standard OpenCL kernels.

 

@zjinf​ Intel does not provide such functionality as far I am aware. You can do functional simulation in software for OpenCL kernels, but there is no way that I know of for timing-accurate simulation of OpenCL kernels.

0 Kudos
zjinf
New Contributor I
1,125 Views
  1. "You can do functional simulation in software for OpenCL kernels" how could i do this ?
  2. in my project directory, i open the Quartus prime Pro Edition software, i want open my project by quartus prime to view the whole system including kernel and memory controller and pcie controller and other module RTL structure ! how to do ?? or any document can refer ?

HRZ thank you for your help !

 

0 Kudos
HRZ
Valued Contributor III
1,125 Views
  1. If you don't use any FPGA-specifc constructs (e.g. on-chip channels), you can run and debug your code on any other OpenCL-capable device (CPU/GPU) in the same way as you would debug any other C/C++ code. You can also use Intel's emulator (which also works with channels, etc). Please refer to "Intel FPGA SDK for OpenCL Pro Edition Programming Guide, Section 8. Emulating and Debugging Your OpenCL Kernel" for more information.
  2. Open the "top.qpf" from the folder that is created by aoc. Running aoc -c (aoc -rtl in newer versions) is enough for this step.
0 Kudos
zjinf
New Contributor I
1,125 Views

Hi HRZ

Thank you for your help!

Yes, i have try open the "top.qpf" quartus project , and try to view the RTL Viewer , but it need to compile the project , while compile the "top.qpf"project, it generate many many error as following:

Screenshot from 2019-03-29 16-39-47.png

 

This kind error must be the quartus software compatible with the aoc command ! how could i fix the error ??(without compile the "top.qpf", it can't generate RTL level viewer)

 

0 Kudos
HRZ
Valued Contributor III
1,125 Views

Considering the fact that Quartus is complaining about missing files, maybe -c (-rtl) is not enough to generate all the HDL system. You can try compiling completely once with aoc and then opening the project with Quartus to make sure all the OpenCL system is created already.

0 Kudos
MuhammadAr_U_Intel
1,125 Views
Hi, Please update OpenCL SDK to 19.1 and try running simulation as suggested in OpenCL programming guide. https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf Page : 172 Topic: Compiling a Library for Simulation (-march=simulator) " To compile a simulation that targets a specific board, invoke the aoc -march=simulator -ghdl -board=<board_name> <your_kernel_filename>.cl command " OpenCL examples are tested with this flow and are updated with commands in respective README file. You can also take example of Vector add or Hello world example as described in README.html file in OpenCL SDK 19.1 installation directory. <OpenCL 19.1 SDK installation directory>\examples_aoc\vector_add\README.html Thanks, Arslan
0 Kudos
Reply