Debug Macros in Verdi
Macros can be defined
within or outside of the current scope and can be called multiple times
within the design. During debug, engineers may want to see the
definition of the macros and signal values within the macro; however,
in the conventional approach when engineers encounter a macro, they can
only search the macro name in the source code to find the definition
and jump to the definition to view the content. The pain of this
approach is that it is easy for engineers to forget where the result
jumped from when searching the macro content. And unlike normal
source code, there is no value annotated in the macro content, so that
the cause and effect is hard to understand. Furthermore, what if the
macro is instantiated multiple times? It will make macro debugging even
harder.
To resolve the above
problems, the Verdi™ Automated Debug System provides “Macro Debugging”
capability to enable users to quickly expand the macro content and
annotate the signal value at the selected time – just like it is the
normal source code. Turn on the Source | Expand Macro command in the nTrace window to enable the capability. Once the option is on, a + icon appears to the left side of the macro. Clicking on the + icon will expand the macro content and clicking on the –
icon will collapse it. All tracing commands are available in the
expanded macro content. For example, you can double-click on the
signal to trace its active driver – just like you do when debugging
normal source code. Furthermore, if the FSDB file is loaded and you
have turned on the Source | Active Annotation option in the nTrace
window, the simulation dumped values will be annotated under the signal
inside macro content. The following figure demonstrates a simple
example of how to debug a macro in the Verdi system.

