• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Hardware/Software Co-Development, Verification…
  3. VPI profiling and debugging

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 49
  • Views 16698
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VPI profiling and debugging

Erik Vermij
Erik Vermij over 9 years ago

Hi All,


I'm working on a project consisting out of a VHDL/Verilog part and several C++ classes around it, communication using VPI. I compile using NCVerilog and run using NCSim (08.20-s201).

I've two problems here:

1) Typically I have to run for a long time, 10s of millions of cycles. Every now and then a 'ncsim internal error' in a VPI method occurs with zero useful information. Since my code does the same over and over, I don't understand why it would crash all of the sudden. Are there ways to get more information out of NCSim regarding such crashes? Or is it 'normal' that NCSim crashes every now and then? The stack trace often names 'vpi_scan' or 'vpi_iterate'.

2) Is it possible to get VPI performance profiling information out of ncsim? Just attaching perf does not produce so much useful information. In a very old post I found that adding '+ncprofile' should produce performance results, but that does not seem to work (any more?). What would be the preferred way to do this in a modern ncsim?

Thanks a lot,

Erik

  • Cancel
  • StephenH
    StephenH over 9 years ago

    Hello Erik.

    If the crash is intermittent and points to anything VPI-related, I would predict that there is a memory corruption issue at play. Without wishing to seem rude, my experience is that 99.9% of the time that would be in user-defined C/C++ code rather than the simulator!

    I assume you built your C/C++ using the debug options like -g? Failing to do that would prevent a meaningful stack trace. You could try using the -dumpstack option when you run ncsim, this will force static linking which tends to give better stack traces.

    The Incisive version you're using is archaic and no longer supported, I would strongly recommend moving to a more recent version of Incisive such as 15.10. There are many advantages to upgrading, including the "irun" command which can replace the old nverilog/ncsim commands and simplifies the flow significantly.

    In some of the very old releases there was a limitation in 64-bit mode that prevents the stack trace from being dumped, this was fixed a long time ago and should not be an issue in any of the current supported versions (14.10, 14.20, 15.10).

    Again, in these more recent versions we have better code profiling with the iprof tool, this was not available back in 8.2! Even so, this is meant for profiling HDL code not C/C++ code; you should really investigate using a 3rd-party profiler like Oracle Sun Studio (free of charge) or Google perftools for profiling C/C++ code.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Erik Vermij
    Erik Vermij over 9 years ago

    Dear Steve,

    thanks for your quick reply. Your hint towards memory corruption made me found a missing free() on an vpi iterator. It seems to work stable now (so far).


    I wasn't aware we're using such an old version of ncsim, I've to look into that.


    Thanks,

    Erik

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 9 years ago
    Excellent! Let's hope that was the only problem then :)
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information