Forum Discussion
Ric2
New Contributor
2 years agoDeadlock while filling pipe for simulation
Hi, following best practice as descibed here we run into trouble with stalled writes. When you create a testbench for a oneAPI kernel that you intend to compile as an IP core, write all your data...
Kevin_Xu_Intel
New Contributor
2 years agoHi Ric,
Sorry this took so long. I think the root of the problem we encountered with all of our workaround that uses pthread is that multithreading isn't fully supported in FPGA flow with oneAPI as it is mention in this release note.
I would suggest performing pipe read and write in the same loop:
q.single_task<Threshold>(ThresholdKernel{}); // Check that output pixels are below the threshold bool passed = true; for (int i = 0; i < (width * height); ++i) { // Write to input pipe bool start_of_packet = (i == 0); bool end_of_packet = (i == ((width * height) - 1)); StreamingBeatT in_beat(i, start_of_packet, end_of_packet); InPixelPipe::write(q, in_beat); if(i%1000 == 0) std::cerr << "Input: " << i << "\t " << (width * height) << std::endl; // Read from output pipe StreamingBeatT out_beat = OutPixelPipe::read(q); passed &= (out_beat.data <= kThreshold); if(i%1000 == 0) std::cerr << "Output: " << i << "\t " << out_beat.data << std::endl; }
Let me know if this could work for you,
Thanks,