UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
782 Views
Registered: ‎02-08-2018

MicroBlaze stalls when running Vivado HLS block

Jump to solution

I have a Vivado HLS block connected to a MicroBlaze via AXI DMA.  This design works when the Vivado HLS block contains simpler machine vision algorithms (like converting color image to grayscale), but when trying to implement a more complex machine vision algorithm into a Vivado HLS block, the MicroBlaze seems to stall during execution in the Xilinx SDK environment.  No critical warnings or errors in implementation or synthesis.

The Vivado HLS block has two user-defined parameter values: one determines whether image decimation is performed, and the other determines whether Gaussian blur is performed.  When neither of these operations is performed, the program execution works fine, with the output array containing the same values as the input array.  However, when Gaussian blur or image decimation is selected, and the input array is transmitted to the AXI DMA, the MicroBlaze program hangs.  According to Vivado HLS synthesis, the block is only supposed to take a maximum of about 14 ms to execute (based on latency and clock frequency), and only about 9% of BRAM and 16% of LUT is utilized.

Any suggestions on where to start debugging the problem?

Thanks

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
596 Views
Registered: ‎02-08-2018

Re: MicroBlaze stalls when running Vivado HLS block

Jump to solution

@evant_nq

After using the debugger, I found that the output reading would change in response to changes in the parameter settings of the Vivado HLS block.  However, the MicroBlaze was still stalling in the Xilinx SDK program when image filtering was done.

Then I noticed that when I sent the signal straight through without image filtering, the values of the side channel were preserved.  These values include keep, strb, user, last, id, dest.  However, when I did image filtering first, these same side channel values were uninitialized in the AXI output stream.  I modified the Vivado HLS code by initializing the side channel values, keep, strb, user, last, id, dest, for the AXI output stream and reprogramming the FPGA, I found that now the MicroBlaze no longer stalls.

Tags (2)
4 Replies
Explorer
Explorer
652 Views
Registered: ‎07-18-2018

Re: MicroBlaze stalls when running Vivado HLS block

Jump to solution

Hi Agailey,

   Did you try using the debugger? Can you see where the MicroBlaze is in your program when it stalls? It might be helpful to know if it's waiting for a value or a lock that isn't being released.

The other test that might be interesting would be to know how the Vivado HLS block performs in C sim vs Cosim on it's own. And that it returns a valid transformed image within the number of cycles you expect.

 

Explorer
Explorer
638 Views
Registered: ‎02-08-2018

Re: MicroBlaze stalls when running Vivado HLS block

Jump to solution

@evant_nq

Thanks for the advice.  I reran the RTL cosimulation, and it did state "Executed in 2837.0000 milliseconds".  I remember having the same results before, and I did not know why.  Below is a snapshot of the synthesis report, which states that the target time is 10 ns and the maximum number of clock cycles is 1,401,243.  This should mean an execution time of 14 ms, which is much less than 2837 milliseconds.  Furthermore, these results do not explain why the MicroBlaze program stalls in Xilinx SDK.  I will try the debugger, but I also would like to know why RTL cosimulation takes about 20 times as long as expected.

temp.png

0 Kudos
Explorer
Explorer
621 Views
Registered: ‎07-18-2018

Re: MicroBlaze stalls when running Vivado HLS block

Jump to solution

Hi Agailey,

    Is your HLS function only being called once in your simulation? Does it operate on a full image that it returns?

When you see the 2.8 seconds, where are you seeing it reported? I believe the simulation should also put out a latency in clock cycles on the RTL Co Simulation. Which should give the time it took to simulate, and if in your test bench, verify that latency reflects the expected outputs.

As to why it would stall out, on the SDK side, i think the debugger would be the right place to start. I would imagine if it's taking longer then expected it could be a lock up condition. I might try confirming if that is the case by calling the HLS block and simply not using or waiting for it. If it still hangs up, maybe the HLS block is touching memory it shouldn't be?

 

0 Kudos
Explorer
Explorer
597 Views
Registered: ‎02-08-2018

Re: MicroBlaze stalls when running Vivado HLS block

Jump to solution

@evant_nq

After using the debugger, I found that the output reading would change in response to changes in the parameter settings of the Vivado HLS block.  However, the MicroBlaze was still stalling in the Xilinx SDK program when image filtering was done.

Then I noticed that when I sent the signal straight through without image filtering, the values of the side channel were preserved.  These values include keep, strb, user, last, id, dest.  However, when I did image filtering first, these same side channel values were uninitialized in the AXI output stream.  I modified the Vivado HLS code by initializing the side channel values, keep, strb, user, last, id, dest, for the AXI output stream and reprogramming the FPGA, I found that now the MicroBlaze no longer stalls.

Tags (2)