Internals: Standardize debug() function generation. No functional change intended.

This commit is contained in:
Wilson Snyder 2018-05-14 06:50:47 -04:00
parent 4abf5be9ce
commit cd4e6b35b3
65 changed files with 98 additions and 403 deletions

View File

@ -52,11 +52,7 @@
class ActiveBaseVisitor : public AstNVisitor { class ActiveBaseVisitor : public AstNVisitor {
protected: protected:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
class ActiveNamer : public ActiveBaseVisitor { class ActiveNamer : public ActiveBaseVisitor {

View File

@ -58,11 +58,7 @@ private:
SenTreeFinder m_finder; // Find global sentree's and add them SenTreeFinder m_finder; // Find global sentree's and add them
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstTopScope* nodep) { virtual void visit(AstTopScope* nodep) {

View File

@ -49,11 +49,7 @@ private:
AstNodeSenItem* m_senip; // Last sensitivity AstNodeSenItem* m_senip; // Last sensitivity
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
AstSenTree* newSenTree(AstNode* nodep) { AstSenTree* newSenTree(AstNode* nodep) {
// Create sentree based on clocked or default clock // Create sentree based on clocked or default clock

View File

@ -900,10 +900,12 @@ public:
class AstNVisitor { class AstNVisitor {
private: private:
// MEMBERS
std::vector<AstNode*> m_deleteps; // Nodes to delete when doDeletes() called std::vector<AstNode*> m_deleteps; // Nodes to delete when doDeletes() called
protected: protected:
friend class AstNode; friend class AstNode;
public: public:
// METHODS
/// At the end of the visitor (or doDeletes()), delete this pushed node /// At the end of the visitor (or doDeletes()), delete this pushed node
/// along with all children and next(s). This is often better to use /// along with all children and next(s). This is often better to use
/// than an immediate deleteTree, as any pointers into this node will /// than an immediate deleteTree, as any pointers into this node will

View File

@ -77,11 +77,7 @@ private:
int m_ifDepth; // Current if depth int m_ifDepth; // Current if depth
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstNodeModule* nodep) { virtual void visit(AstNodeModule* nodep) {

View File

@ -57,11 +57,7 @@ private:
CFuncVec m_cfuncsp; // List of all tasks CFuncVec m_cfuncsp; // List of all tasks
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void reset() { void reset() {
m_likely = false; m_likely = false;

View File

@ -59,11 +59,8 @@ class CaseLintVisitor : public AstNVisitor {
private: private:
AstNodeCase* m_caseExprp; // Under a CASE value node, if so the relevant case statement AstNodeCase* m_caseExprp; // Under a CASE value node, if so the relevant case statement
static int debug() { // METHODS
static int level = -1; VL_DEBUG_FUNC; // Declare debug()
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
virtual void visit(AstNodeCase* nodep) { virtual void visit(AstNodeCase* nodep) {
if (VN_IS(nodep, Case) && VN_CAST(nodep, Case)->casex()) { if (VN_IS(nodep, Case) && VN_CAST(nodep, Case)->casex()) {
@ -140,11 +137,7 @@ private:
AstNode* m_valueItem[1<<CASE_OVERLAP_WIDTH]; // For each possible value, the case branch we need AstNode* m_valueItem[1<<CASE_OVERLAP_WIDTH]; // For each possible value, the case branch we need
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
bool isCaseTreeFast(AstCase* nodep) { bool isCaseTreeFast(AstCase* nodep) {
int width = 0; int width = 0;

View File

@ -65,11 +65,7 @@ private:
// STATE // STATE
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void insertCast(AstNode* nodep, int needsize) { // We'll insert ABOVE passed node void insertCast(AstNode* nodep, int needsize) { // We'll insert ABOVE passed node
UINFO(4," NeedCast "<<nodep<<endl); UINFO(4," NeedCast "<<nodep<<endl);

View File

@ -51,11 +51,7 @@
class CdcBaseVisitor : public AstNVisitor { class CdcBaseVisitor : public AstNVisitor {
public: public:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################

View File

@ -231,11 +231,7 @@ private:
ChangedState* m_statep; // Shared state across visitors ChangedState* m_statep; // Shared state across visitors
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void genChangeDet(AstVarScope* vscp) { void genChangeDet(AstVarScope* vscp) {
vscp->v3warn(IMPERFECTSCH,"Imperfect scheduling of variable: "<<vscp); vscp->v3warn(IMPERFECTSCH,"Imperfect scheduling of variable: "<<vscp);

View File

@ -59,11 +59,7 @@ private:
AstNodeModule* m_modp; AstNodeModule* m_modp;
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// Width resetting // Width resetting
int cppWidth(AstNode* nodep) { int cppWidth(AstNode* nodep) {

View File

@ -51,11 +51,7 @@
class GaterBaseVisitor : public AstNVisitor { class GaterBaseVisitor : public AstNVisitor {
protected: protected:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################

View File

@ -70,11 +70,7 @@ private:
AstIf* m_lastIfp; // Last sensitivity if active to add more under AstIf* m_lastIfp; // Last sensitivity if active to add more under
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
AstVarScope* getCreateLastClk(AstVarScope* vscp) { AstVarScope* getCreateLastClk(AstVarScope* vscp) {
if (vscp->user1p()) return ((AstVarScope*)vscp->user1p()); if (vscp->user1p()) return ((AstVarScope*)vscp->user1p());

View File

@ -60,13 +60,8 @@ protected:
// STATE // STATE
// METHODS // METHODS
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
virtual ~CombBaseVisitor() {} virtual ~CombBaseVisitor() {}
VL_DEBUG_FUNC; // Declare debug()
//***** optimization levels //***** optimization levels
static bool emptyFunctionDeletion() { return true; } static bool emptyFunctionDeletion() { return true; }

View File

@ -114,11 +114,7 @@ private:
AstAttrOf* m_attrp; // Current attribute AstAttrOf* m_attrp; // Current attribute
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
bool operandConst (AstNode* nodep) { bool operandConst (AstNode* nodep) {
return VN_IS(nodep, Const); return VN_IS(nodep, Const);

View File

@ -74,11 +74,7 @@ private:
string m_beginHier; // AstBegin hier name for user coverage points string m_beginHier; // AstBegin hier name for user coverage points
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
const char* varIgnoreToggle(AstVar* nodep) { const char* varIgnoreToggle(AstVar* nodep) {
// Return true if this shouldn't be traced // Return true if this shouldn't be traced

View File

@ -54,11 +54,7 @@ private:
V3Double0 m_statToggleJoins; // Statistic tracking V3Double0 m_statToggleJoins; // Statistic tracking
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void detectDuplicates() { void detectDuplicates() {
UINFO(9,"Finding duplicates\n"); UINFO(9,"Finding duplicates\n");

View File

@ -106,11 +106,7 @@ private:
bool m_sideEffect; // Side effects discovered in assign RHS bool m_sideEffect; // Side effects discovered in assign RHS
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void checkAll(AstNode* nodep) { void checkAll(AstNode* nodep) {
if (nodep != nodep->dtypep()) { // NodeDTypes reference themselves if (nodep != nodep->dtypep()) { // NodeDTypes reference themselves

View File

@ -105,11 +105,7 @@ private:
ScopeVecMap m_scopeVecMap; // Next var number for each scope ScopeVecMap m_scopeVecMap; // Next var number for each scope
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void markVarUsage(AstVarScope* nodep, uint32_t flags) { void markVarUsage(AstVarScope* nodep, uint32_t flags) {
//UINFO(4," MVU "<<flags<<" "<<nodep<<endl); //UINFO(4," MVU "<<flags<<" "<<nodep<<endl);

View File

@ -52,11 +52,7 @@ private:
int m_maxdepth; // Maximum depth in an expression int m_maxdepth; // Maximum depth in an expression
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void createDeepTemp(AstNode* nodep) { void createDeepTemp(AstNode* nodep) {
UINFO(6," Deep "<<nodep<<endl); UINFO(6," Deep "<<nodep<<endl);

View File

@ -49,11 +49,7 @@ private:
int m_deepNum; // How many functions made int m_deepNum; // How many functions made
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
AstCFunc* createDeepFunc(AstNode* nodep) { AstCFunc* createDeepFunc(AstNode* nodep) {
AstNRelinker relinkHandle; AstNRelinker relinkHandle;

View File

@ -58,11 +58,7 @@ private:
FuncMmap m_modFuncs; // Name of public functions added FuncMmap m_modFuncs; // Name of public functions added
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
static bool modIsSingleton(AstNodeModule* modp) { static bool modIsSingleton(AstNodeModule* modp) {
// True iff there's exactly one instance of this module in the design. // True iff there's exactly one instance of this module in the design.

View File

@ -54,11 +54,7 @@ private:
public: public:
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// ACCESSORS // ACCESSORS
int splitFilenum() const { return m_splitFilenum; } int splitFilenum() const { return m_splitFilenum; }

View File

@ -40,11 +40,7 @@ class EmitMkVisitor : public EmitCBaseVisitor {
public: public:
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void putMakeClassEntry(V3OutMkFile& of, const string& name) { void putMakeClassEntry(V3OutMkFile& of, const string& name) {
of.puts("\t"+V3Os::filenameNonDirExt(name)+" \\\n"); of.puts("\t"+V3Os::filenameNonDirExt(name)+" \\\n");

View File

@ -41,11 +41,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
AstSenTree* m_sensesp; AstSenTree* m_sensesp;
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
virtual void puts(const string& str) = 0; virtual void puts(const string& str) = 0;
virtual void putbs(const string& str) = 0; virtual void putbs(const string& str) = 0;

View File

@ -46,11 +46,7 @@ class EmitXmlFileVisitor : public AstNVisitor {
uint64_t m_id; uint64_t m_id;
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// Outfile methods // Outfile methods
V3OutFile* ofp() const { return m_ofp; } V3OutFile* ofp() const { return m_ofp; }

View File

@ -295,6 +295,15 @@ inline void v3errorEndFatal(std::ostringstream& sstr) { V3Error::v3errorEnd(sstr
#define V3ERROR_NA { v3error("Internal: Unexpected Call"); v3fatalSrc("Unexpected Call"); } #define V3ERROR_NA { v3error("Internal: Unexpected Call"); v3fatalSrc("Unexpected Call"); }
/// 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() { \
static int level = -1; \
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__); \
return level; \
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template< class T> std::string cvtToStr (const T& t) { template< class T> std::string cvtToStr (const T& t) {

View File

@ -53,11 +53,7 @@ private:
AstNode* m_stmtp; // Current statement AstNode* m_stmtp; // Current statement
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
int longOrQuadWidth (AstNode* nodep) { int longOrQuadWidth (AstNode* nodep) {
// Return 32 or 64... // Return 32 or 64...

View File

@ -316,11 +316,7 @@ class V3InFilterImp {
private: private:
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
bool readContents(const string& filename, StrList& outl) { bool readContents(const string& filename, StrList& outl) {
if (m_pid) return readContentsFilter(filename,outl); if (m_pid) return readContentsFilter(filename,outl);

View File

@ -53,11 +53,7 @@ typedef std::list<AstNodeVarRef*> GateVarRefList;
class GateBaseVisitor : public AstNVisitor { class GateBaseVisitor : public AstNVisitor {
public: public:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################

View File

@ -38,11 +38,7 @@
class GenClkBaseVisitor : public AstNVisitor { class GenClkBaseVisitor : public AstNVisitor {
protected: protected:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################

View File

@ -53,13 +53,9 @@ private:
// STATE // STATE
V3Hash m_lowerHash; // Hash of the statement we're building V3Hash m_lowerHash; // Hash of the statement we're building
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug()
void nodeHashIterate(AstNode* nodep) { void nodeHashIterate(AstNode* nodep) {
if (!nodep->user4()) { if (!nodep->user4()) {
if (VN_IS(nodep->backp(), CFunc) if (VN_IS(nodep->backp(), CFunc)

View File

@ -36,11 +36,7 @@ public:
~VHashedBase() {} ~VHashedBase() {}
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//============================================================================ //============================================================================

View File

@ -84,11 +84,7 @@ private:
std::map<AstNodeModule*, LocalInstanceMap> m_instances; std::map<AstNodeModule*, LocalInstanceMap> m_instances;
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void cantInline(const char* reason, bool hard) { void cantInline(const char* reason, bool hard) {
if (hard) { if (hard) {
if (m_modp->user2() != CIL_NOTHARD) { if (m_modp->user2() != CIL_NOTHARD) {
@ -241,11 +237,8 @@ private:
// Output: // Output:
// AstCell::user4p() // AstCell* of the created clone // AstCell::user4p() // AstCell* of the created clone
static int debug() { // METHODS
static int level = -1; VL_DEBUG_FUNC; // Declare debug()
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstCell* nodep) { virtual void visit(AstCell* nodep) {
@ -282,11 +275,8 @@ private:
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp; // Current module
AstCell* m_cellp; // Cell being cloned AstCell* m_cellp; // Cell being cloned
static int debug() { // METHODS
static int level = -1; VL_DEBUG_FUNC; // Declare debug()
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstCellInline* nodep) { virtual void visit(AstCellInline* nodep) {
@ -499,11 +489,8 @@ private:
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp; // Current module
V3Double0 m_statCells; // Statistic tracking V3Double0 m_statCells; // Statistic tracking
static int debug() { // METHODS
static int level = -1; VL_DEBUG_FUNC; // Declare debug()
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstNetlist* nodep) { virtual void visit(AstNetlist* nodep) {

View File

@ -51,12 +51,8 @@ private:
// STATE // STATE
AstCell* m_cellp; // Current cell AstCell* m_cellp; // Current cell
static int debug() { // METHODS
static int level = -1; VL_DEBUG_FUNC; // Declare debug()
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
//int m_debug; int debug() { return m_debug; }
// VISITORS // VISITORS
virtual void visit(AstCell* nodep) { virtual void visit(AstCell* nodep) {
@ -153,11 +149,7 @@ private:
typedef std::map<string,AstVar*> VarNameMap; typedef std::map<string,AstVar*> VarNameMap;
VarNameMap m_modVarNameMap; // Per module, name of cloned variables VarNameMap m_modVarNameMap; // Per module, name of cloned variables
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstVar* nodep) { virtual void visit(AstVar* nodep) {
@ -215,11 +207,7 @@ private:
typedef std::map<string,AstVar*> VarNameMap; typedef std::map<string,AstVar*> VarNameMap;
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstVar* nodep) { virtual void visit(AstVar* nodep) {
@ -466,11 +454,7 @@ public:
class InstStatic { class InstStatic {
private: private:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
InstStatic() {} // Static class InstStatic() {} // Static class
static AstNode* extendOrSel(FileLine* fl, AstNode* rhsp, AstNode* cmpWidthp) { static AstNode* extendOrSel(FileLine* fl, AstNode* rhsp, AstNode* cmpWidthp) {

View File

@ -135,11 +135,7 @@ class LifeBlock {
LifeBlock* m_aboveLifep; // Upper life, or NULL LifeBlock* m_aboveLifep; // Upper life, or NULL
LifeState* m_statep; // Current global state LifeState* m_statep; // Current global state
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
public: public:
LifeBlock(LifeBlock* aboveLifep, LifeState* statep) { LifeBlock(LifeBlock* aboveLifep, LifeState* statep) {
@ -297,11 +293,7 @@ private:
LifeBlock* m_lifep; // Current active lifetime map for current scope LifeBlock* m_lifep; // Current active lifetime map for current scope
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstVarRef* nodep) { virtual void visit(AstVarRef* nodep) {

View File

@ -44,11 +44,7 @@
class LifePostBaseVisitor : public AstNVisitor { class LifePostBaseVisitor : public AstNVisitor {
protected: protected:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################

View File

@ -113,11 +113,7 @@ private:
V3GraphVertex* m_topVertexp; // Vertex of top module V3GraphVertex* m_topVertexp; // Vertex of top module
vl_unordered_set<string> m_declfnWarned; // Files we issued DECLFILENAME on vl_unordered_set<string> m_declfnWarned; // Files we issued DECLFILENAME on
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// METHODS // METHODS
V3GraphVertex* vertex(AstNodeModule* nodep) { V3GraphVertex* vertex(AstNodeModule* nodep) {

View File

@ -128,11 +128,8 @@ private:
public: public:
static int debug() { // METHODS
static int level = -1; VL_DEBUG_FUNC; // Declare debug()
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void dump(const string& nameComment="linkdot", bool force=false) { void dump(const string& nameComment="linkdot", bool force=false) {
if (debug()>=6 || force) { if (debug()>=6 || force) {
string filename = v3Global.debugFilename(nameComment)+".txt"; string filename = v3Global.debugFilename(nameComment)+".txt";

View File

@ -54,11 +54,7 @@ private:
BeginStack m_beginStack; // All begin blocks above current node BeginStack m_beginStack; // All begin blocks above current node
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
AstJumpLabel* findAddLabel(AstNode* nodep, bool endOfIter) { AstJumpLabel* findAddLabel(AstNode* nodep, bool endOfIter) {
// Put label under given node, and if WHILE optionally at end of iteration // Put label under given node, and if WHILE optionally at end of iteration

View File

@ -47,11 +47,7 @@ private:
AstNodeFTask* m_ftaskp; // Function or task we're inside AstNodeFTask* m_ftaskp; // Function or task we're inside
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITs // VISITs
// Result handing // Result handing

View File

@ -65,11 +65,7 @@ private:
AstNodeDType* m_dtypep; // Current data type AstNodeDType* m_dtypep; // Current data type
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void cleanFileline(AstNode* nodep) { void cleanFileline(AstNode* nodep) {
if (!nodep->user2SetOnce()) { // Process once if (!nodep->user2SetOnce()) { // Process once

View File

@ -60,11 +60,7 @@ private:
int m_senitemCvtNum; // Temporary signal counter int m_senitemCvtNum; // Temporary signal counter
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITs // VISITs
// TODO: Most of these visitors are here for historical reasons. // TODO: Most of these visitors are here for historical reasons.
@ -472,11 +468,7 @@ private:
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp; // Current module
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITs // VISITs
virtual void visit(AstNetlist* nodep) { virtual void visit(AstNetlist* nodep) {

View File

@ -50,11 +50,7 @@ protected:
// AstVar::user4() -> AstVarRef*. First place signal set; must be first assignment // AstVar::user4() -> AstVarRef*. First place signal set; must be first assignment
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// TYPES // TYPES
union VarFlags { union VarFlags {

View File

@ -52,11 +52,7 @@ private:
V3LanguageWords m_words; // Reserved word detector V3LanguageWords m_words; // Reserved word detector
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void rename(AstNode* nodep, bool addPvt) { void rename(AstNode* nodep, bool addPvt) {
if (!nodep->user1()) { // Not already done if (!nodep->user1()) { // Not already done

View File

@ -262,11 +262,7 @@ private:
int m_rightClkWidth; // Clk width on the RHS int m_rightClkWidth; // Clk width on the RHS
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
virtual void visit(AstNodeAssign* nodep) { virtual void visit(AstNodeAssign* nodep) {
m_hasClk = false; m_hasClk = false;
@ -383,11 +379,7 @@ private:
bool m_clkAss; // There is signals marked as clocker in the assignment bool m_clkAss; // There is signals marked as clocker in the assignment
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
virtual void visit(AstNodeAssign* nodep) { virtual void visit(AstNodeAssign* nodep) {
if (const AstVarRef* varrefp = VN_CAST(nodep->lhsp(), VarRef) ) if (const AstVarRef* varrefp = VN_CAST(nodep->lhsp(), VarRef) )
if (varrefp->varp()->attrClocker() == AstVarAttrClocker::CLOCKER_YES) { if (varrefp->varp()->attrClocker() == AstVarAttrClocker::CLOCKER_YES) {
@ -480,11 +472,7 @@ private:
enum VarUsage { VU_NONE=0, VU_CON=1, VU_GEN=2 }; enum VarUsage { VU_NONE=0, VU_CON=1, VU_GEN=2 };
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void iterateNewStmt(AstNode* nodep) { void iterateNewStmt(AstNode* nodep) {
if (m_scopep) { if (m_scopep) {

View File

@ -113,11 +113,7 @@ private:
string m_unlinkedTxt; // Text for AstUnlinkedRef string m_unlinkedTxt; // Text for AstUnlinkedRef
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void makeSmallNames(AstNodeModule* modp) { void makeSmallNames(AstNodeModule* modp) {
std::vector<int> usedLetter; usedLetter.resize(256); std::vector<int> usedLetter; usedLetter.resize(256);

View File

@ -54,11 +54,7 @@ private:
bool m_noopt; // Disable optimization of variables in this block bool m_noopt; // Disable optimization of variables in this block
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstNodeAssign* nodep) { virtual void visit(AstNodeAssign* nodep) {
@ -116,11 +112,7 @@ private:
bool m_assignLhs; // Inside assignment lhs, don't breakup extracts bool m_assignLhs; // Inside assignment lhs, don't breakup extracts
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
bool assignNoTemp(AstNodeAssign* nodep) { bool assignNoTemp(AstNodeAssign* nodep) {
return (VN_IS(nodep->lhsp(), VarRef) return (VN_IS(nodep->lhsp(), VarRef)

View File

@ -69,11 +69,7 @@ private:
VarRefScopeSet m_varRefScopes; // Varrefs-in-scopes needing fixup when donw VarRefScopeSet m_varRefScopes; // Varrefs-in-scopes needing fixup when donw
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void cleanupVarRefs() { void cleanupVarRefs() {
for (VarRefScopeSet::iterator it = m_varRefScopes.begin(); for (VarRefScopeSet::iterator it = m_varRefScopes.begin();
@ -317,11 +313,7 @@ private:
AstScope* m_scopep; // Current scope we are building AstScope* m_scopep; // Current scope we are building
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
virtual void visit(AstScope* nodep) { virtual void visit(AstScope* nodep) {

View File

@ -56,11 +56,7 @@ private:
std::vector<AstSenTree*> m_treesp; // List of sensitive blocks, for folding std::vector<AstSenTree*> m_treesp; // List of sensitive blocks, for folding
// VISITORS // VISITORS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
virtual void visit(AstNodeModule* nodep) { virtual void visit(AstNodeModule* nodep) {
// Only do the top // Only do the top

View File

@ -111,11 +111,7 @@ private:
// Note level 8&9 include debugging each simulation value // Note level 8&9 include debugging each simulation value
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// Potentially very slow, intended for debugging // Potentially very slow, intended for debugging
string prettyNumber(V3Number* nump, AstNodeDType* dtypep) { string prettyNumber(V3Number* nump, AstNodeDType* dtypep) {

View File

@ -64,11 +64,7 @@ class SliceVisitor : public AstNVisitor {
bool m_assignError; // True if the current assign already has an error bool m_assignError; // True if the current assign already has an error
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
AstNode* cloneAndSel(AstNode* nodep, int elements, int offset) { AstNode* cloneAndSel(AstNode* nodep, int elements, int offset) {
// Insert an ArraySel, except for a few special cases // Insert an ArraySel, except for a few special cases

View File

@ -277,11 +277,7 @@ public:
// METHODS // METHODS
protected: protected:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void scoreboardClear() { void scoreboardClear() {
//VV***** We reset user1p() and user2p on each block!!! //VV***** We reset user1p() and user2p on each block!!!
@ -680,11 +676,7 @@ protected:
iterateChildren(nodep); iterateChildren(nodep);
} }
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
private: private:
VL_UNCOPYABLE(IfColorVisitor); VL_UNCOPYABLE(IfColorVisitor);
}; };
@ -741,11 +733,7 @@ public:
} }
protected: protected:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
AstSplitPlaceholder* makePlaceholderp() { AstSplitPlaceholder* makePlaceholderp() {
return new AstSplitPlaceholder(m_origAlwaysp->fileline()); return new AstSplitPlaceholder(m_origAlwaysp->fileline());

View File

@ -44,11 +44,7 @@
class SplitAsBaseVisitor : public AstNVisitor { class SplitAsBaseVisitor : public AstNVisitor {
public: public:
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################

View File

@ -68,11 +68,7 @@ private:
V3Double0 m_statVarScpBytes; // Statistic tracking V3Double0 m_statVarScpBytes; // Statistic tracking
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void allNodes(AstNode* nodep) { void allNodes(AstNode* nodep) {
m_instrs += nodep->instrCount(); m_instrs += nodep->instrCount();

View File

@ -45,11 +45,7 @@
class SubstBaseVisitor : public AstNVisitor { class SubstBaseVisitor : public AstNVisitor {
public: public:
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################

View File

@ -98,11 +98,7 @@ private:
std::deque<AstVarScope*> m_tableVarps; // Table being created std::deque<AstVarScope*> m_tableVarps; // Table being created
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
bool treeTest(AstAlways* nodep) { bool treeTest(AstAlways* nodep) {
// Process alw/assign tree // Process alw/assign tree

View File

@ -318,11 +318,7 @@ private:
DpiNames m_dpiNames; // Map of all created DPI functions DpiNames m_dpiNames; // Map of all created DPI functions
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
AstVarScope* createFuncVar(AstCFunc* funcp, const string& name, AstVar* examplep) { AstVarScope* createFuncVar(AstCFunc* funcp, const string& name, AstVar* examplep) {
AstVar* newvarp = new AstVar (funcp->fileline(), AstVarType::BLOCKTEMP, name, AstVar* newvarp = new AstVar (funcp->fileline(), AstVarType::BLOCKTEMP, name,

View File

@ -190,11 +190,7 @@ private:
V3Double0 m_statUniqCodes;// Statistic tracking V3Double0 m_statUniqCodes;// Statistic tracking
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void detectDuplicates() { void detectDuplicates() {
UINFO(9,"Finding duplicates\n"); UINFO(9,"Finding duplicates\n");

View File

@ -58,11 +58,7 @@ private:
V3Double0 m_statIgnSigs; // Statistic tracking V3Double0 m_statIgnSigs; // Statistic tracking
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
const char* vscIgnoreTrace(AstVarScope* nodep) { const char* vscIgnoreTrace(AstVarScope* nodep) {
// Return true if this shouldn't be traced // Return true if this shouldn't be traced

View File

@ -79,11 +79,7 @@
class TristateBaseVisitor : public AstNVisitor { class TristateBaseVisitor : public AstNVisitor {
public: public:
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
}; };
//###################################################################### //######################################################################
@ -142,11 +138,7 @@ public:
private: private:
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
TristateVertex* makeVertex(AstNode* nodep) { TristateVertex* makeVertex(AstNode* nodep) {
TristateVertex* vertexp = (TristateVertex*)(nodep->user5p()); TristateVertex* vertexp = (TristateVertex*)(nodep->user5p());

View File

@ -52,11 +52,7 @@ class UndrivenVarEntry {
enum { FLAG_USED = 0, FLAG_DRIVEN = 1, FLAGS_PER_BIT = 2 }; enum { FLAG_USED = 0, FLAG_DRIVEN = 1, FLAGS_PER_BIT = 2 };
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
public: public:
// CONSTRUCTORS // CONSTRUCTORS
@ -241,11 +237,7 @@ private:
AstAlways* m_alwaysp; // Current always if combo, otherwise NULL AstAlways* m_alwaysp; // Current always if combo, otherwise NULL
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
UndrivenVarEntry* getEntryp(AstVar* nodep, int which_user) { UndrivenVarEntry* getEntryp(AstVar* nodep, int which_user) {
if (!(which_user==1 ? nodep->user1p() : nodep->user2p())) { if (!(which_user==1 ? nodep->user1p() : nodep->user2p())) {

View File

@ -64,11 +64,7 @@ private:
AstAssignDly* m_assigndlyp; // Current assignment AstAssignDly* m_assigndlyp; // Current assignment
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void replaceBoundLvalue(AstNode* nodep, AstNode* condp) { void replaceBoundLvalue(AstNode* nodep, AstNode* condp) {
// Spec says a out-of-range LHS SEL results in a NOP. // Spec says a out-of-range LHS SEL results in a NOP.

View File

@ -61,11 +61,7 @@ private:
V3Double0 m_statIters; // Statistic tracking V3Double0 m_statIters; // Statistic tracking
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// VISITORS // VISITORS
bool cantUnroll(AstNode* nodep, const char* reason) { bool cantUnroll(AstNode* nodep, const char* reason) {

View File

@ -53,11 +53,7 @@ private:
#define iterateChildren DO_NOT_iterateChildern_IN_V3WidthSel #define iterateChildren DO_NOT_iterateChildern_IN_V3WidthSel
// METHODS // METHODS
static int debug() { VL_DEBUG_FUNC; // Declare debug()
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
void checkConstantOrReplace(AstNode* nodep, const string& message) { void checkConstantOrReplace(AstNode* nodep, const string& message) {
// See also V3Width::checkConstantOrReplace // See also V3Width::checkConstantOrReplace