Commentary

This commit is contained in:
Wilson Snyder 2018-10-05 06:47:18 -04:00
parent c5fee7c456
commit 24a0873f6d

View File

@ -3983,17 +3983,30 @@ For example:
will toggle forever and thus the executable will give the didn't converge will toggle forever and thus the executable will give the didn't converge
error to prevent an infinite loop. error to prevent an infinite loop.
To debug this, run Verilator with --prof-cfuncs. Run make on the To debug this, first is to review any UNOPTFLAT warnings that were ignored,
generated files with "OPT=-DVL_DEBUG". Then call Verilated::debug(1) in though typically these can be ignored (at a performance cost), convergence
your main.cpp. issues can also be flagged with this warning as Verilator didn't know if
they would eventually converge.
Next, run Verilator with --prof-cfuncs. Run make on the generated
files with "OPT=-DVL_DEBUG". Then call Verilated::debug(1) in your
main.cpp.
This will cause each change in a variable to print a message. Near the This will cause each change in a variable to print a message. Near the
bottom you'll see the code and variable that causes the problem. For the bottom you'll see the variables that causes the problem. For the program
program above: above:
CHANGE: filename.v:1: b CHANGE: filename.v:1: b
CHANGE: filename.v:2: a CHANGE: filename.v:2: a
If many signals are getting printed then most likely each are oscillating
(or there is a bug). It may also be that e.g. "a" may be oscillating, then
"a" feeds signal "c" which then is also reported as oscillating.
Finally, rare more difficult cases can be debugged like a "C" program;
either enter GDB and use its tracing facilities, or edit the generated C++
code to add appropriate prints to see what is going on.
=back =back