csim -v 1000 testarch.sim... this sets the verbosity to be 1000. Generally, the higher the verbosity, the more detailed the messages become. While supporting debugging by phone, the CSIM support team often asks for snapshots of the output from higher verbosities.
To use the GNU debugger, compile with -g (this is the default with the CSIM setup file). Then invoke your simulation with:
gdb sim.exeAt the debugger prompt, type: run
When your program crashes, or you stop it with control-C, the debugger shows you the line of your program that was running. Note the line number. You can use that with an editor to locate the place in your model.
You may stop in the middle of a deeply nested subroutine call. You can view the calling stack (I.E. how you go there), by typing where at the debugger prompt. It will list the sequence of subroutines and there line-numbers which got you there. It also shows the values of their parameters.
You can examine the values of any variables by typing print and then the variable name. Example:
print xyzNote that you have to be in the proper scope to view local variables. (You have to be in the routine who owns the variable.) To see variables of routines on the calling stack (I.E. that got you there), type return to move back up the stack.
Although gdb is a text-based debugger, there are also graphical debuggers, such as DDD, KDevelop, KDbG, and XEmacs, which are all based on gdb underneath. Also REXX. Also dbx seems to be useful when using the Sun Compiler. For the most part, they all support the same commands.
It is often useful to redirect the simulator output into a log-file when using this option.
sim.exe > logThen edit the log file with an editor.