forked from github/verilator
Merge branch 'master' into develop-v5
This commit is contained in:
commit
ddb678cc5b
@ -309,10 +309,13 @@ detailed descriptions of these arguments.
|
||||
+define+<var>=<value> Set preprocessor define
|
||||
--dpi-hdr-only Only produce the DPI header file
|
||||
--dump-defines Show preprocessor defines with -E
|
||||
--dump-tree Enable dumping .tree files
|
||||
--dump-graph Enable dumping V3Graphs to .dot
|
||||
--dump-tree Enable dumping Ast .tree files
|
||||
--dump-tree-addrids Use short identifiers instead of addresses
|
||||
--dump-treei <level> Enable dumping .tree files at a level
|
||||
--dump-treei-<srcfile> <level> Enable dumping .tree file at a source file at a level
|
||||
--dump-<srcfile> Enable dumping everything in source file
|
||||
--dumpi-graph <level> Enable dumping V3Graphs to .dot files at level
|
||||
--dumpi-tree <level> Enable dumping Ast .tree files at level
|
||||
--dumpi-<srcfile> <level> Enable dumping everything in source file at level
|
||||
-E Preprocess, but do not compile
|
||||
--error-limit <value> Abort after this number of errors
|
||||
--exe Link to create executable
|
||||
|
@ -263,8 +263,8 @@ Summary:
|
||||
generally is a less-optimized binary with symbols present (so GDB can be used on it).
|
||||
* Enable debugging messages (equivalent to :vlopt:`--debugi 3 <--debugi>`).
|
||||
* Enable internal assertions (equivalent to :vlopt:`--debug-check`).
|
||||
* Enable intermediate form dump files (equivalent to :vlopt:`--dump-treei 3
|
||||
<--dump-treei>`).
|
||||
* Enable intermediate form dump files (equivalent to :vlopt:`--dumpi-tree 3
|
||||
<--dumpi-tree>`).
|
||||
* Leak to make node numbers unique (equivalent to :vlopt:`--debug-leak
|
||||
<--no-debug-leak>`.
|
||||
* Call abort() instead of exit() if there are any errors (so GDB can see
|
||||
@ -355,26 +355,21 @@ Summary:
|
||||
|
||||
touch foo.v ; verilator -E --dump-defines foo.v
|
||||
|
||||
.. option:: --dump-graph
|
||||
|
||||
Rarely needed. Enable dumping V3Graph .dot debug files with dumping
|
||||
level 3. Before Verilator 4.228, :vlopt:`--dump-tree` used
|
||||
to include this option.
|
||||
|
||||
.. option:: --dump-tree
|
||||
|
||||
Rarely needed. Enable writing .tree debug files with dumping level 3,
|
||||
Rarely needed. Enable dumping Ast .tree debug files with dumping level 3,
|
||||
which dumps the standard critical stages. For details on the format see
|
||||
the Verilator Internals manual. :vlopt:`--dump-tree` is enabled
|
||||
automatically with :vlopt:`--debug`, so :vlopt:`--debug --no-dump-tree
|
||||
<--dump-tree>` may be useful if the dump files are large and not
|
||||
desired.
|
||||
|
||||
.. option:: --dump-treei <level>
|
||||
|
||||
.. option:: --dump-treei-<srcfile> <level>
|
||||
|
||||
Rarely needed - for developer use. Set internal tree dumping level
|
||||
globally to a specific dumping level or set the specified Verilator
|
||||
source file to the specified tree dumping level (e.g.
|
||||
:vlopt:`--dump-treei-V3Order 9 <--dump-treei>`). Level 0 disables dumps
|
||||
and is equivalent to :vlopt:`--no-dump-tree <--dump-tree>`. Level 9
|
||||
enables dumping of every stage.
|
||||
|
||||
.. option:: --dump-tree-addrids
|
||||
|
||||
Rarely needed - for developer use. Replace AST node addresses with
|
||||
@ -384,6 +379,28 @@ Summary:
|
||||
by a newly allocated node after a node with the same address has been
|
||||
dumped then freed.
|
||||
|
||||
.. option:: --dump-<srcfile>
|
||||
|
||||
Rarely needed - for developer use. Enable all dumping in the given
|
||||
source file at level 3.
|
||||
|
||||
.. option:: --dumpi-graph <level>
|
||||
|
||||
Rarely needed - for developer use. Set internal V3Graph dumping level
|
||||
globally to the specified value.
|
||||
|
||||
.. option:: --dumpi-tree <level>
|
||||
|
||||
Rarely needed - for developer use. Set internal Ast dumping level
|
||||
globally to the specified value.
|
||||
|
||||
.. option:: --dumpi-<srcfile> <level>
|
||||
|
||||
Rarely needed - for developer use. Set the dumping level in the
|
||||
specified Verilator source file to the specified value (e.g.
|
||||
:vlopt:`--dumpi-V3Order 9`). Level 0 disables dumps and is equivalent
|
||||
to :vlopt:`--no-dump-<srcfile>`. Level 9 enables dumping of everything.
|
||||
|
||||
.. option:: -E
|
||||
|
||||
Preprocess the source code, but do not compile, similar to C++
|
||||
|
@ -38,6 +38,8 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//***** See below for main transformation engine
|
||||
|
||||
//######################################################################
|
||||
@ -79,8 +81,6 @@ protected:
|
||||
LatchDetectGraphVertex* m_curVertexp = nullptr; // Current latch detection graph vertex
|
||||
std::vector<AstVarRef*> m_outputs; // Vector of lvalues encountered on this pass
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
static LatchDetectGraphVertex* castVertexp(void* vertexp) {
|
||||
return reinterpret_cast<LatchDetectGraphVertex*>(vertexp);
|
||||
}
|
||||
@ -183,7 +183,7 @@ public:
|
||||
<< " (not all control paths of combinational always assign a value)\n"
|
||||
<< nodep->warnMore()
|
||||
<< "... Suggest use of always_latch for intentional latches");
|
||||
if (debug() >= 9) dumpDotFilePrefixed("latch_" + vrp->name());
|
||||
if (dumpGraph() >= 9) dumpDotFilePrefixed("latch_" + vrp->name());
|
||||
}
|
||||
vertp->user(false); // Clear again (see above)
|
||||
vrp->varp()->isLatched(latch_detected);
|
||||
@ -198,12 +198,7 @@ public:
|
||||
//######################################################################
|
||||
// Collect existing active names
|
||||
|
||||
class ActiveBaseVisitor VL_NOT_FINAL : public VNVisitor {
|
||||
protected:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
};
|
||||
|
||||
class ActiveNamer final : public ActiveBaseVisitor {
|
||||
class ActiveNamer final : public VNVisitor {
|
||||
private:
|
||||
// STATE
|
||||
AstScope* m_scopep = nullptr; // Current scope to add statement to
|
||||
@ -304,7 +299,7 @@ AstActive*& ActiveNamer::getSpecialActive<AstSenItem::Combo>() {
|
||||
//######################################################################
|
||||
// Latch checking visitor
|
||||
|
||||
class ActiveLatchCheckVisitor final : public ActiveBaseVisitor {
|
||||
class ActiveLatchCheckVisitor final : public VNVisitor {
|
||||
private:
|
||||
// NODE STATE
|
||||
// Input:
|
||||
@ -346,7 +341,7 @@ public:
|
||||
//######################################################################
|
||||
// Replace unsupported non-blocking assignments with blocking assignments
|
||||
|
||||
class ActiveDlyVisitor final : public ActiveBaseVisitor {
|
||||
class ActiveDlyVisitor final : public VNVisitor {
|
||||
public:
|
||||
enum CheckType : uint8_t { CT_SEQ, CT_COMB, CT_INITIAL };
|
||||
|
||||
@ -418,7 +413,7 @@ public:
|
||||
//######################################################################
|
||||
// Active class functions
|
||||
|
||||
class ActiveVisitor final : public ActiveBaseVisitor {
|
||||
class ActiveVisitor final : public VNVisitor {
|
||||
private:
|
||||
// NODE STATE
|
||||
// Each call to V3Const::constify
|
||||
@ -631,5 +626,5 @@ public:
|
||||
void V3Active::activeAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ ActiveVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("active", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("active", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -33,6 +33,8 @@
|
||||
#include "V3Global.h"
|
||||
#include "V3SenTree.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Active class functions
|
||||
|
||||
@ -41,7 +43,6 @@ class ActiveTopVisitor final : public VNVisitor {
|
||||
SenTreeFinder m_finder; // Find global sentree's / add them under the AstTopScope
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
static bool isInitial(AstNode* nodep) {
|
||||
const VNUser1InUse user1InUse;
|
||||
@ -144,5 +145,5 @@ public:
|
||||
void V3ActiveTop::activeTopAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ ActiveTopVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("activetop", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("activetop", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "V3Global.h"
|
||||
#include "V3Stats.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Assert class functions
|
||||
|
||||
@ -513,5 +515,5 @@ public:
|
||||
void V3Assert::assertAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ AssertVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("assert", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("assert", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "V3Ast.h"
|
||||
#include "V3Global.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Assert class functions
|
||||
|
||||
@ -45,7 +47,6 @@ private:
|
||||
AstNode* m_disablep = nullptr; // Last disable
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
AstSenTree* newSenTree(AstNode* nodep) {
|
||||
// Create sentree based on clocked or default clock
|
||||
@ -206,5 +207,5 @@ public:
|
||||
void V3AssertPre::assertPreAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ AssertPreVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("assertpre", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("assertpre", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//======================================================================
|
||||
// Statics
|
||||
|
||||
@ -999,43 +1001,12 @@ bool AstNode::sameTreeIter(const AstNode* node1p, const AstNode* node2p, bool ig
|
||||
//======================================================================
|
||||
// Debugging
|
||||
|
||||
void AstNode::checkTreeIter(AstNode* backp) {
|
||||
void AstNode::checkTreeIter(const AstNode* backp) const {
|
||||
// private: Check a tree and children
|
||||
UASSERT_OBJ(backp == this->backp(), this, "Back node inconsistent");
|
||||
if (VN_IS(this, NodeTermop) || VN_IS(this, NodeVarRef)) {
|
||||
// Termops have a short-circuited iterateChildren, so check usage
|
||||
UASSERT_OBJ(!(op1p() || op2p() || op3p() || op4p()), this,
|
||||
"Terminal operation with non-terminals");
|
||||
}
|
||||
if (m_op1p) m_op1p->checkTreeIterList(this);
|
||||
if (m_op2p) m_op2p->checkTreeIterList(this);
|
||||
if (m_op3p) m_op3p->checkTreeIterList(this);
|
||||
if (m_op4p) m_op4p->checkTreeIterList(this);
|
||||
}
|
||||
|
||||
void AstNode::checkTreeIterList(AstNode* backp) {
|
||||
// private: Check a (possible) list of nodes, this is always the head of the list
|
||||
// Audited to make sure this is never nullptr
|
||||
AstNode* const headp = this;
|
||||
const AstNode* tailp = this;
|
||||
for (AstNode* nodep = headp; nodep; nodep = nodep->nextp()) {
|
||||
nodep->checkTreeIter(backp);
|
||||
UASSERT_OBJ(headp == this || !nextp(), this,
|
||||
"Headtailp should be null in middle of lists");
|
||||
tailp = nodep;
|
||||
backp = nodep;
|
||||
}
|
||||
UASSERT_OBJ(headp->m_headtailp == tailp, headp, "Tail in headtailp is inconsistent");
|
||||
UASSERT_OBJ(tailp->m_headtailp == headp, tailp, "Head in headtailp is inconsistent");
|
||||
}
|
||||
|
||||
void AstNode::checkTree() {
|
||||
if (!debug()) return;
|
||||
if (this->backp()) {
|
||||
// Linked tree- check only the passed node
|
||||
this->checkTreeIter(this->backp());
|
||||
} else {
|
||||
this->checkTreeIterList(this->backp());
|
||||
switch (this->type()) {
|
||||
#include "V3Ast__gen_op_checks.h"
|
||||
default: VL_UNREACHABLE; // LCOV_EXCL_LINE
|
||||
}
|
||||
}
|
||||
|
||||
@ -1151,7 +1122,7 @@ void AstNode::dumpTreeFile(const string& filename, bool append, bool doDump, boo
|
||||
if (logsp->fail()) v3fatal("Can't write " << filename);
|
||||
*logsp << "Verilator Tree Dump (format 0x3900) from <e" << std::dec << editCountLast();
|
||||
*logsp << "> to <e" << std::dec << editCountGbl() << ">\n";
|
||||
if (editCountGbl() == editCountLast() && !(v3Global.opt.dumpTree() >= 9)) {
|
||||
if (editCountGbl() == editCountLast() && ::dumpTree() < 9) {
|
||||
*logsp << '\n';
|
||||
*logsp << "No changes since last dump!\n";
|
||||
} else {
|
||||
@ -1161,7 +1132,7 @@ void AstNode::dumpTreeFile(const string& filename, bool append, bool doDump, boo
|
||||
}
|
||||
}
|
||||
if (doDump && v3Global.opt.debugEmitV()) V3EmitV::debugEmitV(filename + ".v");
|
||||
if (doCheck && (v3Global.opt.debugCheck() || v3Global.opt.dumpTree())) {
|
||||
if (doCheck && (v3Global.opt.debugCheck() || ::dumpTree())) {
|
||||
// Error check
|
||||
checkTree();
|
||||
// Broken isn't part of check tree because it can munge iterp's
|
||||
|
@ -1524,8 +1524,7 @@ class AstNode VL_NOT_FINAL {
|
||||
private:
|
||||
AstNode* cloneTreeIter();
|
||||
AstNode* cloneTreeIterList();
|
||||
void checkTreeIter(AstNode* backp);
|
||||
void checkTreeIterList(AstNode* backp);
|
||||
void checkTreeIter(const AstNode* backp) const;
|
||||
bool gateTreeIter() const;
|
||||
static bool sameTreeIter(const AstNode* node1p, const AstNode* node2p, bool ignNext,
|
||||
bool gateOnly);
|
||||
@ -1880,7 +1879,9 @@ public:
|
||||
// Does tree of this == node2p?, not allowing non-isGateOptimizable
|
||||
inline bool sameGateTree(const AstNode* node2p) const;
|
||||
void deleteTree(); // Always deletes the next link
|
||||
void checkTree(); // User Interface version
|
||||
void checkTree() const {
|
||||
if (v3Global.opt.debugCheck()) checkTreeIter(backp());
|
||||
}
|
||||
void checkIter() const;
|
||||
void dumpPtrs(std::ostream& os = std::cout) const;
|
||||
void dumpTree(std::ostream& os = std::cout, const string& indent = " ",
|
||||
|
@ -281,7 +281,7 @@ public:
|
||||
class AstAssocArrayDType final : public AstNodeDType {
|
||||
// Associative array data type, ie "[some_dtype]"
|
||||
// @astgen op1 := childDTypep : Optional[AstNodeDType] // moved to refDTypep() in V3Width
|
||||
// @astgen op2 := keyChildDTypep : AstNodeDType // the key, which remains here as a pointer
|
||||
// @astgen op2 := keyChildDTypep : Optional[AstNodeDType]
|
||||
private:
|
||||
AstNodeDType* m_refDTypep; // Elements of this type (after widthing)
|
||||
AstNodeDType* m_keyDTypep; // Keys of this type (after widthing)
|
||||
@ -1000,7 +1000,7 @@ public:
|
||||
bool isCompound() const override { return true; }
|
||||
};
|
||||
class AstRefDType final : public AstNodeDType {
|
||||
// @astgen op1 := typeofp : AstNode
|
||||
// @astgen op1 := typeofp : Optional[AstNode]
|
||||
// @astgen op2 := classOrPackageOpp : Optional[AstNode]
|
||||
// @astgen op3 := paramsp : List[AstPin]
|
||||
private:
|
||||
|
@ -187,7 +187,6 @@ protected:
|
||||
public:
|
||||
ASTGEN_MEMBERS_NodeTermop;
|
||||
// Know no children, and hot function, so skip iterator for speed
|
||||
// See checkTreeIter also that asserts no children
|
||||
// cppcheck-suppress functionConst
|
||||
void iterateChildren(VNVisitor& v) {}
|
||||
void dump(std::ostream& str) const override;
|
||||
@ -339,7 +338,6 @@ public:
|
||||
AstNodeModule* classOrPackagep() const { return m_classOrPackagep; }
|
||||
void classOrPackagep(AstNodeModule* nodep) { m_classOrPackagep = nodep; }
|
||||
// Know no children, and hot function, so skip iterator for speed
|
||||
// See checkTreeIter also that asserts no children
|
||||
// cppcheck-suppress functionConst
|
||||
void iterateChildren(VNVisitor& v) {}
|
||||
};
|
||||
@ -825,7 +823,7 @@ class AstImplication final : public AstNodeMath {
|
||||
// Verilog |-> |=>
|
||||
// @astgen op1 := lhsp : AstNode
|
||||
// @astgen op2 := rhsp : AstNode
|
||||
// @astgen op3 := sentreep : AstSenTree
|
||||
// @astgen op3 := sentreep : Optional[AstSenTree]
|
||||
public:
|
||||
AstImplication(FileLine* fl, AstNode* lhsp, AstNode* rhsp)
|
||||
: ASTGEN_SUPER_Implication(fl) {
|
||||
|
@ -433,7 +433,7 @@ public:
|
||||
};
|
||||
class AstNodeFTaskRef VL_NOT_FINAL : public AstNodeStmt {
|
||||
// A reference to a task (or function)
|
||||
// @astgen op1 := namep : AstNode
|
||||
// @astgen op1 := namep : Optional[AstNode]
|
||||
// op2 used by some sub-types only
|
||||
// @astgen op3 := pinsp : List[AstNode]
|
||||
// @astgen op4 := scopeNamep : Optional[AstScopeName]
|
||||
@ -1737,7 +1737,7 @@ public:
|
||||
};
|
||||
class AstSenItem final : public AstNode {
|
||||
// Parents: SENTREE
|
||||
// @astgen op1 := sensp : AstNode // Sensitivity expression
|
||||
// @astgen op1 := sensp : Optional[AstNode] // Sensitivity expression
|
||||
VEdgeType m_edgeType; // Edge type
|
||||
public:
|
||||
class Combo {}; // for constructor type-overload selection
|
||||
@ -3523,7 +3523,8 @@ class AstTraceDecl final : public AstNodeStmt {
|
||||
// Trace point declaration
|
||||
// Separate from AstTraceInc; as a declaration can't be deleted
|
||||
// Parents: {statement list}
|
||||
// @astgen op1 := valuep : AstNode // Expressio being traced
|
||||
// Expression being traced - Moved to AstTraceInc by V3Trace
|
||||
// @astgen op1 := valuep : Optional[AstNode]
|
||||
private:
|
||||
uint32_t m_code = 0; // Trace identifier code; converted to ASCII by trace routines
|
||||
const string m_showname; // Name of variable
|
||||
|
@ -35,6 +35,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class BeginState final {
|
||||
@ -71,7 +73,6 @@ private:
|
||||
bool m_underFork = false; // True if the current statement is directly under a fork
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
string dot(const string& a, const string& b) {
|
||||
if (a == "") return b;
|
||||
@ -343,5 +344,5 @@ void V3Begin::debeginAll(AstNetlist* nodep) {
|
||||
{ BeginVisitor{nodep, &state}; }
|
||||
if (state.anyFuncInBegin()) { BeginRelinkVisitor{nodep, &state}; }
|
||||
} // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("begin", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("begin", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -33,6 +33,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Branch state, as a visitor of each AstNode
|
||||
|
||||
@ -49,7 +51,6 @@ private:
|
||||
std::vector<AstCFunc*> m_cfuncsp; // List of all tasks
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void reset() {
|
||||
m_likely = false;
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Generation counter for AstNode::m_brokenState
|
||||
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
class VCtorType final {
|
||||
public:
|
||||
enum en : uint8_t { MODULE, CLASS, COVERAGE };
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
// Visit within a module all nodes and data types they reference, finding
|
||||
@ -106,5 +108,5 @@ void V3CUse::cUseAll() {
|
||||
// for each output file and put under that
|
||||
CUseVisitor{modp};
|
||||
}
|
||||
V3Global::dumpCheckGlobalTree("cuse", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("cuse", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -45,6 +45,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
#define CASE_OVERLAP_WIDTH 16 // Maximum width we can check for overlaps in
|
||||
#define CASE_BARF 999999 // Magic width when non-constant
|
||||
#define CASE_ENCODER_GROUP_DEPTH 8 // Levels of priority to be ORed together in top IF tree
|
||||
@ -57,7 +59,6 @@ private:
|
||||
= nullptr; // Under a CASE value node, if so the relevant case statement
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void visit(AstNodeCase* nodep) override {
|
||||
if (VN_IS(nodep, Case) && VN_AS(nodep, Case)->casex()) {
|
||||
@ -138,7 +139,6 @@ private:
|
||||
std::array<AstNode*, 1 << CASE_OVERLAP_WIDTH> m_valueItem;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool isCaseTreeFast(AstCase* nodep) {
|
||||
int width = 0;
|
||||
@ -533,7 +533,7 @@ public:
|
||||
void V3Case::caseAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ CaseVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("case", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("case", 0, dumpTree() >= 3);
|
||||
}
|
||||
void V3Case::caseLint(AstNodeCase* nodep) {
|
||||
UINFO(4, __FUNCTION__ << ": " << endl);
|
||||
|
@ -47,6 +47,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Cast state, as a visitor of each AstNode
|
||||
|
||||
@ -60,7 +62,6 @@ private:
|
||||
// STATE
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void insertCast(AstNode* nodep, int needsize) { // We'll insert ABOVE passed node
|
||||
UINFO(4, " NeedCast " << nodep << endl);
|
||||
@ -207,5 +208,5 @@ public:
|
||||
void V3Cast::castAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ CastVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("cast", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("cast", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -38,13 +38,14 @@
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
constexpr int CDC_WEIGHT_ASYNC = 0x1000; // Weight for edges that feed async logic
|
||||
|
||||
//######################################################################
|
||||
|
||||
class CdcBaseVisitor VL_NOT_FINAL : public VNVisitor {
|
||||
public:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
@ -323,13 +324,11 @@ private:
|
||||
|
||||
void analyze() {
|
||||
UINFO(3, __FUNCTION__ << ": " << endl);
|
||||
// if (debug() > 6) m_graph.dump();
|
||||
if (debug() > 6) m_graph.dumpDotFilePrefixed("cdc_pre");
|
||||
if (dumpGraph() > 6) m_graph.dumpDotFilePrefixed("cdc_pre");
|
||||
// This will MAX across edge weights
|
||||
m_graph.removeRedundantEdges(&V3GraphEdge::followAlwaysTrue);
|
||||
//
|
||||
m_graph.removeRedundantEdges(
|
||||
&V3GraphEdge::followAlwaysTrue); // This will MAX across edge weights
|
||||
//
|
||||
m_graph.dumpDotFilePrefixed("cdc_simp");
|
||||
if (dumpGraph() >= 3) m_graph.dumpDotFilePrefixed("cdc_simp");
|
||||
//
|
||||
analyzeReset();
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include "V3Ast.h"
|
||||
#include "V3Global.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class ClassVisitor final : public VNVisitor {
|
||||
@ -47,7 +49,6 @@ private:
|
||||
std::vector<std::pair<AstNode*, AstNodeModule*>> m_toPackageMoves;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void visit(AstClass* nodep) override {
|
||||
if (nodep->user1SetOnce()) return;
|
||||
@ -207,5 +208,5 @@ public:
|
||||
void V3Class::classAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ ClassVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("class", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("class", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -33,6 +33,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Clean state, as a visitor of each AstNode
|
||||
|
||||
@ -54,7 +56,6 @@ private:
|
||||
const AstNodeModule* m_modp = nullptr;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// Width resetting
|
||||
int cppWidth(AstNode* nodep) {
|
||||
@ -317,5 +318,5 @@ public:
|
||||
void V3Clean::cleanAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ CleanVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("clean", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("clean", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -38,6 +38,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Convert every WRITE AstVarRef to a READ ref
|
||||
|
||||
@ -79,7 +81,6 @@ private:
|
||||
bool m_inSampled = false; // True inside a sampled expression
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
AstNode* createSenseEquation(AstSenItem* nodesp) {
|
||||
AstNode* senEqnp = nullptr;
|
||||
@ -221,5 +222,5 @@ public:
|
||||
void V3Clock::clockAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ ClockVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("clock", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("clock", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -33,6 +33,8 @@
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
class CombineVisitor final : VNVisitor {
|
||||
// NODE STATE
|
||||
// AstNodeModule::user1() List of AstCFuncs in this module (via m_cfuncs)
|
||||
@ -57,7 +59,6 @@ class CombineVisitor final : VNVisitor {
|
||||
VDouble0 m_cfuncsCombined; // Statistic tracking
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void removeEmptyFunctions(std::list<AstCFunc*>& funcps) {
|
||||
for (funcit_t it = funcps.begin(), nit; it != funcps.end(); it = nit) {
|
||||
@ -235,5 +236,5 @@ public:
|
||||
void V3Combine::combineAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
CombineVisitor::apply(nodep);
|
||||
V3Global::dumpCheckGlobalTree("combine", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("combine", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "V3EmitCBase.h"
|
||||
#include "V3Global.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Common component builders
|
||||
|
||||
@ -117,5 +119,5 @@ void V3Common::commonAll() {
|
||||
makeToStringMiddle(classp);
|
||||
}
|
||||
}
|
||||
V3Global::dumpCheckGlobalTree("common", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("common", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Resolve wildcards in files, modules, ftasks or variables
|
||||
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Utilities
|
||||
|
||||
@ -350,7 +352,6 @@ class ConstBitOpTreeVisitor final : public VNVisitor {
|
||||
std::vector<std::unique_ptr<VarInfo>> m_varInfos; // VarInfo for each variable, [0] is nullptr
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool isAndTree() const { return VN_IS(m_rootp, And); }
|
||||
bool isOrTree() const { return VN_IS(m_rootp, Or); }
|
||||
@ -893,7 +894,6 @@ private:
|
||||
V3UniqueNames m_concswapNames; // For generating unique temporary variable names
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool operandConst(AstNode* nodep) { return VN_IS(nodep, Const); }
|
||||
bool operandAsvConst(const AstNode* nodep) {
|
||||
@ -3680,7 +3680,7 @@ void V3Const::constifyAllLint(AstNetlist* nodep) {
|
||||
ConstVisitor visitor{ConstVisitor::PROC_V_WARN, /* globalPass: */ true};
|
||||
(void)visitor.mainAcceptEdit(nodep);
|
||||
} // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("const", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("const", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3Const::constifyCpp(AstNetlist* nodep) {
|
||||
@ -3689,7 +3689,7 @@ void V3Const::constifyCpp(AstNetlist* nodep) {
|
||||
ConstVisitor visitor{ConstVisitor::PROC_CPP, /* globalPass: */ true};
|
||||
(void)visitor.mainAcceptEdit(nodep);
|
||||
} // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("const_cpp", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("const_cpp", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
AstNode* V3Const::constifyEdit(AstNode* nodep) {
|
||||
@ -3713,7 +3713,7 @@ void V3Const::constifyAllLive(AstNetlist* nodep) {
|
||||
ConstVisitor visitor{ConstVisitor::PROC_LIVE, /* globalPass: */ true};
|
||||
(void)visitor.mainAcceptEdit(nodep);
|
||||
} // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("const", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("const", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3Const::constifyAll(AstNetlist* nodep) {
|
||||
@ -3723,7 +3723,7 @@ void V3Const::constifyAll(AstNetlist* nodep) {
|
||||
ConstVisitor visitor{ConstVisitor::PROC_V_EXPENSIVE, /* globalPass: */ true};
|
||||
(void)visitor.mainAcceptEdit(nodep);
|
||||
} // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("const", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("const", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
AstNode* V3Const::constifyExpensiveEdit(AstNode* nodep) {
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Coverage state, as a visitor of each AstNode
|
||||
|
||||
@ -86,7 +88,6 @@ private:
|
||||
m_handleLines; // All line numbers for a given m_stateHandle
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
const char* varIgnoreToggle(AstVar* nodep) {
|
||||
// Return true if this shouldn't be traced
|
||||
@ -546,5 +547,5 @@ public:
|
||||
void V3Coverage::coverage(AstNetlist* rootp) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ CoverageVisitor{rootp}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("coverage", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("coverage", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// CoverageJoin state, as a visitor of each AstNode
|
||||
|
||||
@ -42,7 +44,6 @@ private:
|
||||
VDouble0 m_statToggleJoins; // Statistic tracking
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void detectDuplicates() {
|
||||
UINFO(9, "Finding duplicates\n");
|
||||
@ -116,5 +117,5 @@ public:
|
||||
void V3CoverageJoin::coverageJoin(AstNetlist* rootp) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ CoverageJoinVisitor{rootp}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("coveragejoin", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("coveragejoin", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -44,6 +44,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Dead state, as a visitor of each AstNode
|
||||
|
||||
@ -78,7 +80,6 @@ private:
|
||||
bool m_sideEffect = false; // Side effects discovered in assign RHS
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void checkAll(AstNode* nodep) {
|
||||
if (nodep != nodep->dtypep()) { // NodeDTypes reference themselves
|
||||
@ -461,30 +462,29 @@ public:
|
||||
void V3Dead::deadifyModules(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DeadVisitor{nodep, false, false, false, false}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("deadModules", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("deadModules", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
||||
void V3Dead::deadifyDTypes(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DeadVisitor{nodep, false, true, false, false}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("deadDtypes", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("deadDtypes", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3Dead::deadifyDTypesScoped(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DeadVisitor{nodep, false, true, true, false}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("deadDtypesScoped", 0,
|
||||
v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("deadDtypesScoped", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3Dead::deadifyAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DeadVisitor{nodep, true, true, false, true}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("deadAll", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("deadAll", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3Dead::deadifyAllScoped(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DeadVisitor{nodep, true, true, true, true}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("deadAllScoped", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("deadAllScoped", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -61,6 +61,8 @@
|
||||
#include <deque>
|
||||
#include <map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Delayed state, as a visitor of each AstNode
|
||||
|
||||
@ -106,7 +108,6 @@ private:
|
||||
std::unordered_map<const AstVarScope*, int> m_scopeVecMap; // Next var number for each scope
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void markVarUsage(AstNodeVarRef* nodep, bool blocking) {
|
||||
// Ignore if warning is disabled on this reference (used by V3Force).
|
||||
@ -623,5 +624,5 @@ public:
|
||||
void V3Delayed::delayedAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DelayedVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("delayed", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("delayed", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class DepthVisitor final : public VNVisitor {
|
||||
@ -49,7 +51,6 @@ private:
|
||||
V3UniqueNames m_tempNames; // For generating unique temporary variable names
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void createDeepTemp(AstNode* nodep) {
|
||||
UINFO(6, " Deep " << nodep << endl);
|
||||
@ -171,5 +172,5 @@ public:
|
||||
void V3Depth::depthAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DepthVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("depth", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("depth", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -31,6 +31,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class DepthBlockVisitor final : public VNVisitor {
|
||||
@ -44,7 +46,6 @@ private:
|
||||
int m_deepNum = 0; // How many functions made
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
AstCFunc* createDeepFunc(AstNode* nodep) {
|
||||
VNRelinker relinkHandle;
|
||||
@ -131,5 +132,5 @@ public:
|
||||
void V3DepthBlock::depthBlockAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DepthBlockVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("deepblock", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("deepblock", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -33,6 +33,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class DescopeVisitor final : public VNVisitor {
|
||||
@ -53,7 +55,6 @@ private:
|
||||
FuncMmap m_modFuncs; // Name of public functions added
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
static bool modIsSingleton(AstNodeModule* modp) {
|
||||
// True iff there's exactly one instance of this module in the design (including top).
|
||||
@ -279,5 +280,5 @@ public:
|
||||
void V3Descope::descopeAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ DescopeVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("descope", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("descope", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// V3DupFinder class functions
|
||||
|
||||
@ -98,7 +100,5 @@ void V3DupFinder::dumpFile(const string& filename, bool tree) {
|
||||
}
|
||||
|
||||
void V3DupFinder::dumpFilePrefixed(const string& nameComment, bool tree) {
|
||||
if (v3Global.opt.dumpTree()) { //
|
||||
dumpFile(v3Global.debugFilename(nameComment) + ".hash", tree);
|
||||
}
|
||||
if (dump()) dumpFile(v3Global.debugFilename(nameComment) + ".hash", tree);
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ public:
|
||||
}
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// Expose minimal set of superclass interface
|
||||
using Super::begin;
|
||||
|
@ -32,7 +32,6 @@ class EmitCConstInit VL_NOT_FINAL : public EmitCBaseVisitor {
|
||||
uint32_t m_unpackedWord = 0;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
uint32_t tabModulus(AstNodeDType* dtypep) {
|
||||
const uint32_t elemBytes = dtypep->widthTotalBytes();
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <algorithm>
|
||||
#include <cinttypes>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Const pool emitter
|
||||
|
||||
@ -38,7 +40,6 @@ class EmitCConstPool final : public EmitCConstInit {
|
||||
VDouble0 m_constsEmitted;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
V3OutCFile* newOutCFile() const {
|
||||
const string fileName = v3Global.opt.makeDir() + "/" + topClassName() + "__ConstPool_"
|
||||
|
@ -90,8 +90,6 @@ class EmitCLazyDecls final : public VNVisitor {
|
||||
|
||||
void visit(AstNode* nodep) override { iterateChildrenConst(nodep); }
|
||||
|
||||
VL_DEBUG_FUNC;
|
||||
|
||||
public:
|
||||
explicit EmitCLazyDecls(EmitCBaseVisitor& emitter)
|
||||
: m_emitter(emitter) {}
|
||||
@ -153,7 +151,6 @@ protected:
|
||||
|
||||
public:
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// ACCESSORS
|
||||
void splitSizeInc(int count) { m_splitSize += count; }
|
||||
|
@ -24,12 +24,13 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Internal EmitC implementation
|
||||
|
||||
class EmitCHeader final : public EmitCConstInit {
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void decorateFirst(bool& first, const string& str) {
|
||||
if (first) {
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Visitor that gathers the headers required by an AstCFunc
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class EmitCInlines final : EmitCBaseVisitor {
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class EmitCMain final : EmitCBaseVisitor {
|
||||
|
@ -26,13 +26,14 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
//######################################################################
|
||||
// Emit statements
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
// ######################################################################
|
||||
// Emit statements
|
||||
|
||||
class CMakeEmitter final {
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// STATIC FUNCTIONS
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
class EmitCModel final : public EmitCFunc {
|
||||
// TYPES
|
||||
using CFuncVector = std::vector<const AstCFunc*>;
|
||||
@ -34,8 +36,6 @@ class EmitCModel final : public EmitCFunc {
|
||||
V3UniqueNames m_uniqueNames; // For generating unique file names
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC;
|
||||
|
||||
CFuncVector findFuncps(std::function<bool(const AstCFunc*)> cb) {
|
||||
CFuncVector funcps;
|
||||
for (AstNode* nodep = m_modp->stmtsp(); nodep; nodep = nodep->nextp()) {
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Symbol table emitting
|
||||
|
||||
|
@ -24,13 +24,14 @@
|
||||
#include "V3HierBlock.h"
|
||||
#include "V3Os.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Emit statements and math operators
|
||||
|
||||
class EmitMk final {
|
||||
public:
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void putMakeClassEntry(V3OutMkFile& of, const string& name) {
|
||||
of.puts("\t" + V3Os::filenameNonDirExt(name) + " \\\n");
|
||||
@ -404,7 +405,6 @@ public:
|
||||
V3OutMkFile of(m_makefile);
|
||||
emit(of);
|
||||
}
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Emit statements and math operators
|
||||
|
||||
@ -36,7 +38,6 @@ class EmitVBaseVisitor VL_NOT_FINAL : public EmitCBaseVisitor {
|
||||
AstSenTree* m_sensesp; // Domain for printing one a ALWAYS under a ACTIVE
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
virtual void puts(const string& str) = 0;
|
||||
virtual void putbs(const string& str) = 0;
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Emit statements and math operators
|
||||
|
||||
@ -39,7 +41,6 @@ class EmitXmlFileVisitor final : public VNVisitor {
|
||||
uint64_t m_id = 0;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// Outfile methods
|
||||
V3OutFile* ofp() const { return m_ofp; }
|
||||
@ -329,7 +330,6 @@ private:
|
||||
std::deque<FileLine*> m_nodeModules;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstNetlist* nodep) override {
|
||||
@ -377,7 +377,6 @@ private:
|
||||
bool m_hasChildren = false;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstConstPool*) override {}
|
||||
|
@ -20,6 +20,7 @@
|
||||
# include "V3Ast.h"
|
||||
# include "V3Global.h"
|
||||
# include "V3Stats.h"
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
@ -275,8 +276,10 @@ void V3Error::v3errorEnd(std::ostringstream& sstr, const string& extra) {
|
||||
s_tellManual = 2;
|
||||
}
|
||||
#ifndef V3ERROR_NO_GLOBAL_
|
||||
if (debug()) {
|
||||
if (dumpTree()) {
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree", 990));
|
||||
}
|
||||
if (debug()) {
|
||||
if (s_errorExitCb) s_errorExitCb();
|
||||
V3Stats::statsFinalAll(v3Global.rootp());
|
||||
V3Stats::statsReport();
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <set>
|
||||
@ -325,7 +326,6 @@ public:
|
||||
};
|
||||
|
||||
// Global versions, so that if the class doesn't define a operator, we get the functions anyways.
|
||||
inline int debug() { return V3Error::debugDefault(); }
|
||||
inline void v3errorEnd(std::ostringstream& sstr) { V3Error::v3errorEnd(sstr); }
|
||||
inline void v3errorEndFatal(std::ostringstream& sstr) {
|
||||
V3Error::v3errorEnd(sstr);
|
||||
@ -420,19 +420,47 @@ inline void v3errorEndFatal(std::ostringstream& sstr) {
|
||||
V3ERROR_NA; \
|
||||
return value
|
||||
|
||||
/// Declare a convenience debug() routine that may be added to any class in
|
||||
/// Verilator so that --debugi-<srcfile> will work to control UINFOs in
|
||||
/// that class:
|
||||
#define VL_DEBUG_FUNC \
|
||||
static int debug() { \
|
||||
// Helper macros for VL_DEFINE_DEBUG_FUNCTIONS
|
||||
#define VL_DEFINE_DEBUG(name) \
|
||||
VL_ATTR_UNUSED static int debug##name() { \
|
||||
static int level = -1; \
|
||||
if (VL_UNLIKELY(level < 0)) { \
|
||||
const int debugSrcLevel = v3Global.opt.debugSrcLevel(__FILE__); \
|
||||
if (!v3Global.opt.available()) return debugSrcLevel; \
|
||||
level = debugSrcLevel; \
|
||||
std::string tag{VL_STRINGIFY(name)}; \
|
||||
tag[0] = std::tolower(tag[0]); \
|
||||
const unsigned debugTag = v3Global.opt.debugLevel(tag); \
|
||||
const unsigned debugSrc = v3Global.opt.debugSrcLevel(__FILE__); \
|
||||
const unsigned debugLevel = debugTag >= debugSrc ? debugTag : debugSrc; \
|
||||
if (!v3Global.opt.available()) return static_cast<int>(debugLevel); \
|
||||
level = static_cast<int>(debugLevel); \
|
||||
} \
|
||||
return level; \
|
||||
}
|
||||
} \
|
||||
static_assert(true, "")
|
||||
|
||||
#define VL_DEFINE_DUMP(name) \
|
||||
VL_ATTR_UNUSED static int dump##name() { \
|
||||
static int level = -1; \
|
||||
if (VL_UNLIKELY(level < 0)) { \
|
||||
std::string tag{VL_STRINGIFY(name)}; \
|
||||
tag[0] = std::tolower(tag[0]); \
|
||||
const unsigned dumpTag = v3Global.opt.dumpLevel(tag); \
|
||||
const unsigned dumpSrc = v3Global.opt.dumpSrcLevel(__FILE__); \
|
||||
const unsigned dumpLevel = dumpTag >= dumpSrc ? dumpTag : dumpSrc; \
|
||||
if (!v3Global.opt.available()) return static_cast<int>(dumpLevel); \
|
||||
level = static_cast<int>(dumpLevel); \
|
||||
} \
|
||||
return level; \
|
||||
} \
|
||||
static_assert(true, "")
|
||||
|
||||
// Define debug*() and dump*() routines. This needs to be added to every compilation unit so that
|
||||
// --debugi-<tag/srcfile> and --dumpi-<tag/srcfile> can be used to control debug prints and dumping
|
||||
#define VL_DEFINE_DEBUG_FUNCTIONS \
|
||||
VL_DEFINE_DEBUG(); /* Define 'int debug()' */ \
|
||||
VL_DEFINE_DUMP(); /* Define 'int dump()' */ \
|
||||
VL_DEFINE_DUMP(Graph); /* Define 'int dumpGraph()' */ \
|
||||
VL_DEFINE_DUMP(Tree); /* Define 'int dumpTree()' */ \
|
||||
static_assert(true, "")
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -37,6 +37,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Expand state, as a visitor of each AstNode
|
||||
|
||||
@ -53,7 +55,6 @@ private:
|
||||
VDouble0 m_statWideLimited; // Statistic tracking
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool doExpand(AstNode* nodep) {
|
||||
++m_statWides;
|
||||
@ -898,5 +899,5 @@ public:
|
||||
void V3Expand::expandAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ ExpandVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("expand", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("expand", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -56,6 +56,8 @@
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
// If change this code, run a test with the below size set very small
|
||||
// #define INFILTER_IPC_BUFSIZ 16
|
||||
constexpr int INFILTER_IPC_BUFSIZ = (64 * 1024); // For debug, try this as a small number
|
||||
@ -346,7 +348,6 @@ class VInFilterImp final {
|
||||
|
||||
private:
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool readContents(const string& filename, StrList& outl) {
|
||||
if (m_pid) {
|
||||
|
@ -33,6 +33,8 @@
|
||||
#include <iomanip>
|
||||
#include <unordered_set>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// FileLineSingleton class functions
|
||||
|
||||
@ -83,12 +85,6 @@ void FileLineSingleton::fileNameNumMapDumpXml(std::ostream& os) {
|
||||
//######################################################################
|
||||
// VFileContents class functions
|
||||
|
||||
int VFileContent::debug() {
|
||||
static int level = -1;
|
||||
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
|
||||
return level;
|
||||
}
|
||||
|
||||
void VFileContent::pushText(const string& text) {
|
||||
if (m_lines.size() == 0) {
|
||||
m_lines.emplace_back(""); // no such thing as line [0]
|
||||
|
@ -77,7 +77,6 @@ public:
|
||||
void pushText(const string& text); // Add arbitrary text (need not be line-by-line)
|
||||
string getLine(int lineno) const;
|
||||
string ascii() const { return "ct" + cvtToStr(m_id); }
|
||||
static int debug();
|
||||
};
|
||||
std::ostream& operator<<(std::ostream& os, VFileContent* contentp);
|
||||
|
||||
|
@ -46,6 +46,8 @@
|
||||
#include "V3Error.h"
|
||||
#include "V3Global.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Convert force/release statements and signals marked 'forceable'
|
||||
|
||||
@ -305,5 +307,5 @@ void V3Force::forceAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
if (!v3Global.hasForceableSignals()) return;
|
||||
ForceConvertVisitor::apply(nodep);
|
||||
V3Global::dumpCheckGlobalTree("force", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("force", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -39,6 +39,8 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
class GateDedupeVarVisitor;
|
||||
|
||||
using GateVarRefList = std::list<AstNodeVarRef*>;
|
||||
@ -47,13 +49,6 @@ constexpr int GATE_DEDUP_MAX_DEPTH = 20;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class GateBaseVisitor VL_NOT_FINAL : public VNVisitor {
|
||||
public:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
|
||||
class GateLogicVertex;
|
||||
class GateVarVertex;
|
||||
class GateGraphBaseVisitor VL_NOT_FINAL {
|
||||
@ -64,7 +59,6 @@ public:
|
||||
virtual ~GateGraphBaseVisitor() = default;
|
||||
virtual VNUser visit(GateLogicVertex* vertexp, VNUser vu = VNUser{0}) = 0;
|
||||
virtual VNUser visit(GateVarVertex* vertexp, VNUser vu = VNUser{0}) = 0;
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
@ -194,7 +188,7 @@ public:
|
||||
//######################################################################
|
||||
// Is this a simple math expression with a single input and single output?
|
||||
|
||||
class GateOkVisitor final : public GateBaseVisitor {
|
||||
class GateOkVisitor final : public VNVisitor {
|
||||
private:
|
||||
// RETURN STATE
|
||||
bool m_isSimple = true; // Set false when we know it isn't simple
|
||||
@ -311,7 +305,7 @@ static void eliminate(AstNode* logicp,
|
||||
// ######################################################################
|
||||
// Gate class functions
|
||||
|
||||
class GateVisitor final : public GateBaseVisitor {
|
||||
class GateVisitor final : public VNVisitor {
|
||||
private:
|
||||
// NODE STATE
|
||||
// Entire netlist:
|
||||
@ -423,13 +417,12 @@ private:
|
||||
// VISITORS
|
||||
void visit(AstNetlist* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
// if (debug() > 6) m_graph.dump();
|
||||
if (debug() > 6) m_graph.dumpDotFilePrefixed("gate_pre");
|
||||
if (dumpGraph() >= 3) m_graph.dumpDotFilePrefixed("gate_pre");
|
||||
warnSignals(); // Before loss of sync/async pointers
|
||||
// Decompose clock vectors -- need to do this before removing redundant edges
|
||||
decomposeClkVectors();
|
||||
m_graph.removeRedundantEdgesSum(&V3GraphEdge::followAlwaysTrue);
|
||||
m_graph.dumpDotFilePrefixed("gate_simp");
|
||||
if (dumpGraph() >= 6) m_graph.dumpDotFilePrefixed("gate_simp");
|
||||
// Find gate interconnect and optimize
|
||||
m_graph.userClearVertices(); // vertex->user(): bool. Indicates we've set it as consumed
|
||||
// Get rid of buffers first,
|
||||
@ -441,15 +434,15 @@ private:
|
||||
// Remove redundant logic
|
||||
if (v3Global.opt.fDedupe()) {
|
||||
dedupe();
|
||||
if (debug() >= 6) m_graph.dumpDotFilePrefixed("gate_dedup");
|
||||
if (dumpGraph() >= 6) m_graph.dumpDotFilePrefixed("gate_dedup");
|
||||
}
|
||||
if (v3Global.opt.fAssemble()) {
|
||||
mergeAssigns();
|
||||
if (debug() >= 6) m_graph.dumpDotFilePrefixed("gate_assm");
|
||||
if (dumpGraph() >= 6) m_graph.dumpDotFilePrefixed("gate_assm");
|
||||
}
|
||||
// Consumption warnings
|
||||
consumedMark();
|
||||
m_graph.dumpDotFilePrefixed("gate_opt");
|
||||
if (dumpGraph() >= 3) m_graph.dumpDotFilePrefixed("gate_opt");
|
||||
// Rewrite assignments
|
||||
consumedMove();
|
||||
}
|
||||
@ -791,8 +784,6 @@ private:
|
||||
V3DupFinder m_dupFinder; // Duplicate finder for rhs of assigns
|
||||
std::unordered_set<AstNode*> m_nodeDeleteds; // Any node in this hash was deleted
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool same(AstNode* node1p, AstNode* node2p) {
|
||||
// Regarding the complexity of this funcition 'same':
|
||||
// Applying this comparison function to a a set of n trees pairwise is O(n^2) in the
|
||||
@ -897,7 +888,7 @@ public:
|
||||
//######################################################################
|
||||
// Have we seen the rhs of this assign before?
|
||||
|
||||
class GateDedupeVarVisitor final : public GateBaseVisitor {
|
||||
class GateDedupeVarVisitor final : public VNVisitor {
|
||||
// Given a node, it is visited to try to find the AstNodeAssign under
|
||||
// it that can used for dedupe.
|
||||
// Right now, only the following node trees are supported for dedupe.
|
||||
@ -1081,7 +1072,6 @@ private:
|
||||
const GateLogicVertex* const consumeVertexp
|
||||
= static_cast<GateLogicVertex*>(outedgep->top());
|
||||
AstNode* const consumerp = consumeVertexp->nodep();
|
||||
// if (debug() >= 9) m_graphp->dumpDotFilePrefixed("gate_preelim");
|
||||
UINFO(9,
|
||||
"elim src vtx" << lvertexp << " node " << lvertexp->nodep() << endl);
|
||||
UINFO(9,
|
||||
@ -1297,7 +1287,7 @@ void GateVisitor::mergeAssigns() {
|
||||
//######################################################################
|
||||
// Find a var's offset in a concatenation
|
||||
|
||||
class GateConcatVisitor final : public GateBaseVisitor {
|
||||
class GateConcatVisitor final : public VNVisitor {
|
||||
private:
|
||||
// STATE
|
||||
const AstVarScope* m_vscp = nullptr; // Varscope we're trying to find
|
||||
@ -1493,5 +1483,5 @@ void GateVisitor::decomposeClkVectors() {
|
||||
void V3Gate::gateAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ const GateVisitor visitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("gate", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("gate", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -28,8 +28,7 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
int V3Graph::s_debug = 0;
|
||||
int V3Graph::debug() { return std::max(V3Error::debugDefault(), s_debug); }
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
@ -312,9 +311,7 @@ void V3Graph::dumpEdge(std::ostream& os, V3GraphVertex* vertexp, V3GraphEdge* ed
|
||||
}
|
||||
|
||||
void V3Graph::dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph) const {
|
||||
if (v3Global.opt.dumpTree()) {
|
||||
dumpDotFile(v3Global.debugFilename(nameComment) + ".dot", colorAsSubgraph);
|
||||
}
|
||||
dumpDotFile(v3Global.debugFilename(nameComment) + ".dot", colorAsSubgraph);
|
||||
}
|
||||
|
||||
//! Variant of dumpDotFilePrefixed without --dump option check
|
||||
|
@ -81,7 +81,6 @@ class V3Graph VL_NOT_FINAL {
|
||||
private:
|
||||
// MEMBERS
|
||||
V3List<V3GraphVertex*> m_vertices; // All vertices
|
||||
static int s_debug;
|
||||
|
||||
protected:
|
||||
friend class V3GraphVertex;
|
||||
@ -92,12 +91,10 @@ protected:
|
||||
void dumpEdge(std::ostream& os, V3GraphVertex* vertexp, V3GraphEdge* edgep);
|
||||
void verticesUnlink() { m_vertices.reset(); }
|
||||
// ACCESSORS
|
||||
static int debug();
|
||||
|
||||
public:
|
||||
V3Graph();
|
||||
virtual ~V3Graph();
|
||||
static void debug(int level) { s_debug = level; }
|
||||
virtual string dotRankDir() const { return "TB"; } // rankdir for dot plotting
|
||||
|
||||
// METHODS
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
// Algorithms - acyclic
|
||||
@ -104,8 +106,6 @@ private:
|
||||
m_origEdgeFuncp; // Function that says we follow this edge (in original graph)
|
||||
uint32_t m_placeStep = 0; // Number that user() must be equal to to indicate processing
|
||||
|
||||
static int debug() { return V3Graph::debug(); }
|
||||
|
||||
// METHODS
|
||||
void buildGraph(V3Graph* origGraphp);
|
||||
void buildGraphIterate(V3GraphVertex* overtexp, GraphAcycVertex* avertexp);
|
||||
@ -544,28 +544,28 @@ void GraphAcyc::main() {
|
||||
// edges (and thus can't represent loops - if we did the unbreakable
|
||||
// marking right, anyways)
|
||||
buildGraph(m_origGraphp);
|
||||
if (debug() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_pre");
|
||||
if (dumpGraph() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_pre");
|
||||
|
||||
// Perform simple optimizations before any cuttings
|
||||
simplify(false);
|
||||
if (debug() >= 5) m_breakGraph.dumpDotFilePrefixed("acyc_simp");
|
||||
if (dumpGraph() >= 5) m_breakGraph.dumpDotFilePrefixed("acyc_simp");
|
||||
|
||||
UINFO(4, " Cutting trivial loops\n");
|
||||
simplify(true);
|
||||
if (debug() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_mid");
|
||||
if (dumpGraph() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_mid");
|
||||
|
||||
UINFO(4, " Ranking\n");
|
||||
m_breakGraph.rank(&V3GraphEdge::followNotCutable);
|
||||
if (debug() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_rank");
|
||||
if (dumpGraph() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_rank");
|
||||
|
||||
UINFO(4, " Placement\n");
|
||||
place();
|
||||
if (debug() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_place");
|
||||
if (dumpGraph() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_place");
|
||||
|
||||
UINFO(4, " Final Ranking\n");
|
||||
// Only needed to assert there are no loops in completed graph
|
||||
m_breakGraph.rank(&V3GraphEdge::followAlwaysTrue);
|
||||
if (debug() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_done");
|
||||
if (dumpGraph() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_done");
|
||||
}
|
||||
|
||||
void V3Graph::acyclic(V3EdgeFuncP edgeFuncp) {
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
// Algorithms - weakly connected components
|
||||
@ -120,7 +122,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(GraphAlgRemoveTransitiveEdges);
|
||||
};
|
||||
|
||||
|
@ -56,7 +56,6 @@ private:
|
||||
void initHalfCriticalPaths(GraphWay way, bool checkOnly);
|
||||
void incGeneration() { ++m_generation; }
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(GraphPathChecker);
|
||||
};
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include "V3Global.h"
|
||||
#include "V3Graph.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
// Test class
|
||||
@ -34,14 +36,14 @@ protected:
|
||||
virtual string name() = 0; // Name of the test
|
||||
|
||||
// Utilities
|
||||
void dump() {
|
||||
if (debug() >= 9) m_graph.dumpDotFilePrefixed("v3graphtest_" + name());
|
||||
void dumpSelf() {
|
||||
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("v3graphtest_" + name());
|
||||
}
|
||||
|
||||
public:
|
||||
V3GraphTest() = default;
|
||||
virtual ~V3GraphTest() = default;
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void run() { runTest(); }
|
||||
};
|
||||
|
||||
@ -101,7 +103,7 @@ public:
|
||||
new V3GraphEdge(gp, g3, q, 2, true);
|
||||
|
||||
gp->stronglyConnected(&V3GraphEdge::followAlwaysTrue);
|
||||
dump();
|
||||
dumpSelf();
|
||||
|
||||
UASSERT(i->color() != a->color() && a->color() != g2->color() && g2->color() != q->color(),
|
||||
"SelfTest: Separate colors not assigned");
|
||||
@ -136,7 +138,7 @@ public:
|
||||
|
||||
gp->acyclic(&V3GraphEdge::followAlwaysTrue);
|
||||
gp->order();
|
||||
dump();
|
||||
dumpSelf();
|
||||
}
|
||||
};
|
||||
|
||||
@ -253,7 +255,7 @@ public:
|
||||
gp->acyclic(&V3GraphEdge::followAlwaysTrue);
|
||||
gp->order();
|
||||
|
||||
dump();
|
||||
dumpSelf();
|
||||
}
|
||||
};
|
||||
|
||||
@ -272,11 +274,11 @@ public:
|
||||
void runTest() override {
|
||||
V3Graph* const gp = &m_graph;
|
||||
dotImport();
|
||||
dump();
|
||||
dumpSelf();
|
||||
gp->acyclic(&V3GraphEdge::followAlwaysTrue);
|
||||
dump();
|
||||
dumpSelf();
|
||||
gp->rank(&V3GraphEdge::followAlwaysTrue);
|
||||
dump();
|
||||
dumpSelf();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Visitor that computes node hashes
|
||||
|
||||
@ -35,7 +37,6 @@ private:
|
||||
const bool m_cacheInUser4; // Use user4 to cache each V3Hash?
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
V3Hash hashNodeAndIterate(AstNode* nodep, bool hashDType, bool hashChildren,
|
||||
std::function<void()>&& f) {
|
||||
|
@ -40,7 +40,6 @@ public:
|
||||
~V3Hasher() = default;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// Compute hash of node. This method caches the hash in the node's user4().
|
||||
V3Hash operator()(AstNode* nodep) const;
|
||||
|
@ -86,6 +86,8 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
static string V3HierCommandArgsFileName(const string& prefix, bool forCMake) {
|
||||
return v3Global.opt.makeDir() + "/" + prefix
|
||||
+ (forCMake ? "_hierCMakeArgs.f" : "_hierMkArgs.f");
|
||||
@ -302,7 +304,6 @@ public:
|
||||
: m_planp{planp} {
|
||||
iterateChildren(netlist);
|
||||
}
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
|
@ -67,7 +67,6 @@ public:
|
||||
: m_modp{modp}
|
||||
, m_gparams{gparams} {}
|
||||
~V3HierBlock();
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void addParent(V3HierBlock* parentp) { m_parents.insert(parentp); }
|
||||
void addChild(V3HierBlock* childp) { m_children.insert(childp); }
|
||||
@ -107,7 +106,6 @@ public:
|
||||
using iterator = HierMap::iterator;
|
||||
using const_iterator = HierMap::const_iterator;
|
||||
using HierVector = std::vector<const V3HierBlock*>;
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void add(const AstNodeModule* modp, const std::vector<AstVar*>& gparams);
|
||||
void registerUsage(const AstNodeModule* parentp, const AstNodeModule* childp);
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
// CONFIG
|
||||
static const int INLINE_MODS_SMALLER = 100; // If a mod is < this # nodes, can always inline it
|
||||
|
||||
@ -95,7 +97,6 @@ private:
|
||||
std::unordered_map<AstNodeModule*, LocalInstanceMap> m_instances;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
void cantInline(const char* reason, bool hard) {
|
||||
if (hard) {
|
||||
if (m_modp->user2() != CIL_NOTHARD) {
|
||||
@ -256,9 +257,6 @@ private:
|
||||
AstNodeModule* const m_modp; // Current module
|
||||
const AstCell* const m_cellp; // Cell being cloned
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstCellInline* nodep) override {
|
||||
// Inlined cell under the inline cell, need to move to avoid conflicts
|
||||
@ -478,8 +476,6 @@ private:
|
||||
VDouble0 m_statCells; // Statistic tracking
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void inlineCell(AstCell* nodep) {
|
||||
UINFO(5, " Inline CELL " << nodep << endl);
|
||||
|
||||
@ -635,9 +631,6 @@ private:
|
||||
|
||||
string m_scope; // Scope name
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstNetlist* nodep) override { iterateChildren(nodep->topModulep()); }
|
||||
void visit(AstCell* nodep) override {
|
||||
@ -734,5 +727,5 @@ void V3Inline::inlineAll(AstNetlist* nodep) {
|
||||
}
|
||||
|
||||
{ InlineIntfRefVisitor{nodep}; }
|
||||
V3Global::dumpCheckGlobalTree("inline", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("inline", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Inst state, as a visitor of each AstNode
|
||||
|
||||
@ -45,9 +47,6 @@ private:
|
||||
// STATE
|
||||
AstCell* m_cellp = nullptr; // Current cell
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstCell* nodep) override {
|
||||
UINFO(4, " CELL " << nodep << endl);
|
||||
@ -146,8 +145,6 @@ private:
|
||||
// STATE
|
||||
std::map<const std::string, AstVar*> m_modVarNameMap; // Per module, name of cloned variables
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstVar* nodep) override {
|
||||
if (VN_IS(nodep->dtypep(), IfaceRefDType)) {
|
||||
@ -200,8 +197,6 @@ private:
|
||||
int m_instSelNum = 0; // Current instantiation count 0..N-1
|
||||
InstDeModVarVisitor m_deModVars; // State of variables for current cell module
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstVar* nodep) override {
|
||||
if (VN_IS(nodep->dtypep(), UnpackArrayDType)
|
||||
@ -492,7 +487,6 @@ public:
|
||||
|
||||
class InstStatic final {
|
||||
private:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
InstStatic() = default; // Static class
|
||||
|
||||
static AstNode* extendOrSel(FileLine* fl, AstNode* rhsp, AstNode* cmpWidthp) {
|
||||
@ -622,11 +616,11 @@ void V3Inst::checkOutputShort(AstPin* nodep) {
|
||||
void V3Inst::instAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ InstVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("inst", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("inst", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3Inst::dearrayAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ InstDeVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("dearray", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("dearray", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
/// Estimate the instruction cost for executing all logic within and below
|
||||
/// a given AST node. Note this estimates the number of instructions we'll
|
||||
/// execute, not the number we'll generate. That is, for conditionals,
|
||||
@ -290,7 +292,6 @@ private:
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(InstrCountVisitor);
|
||||
};
|
||||
|
||||
@ -326,7 +327,7 @@ private:
|
||||
}
|
||||
--m_depth;
|
||||
}
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
VL_UNCOPYABLE(InstrCountDumpVisitor);
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Structure for global state
|
||||
|
||||
@ -129,8 +131,6 @@ class LifeBlock final {
|
||||
LifeBlock* const m_aboveLifep; // Upper life, or nullptr
|
||||
LifeState* const m_statep; // Current global state
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
public:
|
||||
LifeBlock(LifeBlock* aboveLifep, LifeState* statep)
|
||||
: m_aboveLifep{aboveLifep} // Null if top
|
||||
@ -284,7 +284,6 @@ private:
|
||||
LifeBlock* m_lifep; // Current active lifetime map for current scope
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
void setNoopt() {
|
||||
m_noopt = true;
|
||||
m_lifep->clear();
|
||||
@ -512,5 +511,5 @@ void V3Life::lifeAll(AstNetlist* nodep) {
|
||||
LifeState state;
|
||||
LifeTopVisitor{nodep, &state};
|
||||
} // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("life", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("life", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include <memory> // for std::unique_ptr -> auto_ptr or unique_ptr
|
||||
#include <unordered_map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// LifePost class functions
|
||||
|
||||
@ -50,8 +52,6 @@ private:
|
||||
// AstVarScope::user4p() -> AstVarScope*, If set, replace this
|
||||
// varscope with specified new one
|
||||
// STATE
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITORS
|
||||
void visit(AstVarRef* nodep) override {
|
||||
@ -160,8 +160,6 @@ private:
|
||||
bool m_inEvalNba = false; // Traversing under _eval__nba
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool before(const LifeLocation& a, const LifeLocation& b) {
|
||||
if (a.mtaskp == b.mtaskp) return a.sequence < b.sequence;
|
||||
return m_checker->pathExistsFrom(a.mtaskp, b.mtaskp);
|
||||
@ -371,5 +369,5 @@ void V3LifePost::lifepostAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
// Mark redundant AssignPost
|
||||
{ LifePostDlyVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("life_post", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("life_post", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -39,6 +39,8 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Graph subclasses
|
||||
|
||||
@ -118,8 +120,6 @@ private:
|
||||
std::unordered_set<string> m_declfnWarned; // Files we issued DECLFILENAME on
|
||||
string m_origTopModuleName; // original name of the top module
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// METHODS
|
||||
V3GraphVertex* vertex(AstNodeModule* nodep) {
|
||||
// Return corresponding vertex for this module
|
||||
@ -167,7 +167,7 @@ private:
|
||||
iterateChildren(nodep);
|
||||
// Find levels in graph
|
||||
m_graph.removeRedundantEdges(&V3GraphEdge::followAlwaysTrue);
|
||||
m_graph.dumpDotFilePrefixed("linkcells");
|
||||
if (dumpGraph()) m_graph.dumpDotFilePrefixed("linkcells");
|
||||
m_graph.rank();
|
||||
for (V3GraphVertex* itp = m_graph.verticesBeginp(); itp; itp = itp->verticesNextp()) {
|
||||
if (const LinkCellsVertex* const vvertexp = dynamic_cast<LinkCellsVertex*>(itp)) {
|
||||
|
@ -76,8 +76,10 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
//######################################################################
|
||||
// Matcher classes (for suggestion matching)
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
// ######################################################################
|
||||
// Matcher classes (for suggestion matching)
|
||||
|
||||
class LinkNodeMatcherClass final : public VNodeMatcher {
|
||||
public:
|
||||
@ -162,14 +164,14 @@ private:
|
||||
|
||||
public:
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
void dump(const string& nameComment = "linkdot", bool force = false) {
|
||||
if (debug() >= 6 || force) {
|
||||
|
||||
void dumpSelf(const string& nameComment = "linkdot", bool force = false) {
|
||||
if (dump() >= 6 || force) {
|
||||
const string filename = v3Global.debugFilename(nameComment) + ".txt";
|
||||
const std::unique_ptr<std::ofstream> logp{V3File::new_ofstream(filename)};
|
||||
if (logp->fail()) v3fatal("Can't write " << filename);
|
||||
std::ostream& os = *logp;
|
||||
m_syms.dump(os);
|
||||
m_syms.dumpSelf(os);
|
||||
bool first = true;
|
||||
for (int samn = 0; samn < SAMN__MAX; ++samn) {
|
||||
if (!m_scopeAliasMap[samn].empty()) {
|
||||
@ -191,9 +193,9 @@ public:
|
||||
}
|
||||
void preErrorDump() {
|
||||
static bool diddump = false;
|
||||
if (!diddump && v3Global.opt.dumpTree()) {
|
||||
if (!diddump && dumpTree()) {
|
||||
diddump = true;
|
||||
dump("linkdot-preerr", true);
|
||||
dumpSelf("linkdot-preerr", true);
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("linkdot-preerr.tree"));
|
||||
}
|
||||
}
|
||||
@ -726,8 +728,6 @@ class LinkDotFindVisitor final : public VNVisitor {
|
||||
int m_modWithNum = 0; // With block number, 0=none seen
|
||||
|
||||
// METHODS
|
||||
static int debug() { return LinkDotState::debug(); }
|
||||
|
||||
void makeImplicitNew(AstClass* nodep) {
|
||||
AstFunc* const newp = new AstFunc(nodep->fileline(), "new", nullptr, nullptr);
|
||||
newp->isConstructor(true);
|
||||
@ -1400,8 +1400,6 @@ private:
|
||||
LinkDotState* const m_statep; // State to pass between visitors, including symbol table
|
||||
AstNodeModule* m_modp = nullptr; // Current module
|
||||
|
||||
static int debug() { return LinkDotState::debug(); }
|
||||
|
||||
void pinImplicitExprRecurse(AstNode* nodep) {
|
||||
// Under a pin, Check interconnect expression for a pin reference or a concat.
|
||||
// Create implicit variable as needed
|
||||
@ -1591,8 +1589,6 @@ class LinkDotScopeVisitor final : public VNVisitor {
|
||||
const AstScope* m_scopep = nullptr; // The current scope
|
||||
VSymEnt* m_modSymp = nullptr; // Symbol entry for current module
|
||||
|
||||
static int debug() { return LinkDotState::debug(); }
|
||||
|
||||
// VISITs
|
||||
void visit(AstNetlist* nodep) override {
|
||||
// Recurse..., backward as must do packages before using packages
|
||||
@ -1756,9 +1752,6 @@ class LinkDotIfaceVisitor final : public VNVisitor {
|
||||
LinkDotState* const m_statep; // State to pass between visitors, including symbol table
|
||||
VSymEnt* m_curSymp; // Symbol Entry for current table, where to lookup/insert
|
||||
|
||||
// METHODS
|
||||
static int debug() { return LinkDotState::debug(); }
|
||||
|
||||
// VISITs
|
||||
void visit(AstModport* nodep) override {
|
||||
// Modport: Remember its name for later resolution
|
||||
@ -1906,8 +1899,6 @@ private:
|
||||
}
|
||||
} m_ds; // State to preserve across recursions
|
||||
|
||||
static int debug() { return LinkDotState::debug(); }
|
||||
|
||||
// METHODS - Variables
|
||||
void createImplicitVar(VSymEnt* /*lookupSymp*/, AstVarRef* nodep, AstNodeModule* modp,
|
||||
VSymEnt* moduleSymp, bool noWarn) {
|
||||
@ -3176,21 +3167,19 @@ public:
|
||||
//######################################################################
|
||||
// Link class functions
|
||||
|
||||
int V3LinkDot::debug() { return LinkDotState::debug(); }
|
||||
|
||||
void V3LinkDot::linkDotGuts(AstNetlist* rootp, VLinkDotStep step) {
|
||||
if (LinkDotState::debug() >= 5 || v3Global.opt.dumpTree() >= 9) {
|
||||
if (debug() >= 5 || dumpTree() >= 9) {
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot.tree"));
|
||||
}
|
||||
LinkDotState state(rootp, step);
|
||||
const LinkDotFindVisitor visitor{rootp, &state};
|
||||
if (LinkDotState::debug() >= 5 || v3Global.opt.dumpTree() >= 9) {
|
||||
if (debug() >= 5 || dumpTree() >= 9) {
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot-find.tree"));
|
||||
}
|
||||
if (step == LDS_PRIMARY || step == LDS_PARAMED) {
|
||||
// Initial link stage, resolve parameters
|
||||
const LinkDotParamVisitor visitors{rootp, &state};
|
||||
if (LinkDotState::debug() >= 5 || v3Global.opt.dumpTree() >= 9) {
|
||||
if (debug() >= 5 || dumpTree() >= 9) {
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot-param.tree"));
|
||||
}
|
||||
} else if (step == LDS_ARRAYED) {
|
||||
@ -3199,16 +3188,40 @@ void V3LinkDot::linkDotGuts(AstNetlist* rootp, VLinkDotStep step) {
|
||||
// process AstScope's. This needs to be separate pass after whole hierarchy graph created.
|
||||
const LinkDotScopeVisitor visitors{rootp, &state};
|
||||
v3Global.assertScoped(true);
|
||||
if (LinkDotState::debug() >= 5 || v3Global.opt.dumpTree() >= 9) {
|
||||
if (debug() >= 5 || dumpTree() >= 9) {
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot-scoped.tree"));
|
||||
}
|
||||
} else {
|
||||
v3fatalSrc("Bad case");
|
||||
}
|
||||
state.dump();
|
||||
state.dumpSelf();
|
||||
state.computeIfaceModSyms();
|
||||
state.computeIfaceVarSyms();
|
||||
state.computeScopeAliases();
|
||||
state.dump();
|
||||
state.dumpSelf();
|
||||
{ LinkDotResolveVisitor{rootp, &state}; }
|
||||
}
|
||||
|
||||
void V3LinkDot::linkDotPrimary(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_PRIMARY);
|
||||
V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
||||
void V3LinkDot::linkDotParamed(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_PARAMED);
|
||||
V3Global::dumpCheckGlobalTree("linkdotparam", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3LinkDot::linkDotArrayed(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_ARRAYED);
|
||||
V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
||||
void V3LinkDot::linkDotScope(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_SCOPED);
|
||||
V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -28,32 +28,13 @@
|
||||
enum VLinkDotStep : uint8_t { LDS_PRIMARY, LDS_PARAMED, LDS_ARRAYED, LDS_SCOPED };
|
||||
|
||||
class V3LinkDot final {
|
||||
private:
|
||||
static int debug();
|
||||
static void linkDotGuts(AstNetlist* rootp, VLinkDotStep step);
|
||||
|
||||
public:
|
||||
static void linkDotPrimary(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_PRIMARY);
|
||||
V3Global::dumpCheckGlobalTree("linkdot", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
}
|
||||
static void linkDotParamed(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_PARAMED);
|
||||
V3Global::dumpCheckGlobalTree("linkdotparam", 0,
|
||||
v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
}
|
||||
static void linkDotArrayed(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_ARRAYED);
|
||||
V3Global::dumpCheckGlobalTree("linkdot", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
}
|
||||
static void linkDotScope(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
linkDotGuts(nodep, LDS_SCOPED);
|
||||
V3Global::dumpCheckGlobalTree("linkdot", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
}
|
||||
static void linkDotPrimary(AstNetlist* nodep);
|
||||
static void linkDotParamed(AstNetlist* nodep);
|
||||
static void linkDotArrayed(AstNetlist* nodep);
|
||||
static void linkDotScope(AstNetlist* nodep);
|
||||
};
|
||||
|
||||
#endif // Guard
|
||||
|
@ -46,6 +46,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class LinkIncVisitor final : public VNVisitor {
|
||||
@ -64,8 +66,6 @@ private:
|
||||
bool m_unsupportedHere = false; // Used to detect where it's not supported yet
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void insertBeforeStmt(AstNode* nodep, AstNode* newp) {
|
||||
// Return node that must be visited, if any
|
||||
// See also AstNode::addBeforeStmt; this predates that function
|
||||
@ -295,5 +295,5 @@ public:
|
||||
void V3LinkInc::linkIncrements(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ LinkIncVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("linkinc", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("linkinc", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class LinkJumpVisitor final : public VNVisitor {
|
||||
@ -54,8 +56,6 @@ private:
|
||||
std::vector<AstNodeBlock*> m_blockStack; // All begin blocks above current node
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
AstJumpLabel* findAddLabel(AstNode* nodep, bool endOfIter) {
|
||||
// Put label under given node, and if WHILE optionally at end of iteration
|
||||
UINFO(4, "Create label for " << nodep << endl);
|
||||
@ -292,5 +292,5 @@ public:
|
||||
void V3LinkJump::linkJump(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ LinkJumpVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("linkjump", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("linkjump", 0, dumpTree() >= 3);
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Link state, as a visitor of each AstNode
|
||||
|
||||
@ -41,9 +43,6 @@ private:
|
||||
VAccess m_setRefLvalue; // Set VarRefs to lvalues for pin assignments
|
||||
AstNodeFTask* m_ftaskp = nullptr; // Function or task we're inside
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITs
|
||||
// Result handing
|
||||
void visit(AstNodeVarRef* nodep) override {
|
||||
@ -345,7 +344,7 @@ public:
|
||||
void V3LinkLValue::linkLValue(AstNetlist* nodep) {
|
||||
UINFO(4, __FUNCTION__ << ": " << endl);
|
||||
{ LinkLValueVisitor{nodep, VAccess::NOCHANGE}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("linklvalue", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("linklvalue", 0, dumpTree() >= 6);
|
||||
}
|
||||
void V3LinkLValue::linkLValueSet(AstNode* nodep) {
|
||||
// Called by later link functions when it is known a node needs
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Levelizing class functions
|
||||
|
||||
@ -78,7 +80,7 @@ void V3LinkLevel::modSortByLevel() {
|
||||
UASSERT_OBJ(!v3Global.rootp()->modulesp(), v3Global.rootp(), "Unlink didn't work");
|
||||
for (AstNodeModule* nodep : mods) v3Global.rootp()->addModulesp(nodep);
|
||||
UINFO(9, "modSortByLevel() done\n"); // Comment required for gcc4.6.3 / bug666
|
||||
V3Global::dumpCheckGlobalTree("cells", false, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
||||
V3Global::dumpCheckGlobalTree("cells", false, dumpTree() >= 3);
|
||||
}
|
||||
|
||||
void V3LinkLevel::timescaling(const ModVec& mods) {
|
||||
@ -174,7 +176,7 @@ void V3LinkLevel::wrapTop(AstNetlist* rootp) {
|
||||
}
|
||||
}
|
||||
|
||||
V3Global::dumpCheckGlobalTree("wraptop", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("wraptop", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
||||
void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Link state, as a visitor of each AstNode
|
||||
|
||||
@ -62,8 +64,6 @@ private:
|
||||
VLifetime m_lifetime = VLifetime::STATIC; // Propagating lifetime
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void cleanFileline(AstNode* nodep) {
|
||||
if (!nodep->user2SetOnce()) { // Process once
|
||||
// We make all filelines unique per AstNode. This allows us to
|
||||
@ -617,5 +617,5 @@ public:
|
||||
void V3LinkParse::linkParse(AstNetlist* rootp) {
|
||||
UINFO(4, __FUNCTION__ << ": " << endl);
|
||||
{ LinkParseVisitor{rootp}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("linkparse", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("linkparse", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Link state, as a visitor of each AstNode
|
||||
|
||||
@ -55,9 +57,6 @@ private:
|
||||
int m_senitemCvtNum = 0; // Temporary signal counter
|
||||
bool m_underGenerate = false; // Under GenFor/GenIf
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITs
|
||||
// TODO: Most of these visitors are here for historical reasons.
|
||||
// TODO: ExpectDecriptor can move to data type resolution, and the rest
|
||||
@ -483,9 +482,6 @@ private:
|
||||
// STATE
|
||||
AstNodeModule* m_modp = nullptr; // Current module
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// VISITs
|
||||
void visit(AstNetlist* nodep) override {
|
||||
// Iterate modules backwards, in bottom-up order.
|
||||
@ -521,5 +517,5 @@ void V3LinkResolve::linkResolve(AstNetlist* rootp) {
|
||||
const LinkResolveVisitor visitor{rootp};
|
||||
LinkBotupVisitor{rootp};
|
||||
} // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("linkresolve", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("linkresolve", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// LocalizeVisitor
|
||||
|
||||
@ -62,8 +64,6 @@ private:
|
||||
std::vector<AstVarScope*> m_varScopeps; // List of variables to consider for localization
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
bool isOptimizable(AstVarScope* nodep) {
|
||||
return !nodep->user1() || // Not marked as not optimizable, or ...
|
||||
(nodep->varp()->varType() == VVarType::BLOCKTEMP
|
||||
@ -221,5 +221,5 @@ public:
|
||||
void V3Localize::localizeAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ LocalizeVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("localize", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("localize", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -87,6 +87,8 @@
|
||||
#include <queue>
|
||||
#include <set>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
namespace {
|
||||
|
||||
//######################################################################
|
||||
@ -455,7 +457,6 @@ private:
|
||||
StmtPropertiesAllocator* m_stmtPropertiesp = nullptr;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
// Function that processes a whole sub-tree
|
||||
void process(AstNode* nodep) {
|
||||
@ -883,5 +884,5 @@ public:
|
||||
void V3MergeCond::mergeAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ MergeCondVisitor{nodep}; }
|
||||
V3Global::dumpCheckGlobalTree("merge_cond", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("merge_cond", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include "V3Global.h"
|
||||
#include "V3LanguageWords.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Name state, as a visitor of each AstNode
|
||||
|
||||
@ -44,8 +46,6 @@ private:
|
||||
const AstNodeModule* m_modp = nullptr;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void rename(AstNode* nodep, bool addPvt) {
|
||||
if (!nodep->user1()) { // Not already done
|
||||
if (addPvt) {
|
||||
@ -144,5 +144,5 @@ public:
|
||||
void V3Name::nameAll(AstNetlist* nodep) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ NameVisitor{nodep}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("name", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("name", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <cmath>
|
||||
#include <functional>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
constexpr int MAX_SPRINTF_DOUBLE_SIZE
|
||||
= 1100; // Maximum characters with a sprintf %e/%f/%g (really 1079)
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include "config_rev.h"
|
||||
|
||||
@ -51,6 +52,8 @@
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// V3 Internal state
|
||||
|
||||
@ -1069,7 +1072,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||
DECL_OPTION("-debug", CbCall, [this]() { setDebugMode(3); });
|
||||
DECL_OPTION("-debugi", CbVal, [this](int v) { setDebugMode(v); });
|
||||
DECL_OPTION("-debugi-", CbPartialMatchVal, [this](const char* optp, const char* valp) {
|
||||
setDebugSrcLevel(optp, std::atoi(valp));
|
||||
m_debugLevel[optp] = std::atoi(valp);
|
||||
});
|
||||
DECL_OPTION("-debug-abort", CbCall,
|
||||
V3Error::vlAbort)
|
||||
@ -1090,15 +1093,11 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||
DECL_OPTION("-debug-sigsegv", CbCall, throwSigsegv).undocumented(); // See also --debug-abort
|
||||
DECL_OPTION("-decoration", OnOff, &m_decoration);
|
||||
DECL_OPTION("-dpi-hdr-only", OnOff, &m_dpiHdrOnly);
|
||||
DECL_OPTION("-dump-defines", OnOff, &m_dumpDefines);
|
||||
DECL_OPTION("-dump-tree", CbOnOff,
|
||||
[this](bool flag) { m_dumpTree = flag ? 3 : 0; }); // Also see --dump-treei
|
||||
DECL_OPTION("-dump-tree-addrids", OnOff, &m_dumpTreeAddrids);
|
||||
DECL_OPTION("-dump-treei", Set, &m_dumpTree);
|
||||
DECL_OPTION("-dump-treei-", CbPartialMatchVal, [this](const char* optp, const char* valp) {
|
||||
setDumpTreeLevel(optp, std::atoi(valp));
|
||||
DECL_OPTION("-dump-", CbPartialMatch, [this](const char* optp) { m_dumpLevel[optp] = 3; });
|
||||
DECL_OPTION("-no-dump-", CbPartialMatch, [this](const char* optp) { m_dumpLevel[optp] = 0; });
|
||||
DECL_OPTION("-dumpi-", CbPartialMatchVal, [this](const char* optp, const char* valp) {
|
||||
m_dumpLevel[optp] = std::atoi(valp);
|
||||
});
|
||||
|
||||
DECL_OPTION("-E", Set, &m_preprocOnly);
|
||||
DECL_OPTION("-error-limit", CbVal, static_cast<void (*)(int)>(&V3Error::errorLimit));
|
||||
DECL_OPTION("-exe", OnOff, &m_exe);
|
||||
@ -1807,52 +1806,42 @@ V3Options::~V3Options() { VL_DO_CLEAR(delete m_impp, m_impp = nullptr); }
|
||||
|
||||
void V3Options::setDebugMode(int level) {
|
||||
V3Error::debugDefault(level);
|
||||
if (!m_dumpTree) m_dumpTree = 3; // Don't override if already set.
|
||||
if (!m_dumpLevel.count("tree")) m_dumpLevel["tree"] = 3; // Don't override if already set.
|
||||
m_stats = true;
|
||||
m_debugCheck = true;
|
||||
cout << "Starting " << version() << endl;
|
||||
}
|
||||
|
||||
void V3Options::setDebugSrcLevel(const string& srcfile, int level) {
|
||||
const auto iter = m_debugSrcs.find(srcfile);
|
||||
if (iter != m_debugSrcs.end()) {
|
||||
iter->second = level;
|
||||
} else {
|
||||
m_debugSrcs.emplace(srcfile, level);
|
||||
}
|
||||
unsigned V3Options::debugLevel(const string& tag) const {
|
||||
const auto iter = m_debugLevel.find(tag);
|
||||
return iter != m_debugLevel.end() ? iter->second : V3Error::debugDefault();
|
||||
}
|
||||
|
||||
int V3Options::debugSrcLevel(const string& srcfile_path, int default_level) {
|
||||
unsigned V3Options::debugSrcLevel(const string& srcfile_path) const {
|
||||
// For simplicity, calling functions can just use __FILE__ for srcfile.
|
||||
// That means though we need to cleanup the filename from ../Foo.cpp -> Foo
|
||||
const string srcfile = V3Os::filenameNonDirExt(srcfile_path);
|
||||
const auto iter = m_debugSrcs.find(srcfile);
|
||||
if (iter != m_debugSrcs.end()) {
|
||||
return iter->second;
|
||||
} else {
|
||||
return default_level;
|
||||
}
|
||||
// That means we need to strip the filenames: ../Foo.cpp -> Foo
|
||||
return debugLevel(V3Os::filenameNonDirExt(srcfile_path));
|
||||
}
|
||||
|
||||
void V3Options::setDumpTreeLevel(const string& srcfile, int level) {
|
||||
const auto iter = m_dumpTrees.find(srcfile);
|
||||
if (iter != m_dumpTrees.end()) {
|
||||
iter->second = level;
|
||||
} else {
|
||||
m_dumpTrees.emplace(srcfile, level);
|
||||
}
|
||||
unsigned V3Options::dumpLevel(const string& tag) const {
|
||||
const auto iter = m_dumpLevel.find(tag);
|
||||
return iter != m_dumpLevel.end() ? iter->second : 0;
|
||||
}
|
||||
|
||||
int V3Options::dumpTreeLevel(const string& srcfile_path) {
|
||||
unsigned V3Options::dumpSrcLevel(const string& srcfile_path) const {
|
||||
// For simplicity, calling functions can just use __FILE__ for srcfile.
|
||||
// That means though we need to cleanup the filename from ../Foo.cpp -> Foo
|
||||
const string srcfile = V3Os::filenameNonDirExt(srcfile_path);
|
||||
const auto iter = m_dumpTrees.find(srcfile);
|
||||
if (iter != m_dumpTrees.end()) {
|
||||
return iter->second;
|
||||
} else {
|
||||
return m_dumpTree;
|
||||
// That means we need to strip the filenames: ../Foo.cpp -> Foo
|
||||
return dumpLevel(V3Os::filenameNonDirExt(srcfile_path));
|
||||
}
|
||||
|
||||
bool V3Options::dumpTreeAddrids() const {
|
||||
static int level = -1;
|
||||
if (VL_UNLIKELY(level < 0)) {
|
||||
const unsigned value = dumpLevel("tree-addrids");
|
||||
if (!available()) return value > 0;
|
||||
level = static_cast<unsigned>(value);
|
||||
}
|
||||
return level > 0;
|
||||
}
|
||||
|
||||
void V3Options::optimize(int level) {
|
||||
|
@ -188,7 +188,7 @@ class V3Options final {
|
||||
public:
|
||||
private:
|
||||
// TYPES
|
||||
using DebugSrcMap = std::map<const std::string, int>;
|
||||
using DebugLevelMap = std::map<const std::string, unsigned>;
|
||||
|
||||
// MEMBERS (general options)
|
||||
V3OptionsImp* m_impp; // Slow hidden options
|
||||
@ -206,8 +206,8 @@ private:
|
||||
V3StringSet m_noClockers; // argument: Verilog -noclk signals
|
||||
V3StringList m_vFiles; // argument: Verilog files to read
|
||||
V3StringList m_forceIncs; // argument: -FI
|
||||
DebugSrcMap m_debugSrcs; // argument: --debugi-<srcfile>=<level>
|
||||
DebugSrcMap m_dumpTrees; // argument: --dump-treei-<srcfile>=<level>
|
||||
DebugLevelMap m_debugLevel; // argument: --debugi-<srcfile/tag> <level>
|
||||
DebugLevelMap m_dumpLevel; // argument: --dumpi-<srcfile/tag> <level>
|
||||
std::map<const string, string> m_parameters; // Parameters
|
||||
std::map<const string, V3HierarchicalBlockOption> m_hierBlocks; // main switch: --hierarchical-block
|
||||
|
||||
@ -238,8 +238,6 @@ private:
|
||||
bool m_debugSelfTest = false; // main switch: --debug-self-test
|
||||
bool m_decoration = true; // main switch: --decoration
|
||||
bool m_dpiHdrOnly = false; // main switch: --dpi-hdr-only
|
||||
bool m_dumpDefines = false; // main switch: --dump-defines
|
||||
bool m_dumpTreeAddrids = false; // main switch: --dump-tree-addrids
|
||||
bool m_exe = false; // main switch: --exe
|
||||
bool m_flatten = false; // main switch: --flatten
|
||||
bool m_hierarchical = false; // main switch: --hierarchical
|
||||
@ -286,7 +284,6 @@ private:
|
||||
int m_buildJobs = -1; // main switch: --build-jobs, -j
|
||||
int m_convergeLimit = 100; // main switch: --converge-limit
|
||||
int m_coverageMaxWidth = 256; // main switch: --coverage-max-width
|
||||
int m_dumpTree = 0; // main switch: --dump-tree
|
||||
int m_expandLimit = 64; // main switch: --expand-limit
|
||||
int m_gateStmts = 100; // main switch: --gate-stmts
|
||||
int m_hierChild = 0; // main switch: --hierarchical-child
|
||||
@ -395,10 +392,10 @@ public:
|
||||
V3Options();
|
||||
~V3Options();
|
||||
void setDebugMode(int level);
|
||||
void setDebugSrcLevel(const string& srcfile, int level);
|
||||
int debugSrcLevel(const string& srcfile_path, int default_level = V3Error::debugDefault());
|
||||
void setDumpTreeLevel(const string& srcfile, int level);
|
||||
int dumpTreeLevel(const string& srcfile_path);
|
||||
unsigned debugLevel(const string& tag) const;
|
||||
unsigned debugSrcLevel(const string& srcfile_path) const;
|
||||
unsigned dumpLevel(const string& tag) const;
|
||||
unsigned dumpSrcLevel(const string& srcfile_path) const;
|
||||
|
||||
// METHODS
|
||||
void addCppFile(const string& filename);
|
||||
@ -452,7 +449,7 @@ public:
|
||||
bool debugSelfTest() const { return m_debugSelfTest; }
|
||||
bool decoration() const { return m_decoration; }
|
||||
bool dpiHdrOnly() const { return m_dpiHdrOnly; }
|
||||
bool dumpDefines() const { return m_dumpDefines; }
|
||||
bool dumpDefines() const { return m_dumpLevel.count("defines") && m_dumpLevel.at("defines"); }
|
||||
bool exe() const { return m_exe; }
|
||||
bool flatten() const { return m_flatten; }
|
||||
bool gmake() const { return m_gmake; }
|
||||
@ -493,8 +490,7 @@ public:
|
||||
int buildJobs() const { return m_buildJobs; }
|
||||
int convergeLimit() const { return m_convergeLimit; }
|
||||
int coverageMaxWidth() const { return m_coverageMaxWidth; }
|
||||
int dumpTree() const { return m_dumpTree; }
|
||||
bool dumpTreeAddrids() const { return m_dumpTreeAddrids; }
|
||||
bool dumpTreeAddrids() const;
|
||||
int expandLimit() const { return m_expandLimit; }
|
||||
int gateStmts() const { return m_gateStmts; }
|
||||
int ifDepth() const { return m_ifDepth; }
|
||||
|
@ -103,6 +103,8 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Order information stored under each AstNode::user1p()...
|
||||
|
||||
@ -183,7 +185,6 @@ class OrderBuildVisitor final : public VNVisitor {
|
||||
std::function<bool(const AstVarScope*)> m_readTriggersCombLogic;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void iterateLogic(AstNode* nodep) {
|
||||
UASSERT_OBJ(!m_logicVxp, nodep, "Should not nest");
|
||||
@ -454,11 +455,7 @@ class OrderBuildVisitor final : public VNVisitor {
|
||||
OrderBuildVisitor(AstNetlist* /*nodep*/, const std::vector<V3Sched::LogicByScope*>& coll,
|
||||
const std::unordered_map<const AstSenItem*, const AstSenTree*>& trigToSen)
|
||||
: m_trigToSen{trigToSen} {
|
||||
|
||||
// Enable debugging (3 is default if global debug; we want acyc debugging)
|
||||
if (debug()) m_graphp->debug(5);
|
||||
|
||||
// Build the rest of the graph
|
||||
// Build the graph
|
||||
for (const V3Sched::LogicByScope* const lbsp : coll) {
|
||||
for (const auto& pair : *lbsp) {
|
||||
m_scopep = pair.first;
|
||||
@ -845,7 +842,6 @@ class OrderProcess final : VNDeleter {
|
||||
std::map<std::pair<AstNodeModule*, std::string>, unsigned> m_funcNums; // Function ordinals
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void process(bool multiThreaded);
|
||||
void processDomains();
|
||||
@ -1432,7 +1428,7 @@ void OrderProcess::processMTasks() {
|
||||
|
||||
void OrderProcess::process(bool multiThreaded) {
|
||||
// Dump data
|
||||
m_graph.dumpDotFilePrefixed(m_tag + "_orderg_pre");
|
||||
if (dumpGraph()) m_graph.dumpDotFilePrefixed(m_tag + "_orderg_pre");
|
||||
|
||||
// Break cycles. Each strongly connected subgraph (including cutable
|
||||
// edges) will have its own color, and corresponds to a loop in the
|
||||
@ -1440,29 +1436,27 @@ void OrderProcess::process(bool multiThreaded) {
|
||||
// edges are actually still there, just with weight 0).
|
||||
UINFO(2, " Acyclic & Order...\n");
|
||||
m_graph.acyclic(&V3GraphEdge::followAlwaysTrue);
|
||||
m_graph.dumpDotFilePrefixed(m_tag + "_orderg_acyc");
|
||||
if (dumpGraph()) m_graph.dumpDotFilePrefixed(m_tag + "_orderg_acyc");
|
||||
|
||||
// Assign ranks so we know what to follow
|
||||
// Then, sort vertices and edges by that ordering
|
||||
m_graph.order();
|
||||
m_graph.dumpDotFilePrefixed(m_tag + "_orderg_order");
|
||||
if (dumpGraph()) m_graph.dumpDotFilePrefixed(m_tag + "_orderg_order");
|
||||
|
||||
// Assign logic vertices to new domains
|
||||
UINFO(2, " Domains...\n");
|
||||
processDomains();
|
||||
m_graph.dumpDotFilePrefixed(m_tag + "_orderg_domain");
|
||||
if (dumpGraph()) m_graph.dumpDotFilePrefixed(m_tag + "_orderg_domain");
|
||||
|
||||
if (debug() && v3Global.opt.dumpTree()) processEdgeReport();
|
||||
if (dump()) processEdgeReport();
|
||||
|
||||
if (!multiThreaded) {
|
||||
UINFO(2, " Construct Move Graph...\n");
|
||||
processMoveBuildGraph();
|
||||
if (debug() >= 4) {
|
||||
// Different prefix (ordermv) as it's not the same graph
|
||||
m_pomGraph.dumpDotFilePrefixed(m_tag + "_ordermv_start");
|
||||
}
|
||||
// Different prefix (ordermv) as it's not the same graph
|
||||
if (dumpGraph() >= 4) m_pomGraph.dumpDotFilePrefixed(m_tag + "_ordermv_start");
|
||||
m_pomGraph.removeRedundantEdges(&V3GraphEdge::followAlwaysTrue);
|
||||
if (debug() >= 4) m_pomGraph.dumpDotFilePrefixed(m_tag + "_ordermv_simpl");
|
||||
if (dumpGraph() >= 4) m_pomGraph.dumpDotFilePrefixed(m_tag + "_ordermv_simpl");
|
||||
|
||||
UINFO(2, " Move...\n");
|
||||
processMove();
|
||||
@ -1472,7 +1466,7 @@ void OrderProcess::process(bool multiThreaded) {
|
||||
}
|
||||
|
||||
// Dump data
|
||||
m_graph.dumpDotFilePrefixed(m_tag + "_orderg_done");
|
||||
if (dumpGraph()) m_graph.dumpDotFilePrefixed(m_tag + "_orderg_done");
|
||||
}
|
||||
|
||||
//######################################################################
|
||||
|
@ -29,8 +29,13 @@
|
||||
#include "verilatedos.h"
|
||||
|
||||
// Limited V3 headers here - this is a base class for Vlc etc
|
||||
#include "V3String.h"
|
||||
#include "V3Os.h"
|
||||
#include "V3String.h"
|
||||
|
||||
#ifndef V3ERROR_NO_GLOBAL_
|
||||
#include "V3Global.h"
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
#endif
|
||||
|
||||
#include <cerrno>
|
||||
#include <climits> // PATH_MAX (especially on FreeBSD)
|
||||
@ -38,6 +43,7 @@
|
||||
#include <dirent.h>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
@ -65,6 +65,8 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// Hierarchical block and parameter db (modules without parameter is also handled)
|
||||
|
||||
@ -88,7 +90,6 @@ class ParameterizedHierBlocks final {
|
||||
m_modParams; // Parameter variables of hierarchical blocks
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
public:
|
||||
ParameterizedHierBlocks(const V3HierBlockOptSet& hierOpts, AstNetlist* nodep) {
|
||||
@ -270,7 +271,6 @@ class ParamProcessor final {
|
||||
std::map<AstNodeModule*, DefaultValueMap> m_defaultParameterValues;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
static void makeSmallNames(AstNodeModule* modp) {
|
||||
std::vector<int> usedLetter;
|
||||
@ -888,7 +888,6 @@ class ParamVisitor final : public VNVisitor {
|
||||
std::unordered_map<AstNodeModule*, std::unordered_set<AstNodeModule*>> m_parentps;
|
||||
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void visitCells(AstNodeModule* nodep) {
|
||||
UASSERT_OBJ(!m_iterateModule, nodep, "Should not nest");
|
||||
@ -1280,5 +1279,5 @@ public:
|
||||
void V3Param::param(AstNetlist* rootp) {
|
||||
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||
{ ParamVisitor{rootp}; } // Destruct before checking
|
||||
V3Global::dumpCheckGlobalTree("param", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
||||
V3Global::dumpCheckGlobalTree("param", 0, dumpTree() >= 6);
|
||||
}
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "V3Ast.h" // This must be before V3ParseBison.cpp, as we don't want #defines to conflict
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//======================================================================
|
||||
// The guts come from bison output
|
||||
|
||||
|
@ -38,6 +38,8 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//======================================================================
|
||||
// Globals
|
||||
|
||||
@ -58,7 +60,7 @@ V3ParseImp::~V3ParseImp() {
|
||||
|
||||
if (debug() >= 9) {
|
||||
UINFO(0, "~V3ParseImp\n");
|
||||
symp()->dump(cout, "-vpi: ");
|
||||
symp()->dumpSelf(cout, "-vpi: ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -497,7 +499,7 @@ void V3ParseImp::tokenPipelineSym() {
|
||||
const VSymEnt* foundp;
|
||||
if (const VSymEnt* const look_underp = V3ParseImp::parsep()->symp()->nextId()) {
|
||||
UINFO(7, " tokenPipelineSym: next id lookup forced under " << look_underp << endl);
|
||||
// if (debug() >= 7) V3ParseImp::parsep()->symp()->dump(cout, " -symtree: ");
|
||||
// if (debug() >= 7) V3ParseImp::parsep()->symp()->dumpSelf(cout, " -symtree: ");
|
||||
foundp = look_underp->findIdFallback(*(yylval.strp));
|
||||
// "consume" it. Must set again if want another token under temp scope
|
||||
V3ParseImp::parsep()->symp()->nextId(nullptr);
|
||||
@ -505,7 +507,7 @@ void V3ParseImp::tokenPipelineSym() {
|
||||
UINFO(7, " tokenPipelineSym: find upward "
|
||||
<< V3ParseImp::parsep()->symp()->symCurrentp() << " for '"
|
||||
<< *(yylval.strp) << "'" << endl);
|
||||
// if (debug()>=9) V3ParseImp::parsep()->symp()->symCurrentp()->dump(cout,
|
||||
// if (debug()>=9) V3ParseImp::parsep()->symp()->symCurrentp()->dumpSelf(cout,
|
||||
// " -findtree: ", true);
|
||||
foundp = V3ParseImp::parsep()->symp()->symCurrentp()->findIdFallback(*(yylval.strp));
|
||||
}
|
||||
|
@ -161,25 +161,10 @@ class V3ParseImp final {
|
||||
VTimescale m_timeLastUnit; // Last `timescale's unit
|
||||
|
||||
public:
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
// Note these are an exception to using the filename as the debug type
|
||||
static int debugBison() {
|
||||
static int level = -1;
|
||||
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel("bison");
|
||||
return level;
|
||||
}
|
||||
static int debugFlex() {
|
||||
static int level = -1;
|
||||
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel("flex");
|
||||
return level;
|
||||
}
|
||||
static int debug() {
|
||||
static int level = -1;
|
||||
if (VL_UNLIKELY(level < 0)) {
|
||||
level = std::max(std::max(debugBison(), debugFlex()),
|
||||
v3Global.opt.debugSrcLevel("V3ParseImp"));
|
||||
}
|
||||
return level;
|
||||
}
|
||||
VL_DEFINE_DEBUG(Bison); // Define 'unsigned debugBison()'
|
||||
VL_DEFINE_DEBUG(Flex); // Define 'unsigned debugFlex()'
|
||||
|
||||
// Functions called by lex rules:
|
||||
int yylexThis();
|
||||
|
@ -55,6 +55,9 @@ public:
|
||||
|
||||
private:
|
||||
// METHODS
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
static VSymEnt* getTable(AstNode* nodep) {
|
||||
UASSERT_OBJ(nodep->user4p(), nodep, "Current symtable not found");
|
||||
return nodep->user4u().toSymEnt();
|
||||
@ -115,7 +118,7 @@ public:
|
||||
if (VL_UNCOVERABLE(symCurrentp()->nodep() != nodep)) { // LCOV_EXCL_START
|
||||
if (debug()) {
|
||||
showUpward();
|
||||
dump(cout, "-mism: ");
|
||||
dumpSelf(cout, "-mism: ");
|
||||
}
|
||||
nodep->v3fatalSrc("Symbols suggest ending " << symCurrentp()->nodep()->prettyTypeName()
|
||||
<< " but parser thinks ending "
|
||||
@ -133,7 +136,7 @@ public:
|
||||
}
|
||||
UINFO(1, "ParseSym Current: " << symCurrentp()->nodep() << endl);
|
||||
} // LCOV_EXCL_STOP
|
||||
void dump(std::ostream& os, const string& indent = "") { m_syms.dump(os, indent); }
|
||||
void dumpSelf(std::ostream& os, const string& indent = "") { m_syms.dumpSelf(os, indent); }
|
||||
AstNode* findEntUpward(const string& name) const {
|
||||
// Lookup the given string as an identifier, return type of the id, scanning upward
|
||||
VSymEnt* const foundp = symCurrentp()->findIdFallback(name);
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
class LogicMTask;
|
||||
class MTaskEdge;
|
||||
class MergeCandidate;
|
||||
@ -390,7 +392,6 @@ public:
|
||||
static void dumpCpFilePrefixed(const V3Graph* graphp, const string& nameComment);
|
||||
|
||||
private:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(LogicMTask);
|
||||
};
|
||||
|
||||
@ -809,7 +810,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(PartParallelismEst);
|
||||
};
|
||||
|
||||
@ -1053,7 +1053,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
VL_DEBUG_FUNC;
|
||||
VL_UNCOPYABLE(PartPropagateCp);
|
||||
};
|
||||
|
||||
@ -1823,7 +1822,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(PartContraction);
|
||||
};
|
||||
|
||||
@ -1837,8 +1835,6 @@ private:
|
||||
bool m_hasDpiHazard = false; // Found a DPI import call.
|
||||
bool m_tracingCall = false; // Iterating into a CCall to a CFunc
|
||||
// METHODS
|
||||
VL_DEBUG_FUNC;
|
||||
|
||||
void visit(AstCFunc* nodep) override {
|
||||
if (!m_tracingCall) return;
|
||||
m_tracingCall = false;
|
||||
@ -2150,7 +2146,6 @@ public:
|
||||
|
||||
private:
|
||||
VL_UNCOPYABLE(PartFixDataHazards);
|
||||
VL_DEBUG_FUNC;
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
@ -2472,7 +2467,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (debug() >= 4) schedule.dumpDotFilePrefixedAlways(mtaskGraph, "schedule");
|
||||
if (dumpGraph() >= 4) schedule.dumpDotFilePrefixedAlways(mtaskGraph, "schedule");
|
||||
|
||||
return schedule;
|
||||
}
|
||||
@ -2530,7 +2525,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(PartPackMTasks);
|
||||
};
|
||||
|
||||
@ -2538,7 +2532,7 @@ private:
|
||||
// V3Partition implementation
|
||||
|
||||
void V3Partition::debugMTaskGraphStats(const V3Graph* graphp, const string& stage) {
|
||||
if (!debug()) return;
|
||||
if (!debug() && !dump() && !dumpGraph()) return;
|
||||
|
||||
UINFO(4, "\n");
|
||||
UINFO(4, " Stats for " << stage << endl);
|
||||
@ -2575,7 +2569,7 @@ void V3Partition::debugMTaskGraphStats(const V3Graph* graphp, const string& stag
|
||||
if (mtaskCount < 1000) {
|
||||
string filePrefix("ordermv_");
|
||||
filePrefix += stage;
|
||||
if (debug() >= 4) graphp->dumpDotFilePrefixedAlways(filePrefix);
|
||||
if (dumpGraph() >= 4) graphp->dumpDotFilePrefixedAlways(filePrefix);
|
||||
}
|
||||
|
||||
// Look only at the cost of each mtask, neglect communication cost.
|
||||
@ -2750,9 +2744,7 @@ void V3Partition::go(V3Graph* mtasksp) {
|
||||
// For debug: print out the longest critical path. This allows us to
|
||||
// verify that the costs look reasonable, that we aren't combining
|
||||
// nodes that should probably be split, etc.
|
||||
if (v3Global.opt.dumpTreeLevel(__FILE__) >= 3) {
|
||||
LogicMTask::dumpCpFilePrefixed(mtasksp, "cp");
|
||||
}
|
||||
if (dump() >= 3) LogicMTask::dumpCpFilePrefixed(mtasksp, "cp");
|
||||
|
||||
// Merge nodes that could present data hazards; see comment within.
|
||||
{
|
||||
|
@ -70,7 +70,6 @@ public:
|
||||
private:
|
||||
uint32_t setupMTaskDeps(V3Graph* mtasksp);
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
VL_UNCOPYABLE(V3Partition);
|
||||
};
|
||||
|
||||
|
@ -225,9 +225,8 @@ public: // Used only by V3PreLex.cpp and V3PreProc.cpp
|
||||
// Called by VPreStream
|
||||
void streamDepthAdd(int delta) { m_streamDepth += delta; }
|
||||
int streamDepth() const { return m_streamDepth; }
|
||||
/// Utility
|
||||
static int debug();
|
||||
static void debug(int level);
|
||||
// Utility
|
||||
static void setYYDebug(bool on);
|
||||
static string cleanDbgStrg(const string& in);
|
||||
|
||||
private:
|
||||
|
@ -462,11 +462,8 @@ void V3PreLex::pushStateIncFilename() {
|
||||
yymore();
|
||||
}
|
||||
|
||||
void V3PreLex::debug(int level) {
|
||||
yy_flex_debug = level; // Use --debugi-V3PreShell, if level<5 this level is 0
|
||||
}
|
||||
int V3PreLex::debug() {
|
||||
return yy_flex_debug; }
|
||||
void V3PreLex::setYYDebug(bool on) {
|
||||
yy_flex_debug = static_cast<int>(on); }
|
||||
|
||||
int V3PreLex::lex() {
|
||||
V3PreLex::s_currentLexp = this; // Tell parser where to get/put data
|
||||
|
@ -33,6 +33,8 @@
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//======================================================================
|
||||
// Build in LEX script
|
||||
|
||||
@ -112,8 +114,6 @@ public:
|
||||
using DefinesMap = std::map<const std::string, VDefine>;
|
||||
using StrList = VInFilter::StrList;
|
||||
|
||||
// debug() -> see V3PreShellImp::debug; use --debugi-V3PreShell
|
||||
|
||||
// Defines list
|
||||
DefinesMap m_defines; ///< Map of defines
|
||||
|
||||
@ -259,10 +259,7 @@ public:
|
||||
string removeDefines(const string& text) override; // Remove defines in a text string
|
||||
|
||||
// CONSTRUCTORS
|
||||
V3PreProcImp() {
|
||||
m_debug = 0;
|
||||
m_states.push(ps_TOP);
|
||||
}
|
||||
V3PreProcImp() { m_states.push(ps_TOP); }
|
||||
void configure(FileLine* filelinep) {
|
||||
// configure() separate from constructor to avoid calling abstract functions
|
||||
m_preprocp = this; // Silly, but to make code more similar to Verilog-Perl
|
||||
@ -273,7 +270,6 @@ public:
|
||||
m_lexp->m_keepComments = keepComments();
|
||||
m_lexp->m_keepWhitespace = keepWhitespace();
|
||||
m_lexp->m_pedantic = pedantic();
|
||||
debug(debug()); // Set lexer debug via V3PreProc::debug() method
|
||||
}
|
||||
~V3PreProcImp() override {
|
||||
if (m_lexp) VL_DO_CLEAR(delete m_lexp, m_lexp = nullptr);
|
||||
@ -490,12 +486,6 @@ void V3PreProcImp::comment(const string& text) {
|
||||
//*************************************************************************
|
||||
// VPreProc Methods.
|
||||
|
||||
void V3PreProc::debug(int level) {
|
||||
m_debug = level;
|
||||
V3PreProcImp* idatap = static_cast<V3PreProcImp*>(this);
|
||||
if (idatap->m_lexp) idatap->m_lexp->debug(debug() >= 5 ? debug() : 0);
|
||||
}
|
||||
|
||||
FileLine* V3PreProc::fileline() {
|
||||
const V3PreProcImp* idatap = static_cast<V3PreProcImp*>(this);
|
||||
return idatap->m_lexp->m_tokFilelinep;
|
||||
@ -777,6 +767,7 @@ string V3PreProcImp::defineSubst(VDefineRef* refp) {
|
||||
void V3PreProcImp::openFile(FileLine*, VInFilter* filterp, const string& filename) {
|
||||
// Open a new file, possibly overriding the current one which is active.
|
||||
if (m_incError) return;
|
||||
m_lexp->setYYDebug(debug() >= 5);
|
||||
V3File::addSrcDepend(filename);
|
||||
|
||||
// Read a list<string> with the whole file.
|
||||
|
@ -39,8 +39,7 @@ class V3PreProc VL_NOT_FINAL {
|
||||
// After creating, call open(), then getline() in a loop. The class will to the rest...
|
||||
|
||||
protected:
|
||||
// STATE
|
||||
int m_debug; // Debugging
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
public:
|
||||
// CONSTANTS
|
||||
@ -61,9 +60,6 @@ public:
|
||||
virtual bool isEof() const = 0; // Return true on EOF.
|
||||
virtual void insertUnreadback(const string& text) = 0;
|
||||
|
||||
int debug() const { return m_debug; }
|
||||
void debug(int level);
|
||||
|
||||
FileLine* fileline(); ///< File/Line number for last getline call
|
||||
|
||||
// CONTROL METHODS
|
||||
@ -99,7 +95,7 @@ public:
|
||||
|
||||
protected:
|
||||
// CONSTRUCTORS
|
||||
V3PreProc() { m_debug = 0; }
|
||||
V3PreProc() {}
|
||||
void configure(FileLine* fl);
|
||||
|
||||
public:
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
|
||||
class V3PreShellImp final {
|
||||
@ -41,21 +43,11 @@ protected:
|
||||
//---------------------------------------
|
||||
// METHODS
|
||||
|
||||
static int debug(bool reset = false) {
|
||||
static int level = -1;
|
||||
if (VL_UNLIKELY(level < 0) || reset) {
|
||||
level = v3Global.opt.debugSrcLevel(__FILE__);
|
||||
if (s_preprocp) s_preprocp->debug(debug());
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
void boot() {
|
||||
// Create the implementation pointer
|
||||
if (!s_preprocp) {
|
||||
FileLine* const cmdfl = new FileLine(FileLine::commandLineFilename());
|
||||
s_preprocp = V3PreProc::createPreProc(cmdfl);
|
||||
s_preprocp->debug(debug());
|
||||
// Default defines
|
||||
FileLine* const prefl = new FileLine(FileLine::builtInFilename());
|
||||
s_preprocp->defineCmdLine(prefl, "VERILATOR", "1"); // LEAK_OK
|
||||
@ -88,8 +80,6 @@ protected:
|
||||
|
||||
bool preproc(FileLine* fl, const string& modname, VInFilter* filterp, V3ParseImp* parsep,
|
||||
const string& errmsg) { // "" for no error
|
||||
debug(true); // Recheck if debug on - first check was before command line passed
|
||||
|
||||
// Preprocess the given module, putting output in vppFilename
|
||||
UINFONL(1, " Preprocessing " << modname << endl);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user