From 6a5a2a56d755fdcbad6b77dc2265b01025423a3e Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 16 Nov 2018 20:48:57 -0500 Subject: [PATCH] Internals: Favor AstNetlist for global thread errors, and allow 0 line number error suppression. --- src/V3AstNodes.h | 14 +++++++------- src/V3FileLine.cpp | 13 +++++-------- src/V3Order.cpp | 2 +- src/V3Partition.cpp | 7 ++----- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 222f2a586..90b30c68d 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -5852,15 +5852,15 @@ class AstNetlist : public AstNode { // Parents: none // Children: MODULEs & CFILEs private: - AstTypeTable* m_typeTablep; // Reference to top type table, for faster lookup - AstPackage* m_dollarUnitPkgp; - AstCFunc* m_evalp; // The '_eval' function + AstTypeTable* m_typeTablep; // Reference to top type table, for faster lookup + AstPackage* m_dollarUnitPkgp; // $unit + AstCFunc* m_evalp; // The '_eval' function AstExecGraph* m_execGraphp; // Execution MTask graph for threads>1 mode public: AstNetlist() - : AstNode(new FileLine("AstRoot",0)) - , m_typeTablep(NULL) - , m_dollarUnitPkgp(NULL) + : AstNode(new FileLine("AstRoot", 0)) + , m_typeTablep(NULL) + , m_dollarUnitPkgp(NULL) , m_evalp(NULL) , m_execGraphp(NULL) { } ASTNODE_NODE_FUNCS(Netlist) @@ -5876,7 +5876,7 @@ public: void addModulep(AstNodeModule* modulep) { addOp1p(modulep); } AstCFile* filesp() const { return VN_CAST(op2p(), CFile);} // op2 = List of files void addFilesp(AstCFile* filep) { addOp2p(filep); } - AstNode* miscsp() const { return op3p();} // op3 = List of dtypes etc + AstNode* miscsp() const { return op3p(); } // op3 = List of dtypes etc void addMiscsp(AstNode* nodep) { addOp3p(nodep); } AstTypeTable* typeTablep() { return m_typeTablep; } void addTypeTablep(AstTypeTable* nodep) { m_typeTablep = nodep; addMiscsp(nodep); } diff --git a/src/V3FileLine.cpp b/src/V3FileLine.cpp index 753372e85..d83acb25b 100644 --- a/src/V3FileLine.cpp +++ b/src/V3FileLine.cpp @@ -235,14 +235,11 @@ void FileLine::modifyStateInherit(const FileLine* fromp) { } void FileLine::v3errorEnd(std::ostringstream& str) { - if (m_lineno) { - std::ostringstream nsstr; - nsstr<fileline(); AstExecGraph* execGraphp = new AstExecGraph(rootFlp); m_scopetopp->addActivep(execGraphp); v3Global.rootp()->execGraphp(execGraphp); diff --git a/src/V3Partition.cpp b/src/V3Partition.cpp index a6d309d4e..3d1a8a089 100644 --- a/src/V3Partition.cpp +++ b/src/V3Partition.cpp @@ -1248,11 +1248,8 @@ public: if (mtaskCount > maxMTasks) { uint32_t oldLimit = m_scoreLimit; m_scoreLimit = (m_scoreLimit * 120) / 100; - - // Line must be >0 otherwise FileLine doesn't check - // if the warning is suppressed with -Wno-UNOPTTHREADS - FileLine dummyFl("AstRoot", 1); - dummyFl.v3warn(UNOPTTHREADS, "Thread scheduler is unable to provide requested parallelism; consider asking for fewer threads."); + v3Global.rootp()->fileline()->v3warn( + UNOPTTHREADS, "Thread scheduler is unable to provide requested parallelism; consider asking for fewer threads."); UINFO(1,"Critical path limit was="<