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 {
protected:
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
};
class ActiveNamer : public ActiveBaseVisitor {

View File

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

View File

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

View File

@ -900,10 +900,12 @@ public:
class AstNVisitor {
private:
// MEMBERS
std::vector<AstNode*> m_deleteps; // Nodes to delete when doDeletes() called
protected:
friend class AstNode;
public:
// METHODS
/// 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
/// than an immediate deleteTree, as any pointers into this node will

View File

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

View File

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

View File

@ -59,11 +59,8 @@ class CaseLintVisitor : public AstNVisitor {
private:
AstNodeCase* m_caseExprp; // Under a CASE value node, if so the relevant case statement
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
// METHODS
VL_DEBUG_FUNC; // Declare debug()
virtual void visit(AstNodeCase* nodep) {
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
// METHODS
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
bool isCaseTreeFast(AstCase* nodep) {
int width = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,11 +41,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
AstSenTree* m_sensesp;
// METHODS
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
virtual void puts(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;
// METHODS
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
// Outfile methods
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"); }
/// 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) {

View File

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

View File

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

View File

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

View File

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

View File

@ -53,13 +53,9 @@ private:
// STATE
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
VL_DEBUG_FUNC; // Declare debug()
void nodeHashIterate(AstNode* nodep) {
if (!nodep->user4()) {
if (VN_IS(nodep->backp(), CFunc)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,11 +54,7 @@ private:
BeginStack m_beginStack; // All begin blocks above current node
// METHODS
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
AstJumpLabel* findAddLabel(AstNode* nodep, bool endOfIter) {
// 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
// METHODS
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
// VISITs
// Result handing

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -111,11 +111,7 @@ private:
// Note level 8&9 include debugging each simulation value
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
// Potentially very slow, intended for debugging
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
// METHODS
static int debug() {
static int level = -1;
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
return level;
}
VL_DEBUG_FUNC; // Declare debug()
AstNode* cloneAndSel(AstNode* nodep, int elements, int offset) {
// Insert an ArraySel, except for a few special cases

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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