mirror of
https://github.com/verilator/verilator.git
synced 2025-04-05 04:02:37 +00:00
Debug: Add --dump-treei option
This commit is contained in:
parent
3b9b823511
commit
11edc9e7a7
@ -262,6 +262,7 @@ descriptions in the next sections for more information.
|
||||
--debugi-<srcfile> <level> Enable debugging a source file at a level
|
||||
+define+<var>+<value> Set preprocessor define
|
||||
--dump-tree Enable dumping .tree files
|
||||
--dump-treei <level> Enable dumping .tree files at a level
|
||||
-E Preprocess, but do not compile
|
||||
--error-limit <value> Abort after this number of errors
|
||||
--exe Link to create executable
|
||||
@ -529,9 +530,16 @@ standard across Verilog tools while -D is an alias for GCC compatibility.
|
||||
|
||||
=item --dump-tree
|
||||
|
||||
Rarely needed. Enable writing .tree debug files. This is enabled with
|
||||
--debug, so "--debug --no-dump-tree" may be useful if the dump files are
|
||||
large and not desired.
|
||||
Rarely needed. Enable writing .tree debug files with dumping level 3,
|
||||
which dumps the standard critical stages. --dump-tree is enabled
|
||||
automatically with --debug, so "--debug --no-dump-tree" may be useful if
|
||||
the dump files are large and not desired.
|
||||
|
||||
=item --dump-treei
|
||||
|
||||
Rarely needed. Enable writing .tree debug files with a specific dumping
|
||||
level, 0 disbles dumps and is equivelent to "--no-dump-tree". Level 9
|
||||
enables dumping of every stage.
|
||||
|
||||
=item -E
|
||||
|
||||
|
@ -1014,7 +1014,8 @@ void AstNode::dumpTreeFile(const string& filename, bool append) {
|
||||
if (logsp->fail()) v3fatalSrc("Can't write "<<filename);
|
||||
*logsp<<"Tree Dump from <e"<<dec<<editCountLast()<<">";
|
||||
*logsp<<" to <e"<<dec<<editCountGbl()<<">"<<endl;
|
||||
if (editCountGbl()==editCountLast()) {
|
||||
if (editCountGbl()==editCountLast()
|
||||
&& !(v3Global.opt.dumpTree()>=9)) {
|
||||
*logsp<<endl;
|
||||
*logsp<<"No changes since last dump!\n";
|
||||
} else {
|
||||
|
@ -284,12 +284,12 @@ public:
|
||||
operator en () const { return m_e; }
|
||||
int width() const {
|
||||
switch (m_e) {
|
||||
case BIT: return 1;
|
||||
case BIT: return 1; // scalar, can't bit extract unless ranged
|
||||
case BYTE: return 8;
|
||||
case CHANDLE: return 64;
|
||||
case INT: return 32;
|
||||
case INTEGER: return 32;
|
||||
case LOGIC: return 1;
|
||||
case LOGIC: return 1; // scalar, can't bit extract unless ranged
|
||||
case LONGINT: return 64;
|
||||
case DOUBLE: return 64; // opaque
|
||||
case FLOAT: return 32; // opaque
|
||||
|
@ -725,8 +725,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||
else if ( onoff (sw, "-debug-check", flag/*ref*/) ){ m_debugCheck = flag; }
|
||||
else if ( !strcmp (sw, "-debug-sigsegv") ) { throwSigsegv(); } // Undocumented, see also --debug-abort
|
||||
else if ( !strcmp (sw, "-debug-fatalsrc") ) { v3fatalSrc("--debug-fatal-src"); } // Undocumented, see also --debug-abort
|
||||
else if ( onoff (sw, "-dump-tree", flag/*ref*/) ) { m_dumpTree = flag; }
|
||||
else if ( onoff (sw, "-dump-tree-more", flag/*ref*/) ) { m_dumpTreeMore = m_dumpTree = flag; } // Undocumented
|
||||
else if ( onoff (sw, "-dump-tree", flag/*ref*/) ) { m_dumpTree = flag ? 3 : 0; } // Also see --dump-treei
|
||||
else if ( onoff (sw, "-exe", flag/*ref*/) ) { m_exe = flag; }
|
||||
else if ( onoff (sw, "-ignc", flag/*ref*/) ) { m_ignc = flag; }
|
||||
else if ( onoff (sw, "-inhibit-sim", flag/*ref*/)){ m_inhibitSim = flag; }
|
||||
@ -799,6 +798,10 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||
shift;
|
||||
setDebugSrcLevel(src, atoi(argv[i]));
|
||||
}
|
||||
else if ( !strcmp (sw, "-dump-treei") && (i+1)<argc ) {
|
||||
shift;
|
||||
m_dumpTree = atoi(argv[i]);
|
||||
}
|
||||
else if ( !strcmp (sw, "-error-limit") && (i+1)<argc ) {
|
||||
shift;
|
||||
m_errorLimit = atoi(argv[i]);
|
||||
@ -1162,8 +1165,6 @@ V3Options::V3Options() {
|
||||
m_coverageUnderscore = false;
|
||||
m_coverageUser = false;
|
||||
m_debugCheck = false;
|
||||
m_dumpTree = false;
|
||||
m_dumpTreeMore = false;
|
||||
m_exe = false;
|
||||
m_ignc = false;
|
||||
m_l2Name = true;
|
||||
@ -1187,6 +1188,7 @@ V3Options::V3Options() {
|
||||
m_underlineZero = false;
|
||||
m_xmlOnly = false;
|
||||
|
||||
m_dumpTree = 0;
|
||||
m_errorLimit = 50;
|
||||
m_ifDepth = 0;
|
||||
m_inlineMult = 2000;
|
||||
|
@ -106,8 +106,6 @@ class V3Options {
|
||||
bool m_coverageUnderscore;// main switch: --coverage-underscore
|
||||
bool m_coverageUser; // main switch: --coverage-func
|
||||
bool m_debugCheck; // main switch: --debug-check
|
||||
bool m_dumpTree; // main switch: --dump-tree
|
||||
bool m_dumpTreeMore; // main switch: --dump-tree-more
|
||||
bool m_exe; // main switch: --exe
|
||||
bool m_ignc; // main switch: --ignc
|
||||
bool m_inhibitSim; // main switch: --inhibit-sim
|
||||
@ -129,6 +127,7 @@ class V3Options {
|
||||
bool m_underlineZero;// main switch: --underline-zero; undocumented old Verilator 2
|
||||
bool m_xmlOnly; // main switch: --xml-netlist
|
||||
|
||||
int m_dumpTree; // main switch: --dump-tree
|
||||
int m_errorLimit; // main switch: --error-limit
|
||||
int m_ifDepth; // main switch: --if-depth
|
||||
int m_inlineMult; // main switch: --inline-mult
|
||||
@ -238,8 +237,6 @@ class V3Options {
|
||||
bool coverageUnderscore() const { return m_coverageUnderscore; }
|
||||
bool coverageUser() const { return m_coverageUser; }
|
||||
bool debugCheck() const { return m_debugCheck; }
|
||||
bool dumpTree() const { return m_dumpTree; }
|
||||
bool dumpTreeMore() const { return m_dumpTreeMore; }
|
||||
bool exe() const { return m_exe; }
|
||||
bool trace() const { return m_trace; }
|
||||
bool traceDups() const { return m_traceDups; }
|
||||
@ -257,6 +254,7 @@ class V3Options {
|
||||
bool inhibitSim() const { return m_inhibitSim; }
|
||||
bool xmlOnly() const { return m_xmlOnly; }
|
||||
|
||||
int dumpTree() const { return m_dumpTree; }
|
||||
int errorLimit() const { return m_errorLimit; }
|
||||
int ifDepth() const { return m_ifDepth; }
|
||||
int inlineMult() const { return m_inlineMult; }
|
||||
|
@ -143,7 +143,7 @@ void V3Global::readFiles() {
|
||||
//######################################################################
|
||||
|
||||
void process () {
|
||||
bool dumpMore = v3Global.opt.dumpTreeMore();
|
||||
bool dumpMore = (v3Global.opt.dumpTree() >= 9);
|
||||
|
||||
// Sort modules by level so later algorithms don't need to care
|
||||
V3LinkLevel::modSortByLevel();
|
||||
|
Loading…
Reference in New Issue
Block a user