Saturday, July 7, 2012

ncsim and ReInvoke

If you are a chip designer, and you use Cadence's tools, you might get some advantage by reading this post. Cadence Incisive is a complete package for simulating digital designs (perhaps more than just digital...). Incisive includes such tools as ncvlog, ncvhdl, ncelab, ncupdate, ncsim, and others. ncvlog and ncvhdl compile Verilog/SV and VHDL respectively. ncelab elaborates the design from the top level module. ncupdate re-compiles all changed source files in an elaborated design and re-elaborates. ncsim loads an elaborated design, and can display it with the SimVision GUI.

A sorely underused feature is SimVision's ReInvoke. Using ReInvoke from the simulation menu will cause SimVision to call ncupdate and reload the elaborated design. What is most pleasant about re-invoking the design is that most of the GUI stuff is saved and restored once the re-invoke is done. This includes signals in waveform windows, and I assume it includes watch variables and breakpoints, etc...


The problems with ReInvoke revolve around ncupdate. ncupdate does not properly update source files when packages are involved. This includes VHDL or SystemVerilog packages. Cadence has already informed me that ncupdate will NOT be fixed when it comes to updating SystemVerilog files (and I assume it will not fix VHDL package updates either). This has forced me to look for a way around the ncupdate from ReInvoke issue.

My first attempts to resolve this was to perform a re-compilation and re-elaboration outside of SimVision. Then call ReInvoke. This DOES NOT work. The reasoning is that SimVision will call ncupdate, and ncupdate will once again see which files have been updated (assume the packages), and then it will re-compile the packages (again), and re-elaborate. The re-elaborate will fail since the package has been compiled after the modules that use the packages!

To resolve this issue you can pass ncsim the "update" with "nosource" option. What this means is that SimVision on ReInvoke will NOT check for timestamps or perform any re-compilation of source files. ReInvoke will no only re-elaborate.

Using these options, you can recompile outside of SimVision, and let ReInvoke perform the re-elaboration. Voila! No more errors.

Side note: ReInvoke adds the "update" option automatically even if you didn't call ncsim with the "update" option to begin with. But ncsim will not allow you to pass the "nosource" option with the "update" option. Make sure to add the "update" option on the call to ncsim to avoid any issues.