-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Debugging
To enable debugging symbols, use the compilation flag "-g" similar to the gcc option. In addition, adding the "-G" option will enable introspective capabilities enabling more information about the design (What is the currently running behavior, which behavior was running before the deadlock?). An example compilation call for including debugging capabilities is:
scc DesignName -sc2out -vvv -vv -g -G
Next, execute the design under control of gdb:
gdb DesignName
This opens the regular gdb debugging session, allowing to set breakpoints, step-by-step execution an much more. There are many tutorials available online, One example is the RMS's gdb Debugger Tutorial.
Debugging generated models can be a confusing. Multiple source files are pulled in, in order to create the complete model. Also, some completely new behaviors may have been created. Bottom line, directly debugging the model may be confusing. To avoid confusion, the recommendation is to first generate the SC code into one file and recompile this. The following steps show how to do it:
scc <DesignName> -sir2sc -sl -o dbgModel.sc
Replace with your current name of the design (such as comm_tlm). One important parameter is -sl, this avoids creating back links into the source files -- I find them confusing.
scc dbgModel -sc2out -vvv -g -G -xlx -xcx
ddd dbgModel
Please see Debugging with DDD for a more detailed description on how to debug specifically with DDD.