Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16597 Discussions

autorun kernels not starting in 16.x

Altera_Forum
Honored Contributor II
1,256 Views

Hi. 

 

When compiling a project with several autorun kernels on a 16.x version of the SDK the emulation will only start some them. 

On a 17.x SDK version all of them are started in emulation. 

 

All of them are single work items and declared as follows: 

__attribute__((max_global_work_dim(0))) __attribute__((autorun)) __kernel void ${NAME}() {...}  

 

Are there some constraints about the number or order of kernels I am not aware of? 

 

I have to use the 16.x SDK for the hardware platform my project runs on and I'm not sure if testing emulation on 17.x and then creating hardware with 16.x is the best way to handle this. 

 

Regards 

Julius Roob
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
430 Views

Emulation of autorun kernels is not properly supported in AOC up to v16.1.2. For emulation of such kernels in v16.1.2 and below, you have to create a separate queue and explicitly call the autorun kernel from the host (without any arguments). However, these kernels work correctly on the FPGA itself without needing to be called from the host. Even if the autorun kernel is replicated using num_compute_units, you only need to call it once in the host code for emulation. Note that even though such kernels will automatically restart on the FPGA if their execution finishes, this will not happen in the emulator, and if your code expects the kernel to restart automatically, you have to call it again in the host for emulation. What I do is that I add the necessary code for explicitly calling the autorun kernels during emulation in an "#ifdef EMULATION" block, and use the "EMULATION" variable at compile-time to control whether I want to compile for emulation or FPGA execution. 

 

I reported this discrepancy between emulation and FPGA execution to Altera a couple months ago, and they implemented a fix in v17.0; however, the fix is not complete since autorun kernels still do not restart on their own after their execution finishes. I have reported this remaining issue, too, and they will hopefully fix it in the upcoming versions.
0 Kudos
Altera_Forum
Honored Contributor II
430 Views

That is a very helpful answer. 

 

Thank you.
0 Kudos
DongWang-BJTU
New Contributor I
430 Views

I am using v18.1.0, still got the same problem. After a few rounds of restart, the autorun kernel never came back.

0 Kudos
Reply