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!

Reply

XSim Cosimulation runs indefinitely at '## run all'

Accepted Solution Solved
Highlighted
Visitor
Posts: 9
Registered: ‎01-30-2013
Accepted Solution

XSim Cosimulation runs indefinitely at '## run all'

Hi,

I am trying to C/RTL co-simulate a module using Vivado Simulator (xsim) in Vivado HLS 2016.4. C simulation is passed, and synthesis completed without errors. But when co-simulated, it is stuck at ## run all. (When stopped forcefully  it had generated a huge wcfg file of ~10GB).

1. What are the possible causes that simulation in running indefinitely at run all?

As per my understanding "run all" runs the simulation till all the transitions are completed. Is it stuck at some infinite loop or some kind?

2. How to debug the issue?


Accepted Solutions
Visitor
Posts: 9
Registered: ‎01-30-2013

Re: XSim Cosimulation runs indefinitely at '## run all'

@u4223374 and @muzaffer

The problem was with the logic, I missed out one array initialization.

But CSim did not catch it, CoSim initialized that array differently?

Thank you.

View solution in original post


All Replies
Scholar
Posts: 1,519
Registered: ‎04-26-2015

Re: XSim Cosimulation runs indefinitely at '## run all'

(1) This is a curious one. I've had a block that appears to do an infinite loop in cosim (ie runs for far more cycles than HLS claims it should, doesn't finish overnight) - but if I put it on an FPGA it works absolutely fine. This suggests a problem in the simulator rather than in the code itself. That's the first thing I'd try; do a hardware build with the block and see if it finishes.

 

(2) It's a really, really difficult one to debug. I never got around to it - I just went straight to the FPGA and tested it there. You can also try using a different version of HLS; my usual test suite is 2015.2 (tends to produce the smallest hardware), 2015.4 (fixes a few bugs in 2015.2), 2016.1 (more advanced AXI Masters), and 2016.4 (general improvements). Initial testing in 2017.1 is discouraging (ie blocks getting both larger and slower) but time will tell whether that's worthwhile.

Visitor
Posts: 9
Registered: ‎01-30-2013

Re: XSim Cosimulation runs indefinitely at '## run all'

1. Hardware is not available at this stage and it is not possible to try it out.

2. I tried in 2015.4 and it is behaving in the same way as 2016.4 (stuck at 'run all').

    Does it have anything to do with the block level interface protocol (ap_ready, ap_start etc.)? The block is built with the default IO protocol, no directives used. The block takes an array as input, work on it and gives  the output in an array. The input array is loaded with data by the test bench.

Teacher
Posts: 4,979
Registered: ‎03-31-2012

Re: XSim Cosimulation runs indefinitely at '## run all'

@apdmbn what constraints are you applying? First thing to try is to remove all constraints and try cosim and see if it passes. Then add your optimization constraints one by one to see which one is causing bad code to be generated. Usually dataflow has a problem where the fifos either become empty and never get filled again or they get full and they're never emptied which causes the infinite loop.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
Visitor
Posts: 9
Registered: ‎01-30-2013

Re: XSim Cosimulation runs indefinitely at '## run all'

@muzaffer, no custom constraints are applied. Everything is synthesized with the HLS default directives. The arrays are implemented as memory. The input array is loaded from test bench, so it should not be empty.

Visitor
Posts: 9
Registered: ‎01-30-2013

Re: XSim Cosimulation runs indefinitely at '## run all'

@u4223374 and @muzaffer

The problem was with the logic, I missed out one array initialization.

But CSim did not catch it, CoSim initialized that array differently?

Thank you.