Streamline dump control options

- Rename `--dump-treei` option to `--dumpi-tree`, which itself is now a
  special case of `--dumpi-<tag>` where tag can be a magic word, or a
  filename
- Control dumping via static `dump*()` functions, analogous to `debug()`
- Make dumping independent of the value of `debug()` (so dumping always
  works even without the debug flag)
- Add separate `--dumpi-graph` for dumping V3Graphs, which is again a
  special case of `--dumpi-<tag>`
- Alias `--dump-<tag>` to `--dumpi-<tag> 3` as before
This commit is contained in:
Geza Lore
2022-09-22 17:24:41 +01:00
parent 12093e6939
commit 63c694f65f
135 changed files with 565 additions and 589 deletions
+9 -15
View File
@@ -93,6 +93,8 @@
#include <unordered_set>
#include <vector>
VL_DEFINE_DEBUG_FUNCTIONS;
//######################################################################
// Support classes
@@ -261,8 +263,6 @@ public:
// METHODS
protected:
VL_DEBUG_FUNC; // Declare debug()
void scoreboardClear() {
// VV***** We reset user1p() and user2p on each block!!!
m_inDly = false;
@@ -450,10 +450,7 @@ protected:
UINFO(5, "ReorderBlock " << nodep << endl);
m_graph.removeRedundantEdges(&V3GraphEdge::followAlwaysTrue);
if (debug() >= 9) {
m_graph.dumpDotFilePrefixed("reorderg_nodup", false);
// m_graph.dump(); cout<<endl;
}
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("reorderg_nodup", false);
// Mark all the logic for this step
// Vertex::m_user begin: true indicates logic for this step
@@ -510,10 +507,10 @@ protected:
// And a real ordering to get the statements into something reasonable
// We don't care if there's cutable violations here...
// Non-cutable violations should be impossible; as those edges are program-order
if (debug() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_preo"), false);
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_preo"), false);
m_graph.acyclic(&SplitEdge::followCyclic);
m_graph.rank(&SplitEdge::followCyclic); // Or order(), but that's more expensive
if (debug() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_opt"), false);
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_opt"), false);
}
void reorderBlock(AstNode* nodep) {
@@ -672,7 +669,6 @@ protected:
iterateChildren(nodep);
}
VL_DEBUG_FUNC; // Declare debug()
private:
VL_UNCOPYABLE(IfColorVisitor);
};
@@ -724,8 +720,6 @@ public:
}
protected:
VL_DEBUG_FUNC; // Declare debug()
AstSplitPlaceholder* makePlaceholderp() {
return new AstSplitPlaceholder(m_origAlwaysp->fileline());
}
@@ -942,14 +936,14 @@ protected:
}
}
if (debug() >= 9) m_graph.dumpDotFilePrefixed("splitg_nodup", false);
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("splitg_nodup", false);
// Weak coloring to determine what needs to remain grouped
// in a single always. This follows all edges excluding:
// - those we pruned above
// - PostEdges, which are done later
m_graph.weaklyConnected(&SplitEdge::followScoreboard);
if (debug() >= 9) m_graph.dumpDotFilePrefixed("splitg_colored", false);
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("splitg_colored", false);
}
void visit(AstAlways* nodep) override {
@@ -1003,10 +997,10 @@ private:
void V3Split::splitReorderAll(AstNetlist* nodep) {
UINFO(2, __FUNCTION__ << ": " << endl);
{ ReorderVisitor{nodep}; } // Destruct before checking
V3Global::dumpCheckGlobalTree("reorder", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
V3Global::dumpCheckGlobalTree("reorder", 0, dumpTree() >= 3);
}
void V3Split::splitAlwaysAll(AstNetlist* nodep) {
UINFO(2, __FUNCTION__ << ": " << endl);
{ SplitVisitor{nodep}; } // Destruct before checking
V3Global::dumpCheckGlobalTree("split", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
V3Global::dumpCheckGlobalTree("split", 0, dumpTree() >= 3);
}