diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index 1cf4c4f036..26b53e37b5 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -497,7 +497,6 @@ class ConstraintExprVisitor final : public VNVisitor { AstVar* const m_genp; // VlRandomizer variable of the class AstVar* m_randModeVarp; // Relevant randmode state variable bool m_wantSingle = false; // Whether to merge constraint expressions with LOGAND - const int m_visitCnt = 0; // visit count AstSFormatF* getConstFormat(AstNodeExpr* nodep) { return new AstSFormatF{nodep->fileline(), (nodep->width() & 3) ? "#b%b" : "#x%x", false, @@ -829,11 +828,10 @@ class ConstraintExprVisitor final : public VNVisitor { public: // CONSTRUCTORS explicit ConstraintExprVisitor(AstNode* nodep, AstNodeFTask* taskp, AstVar* genp, - AstVar* randModeVarp, const int visitCnt) + AstVar* randModeVarp) : m_taskp{taskp} , m_genp{genp} - , m_randModeVarp{randModeVarp} - , m_visitCnt{visitCnt} { + , m_randModeVarp{randModeVarp} { iterateAndNextNull(nodep); } }; @@ -1917,7 +1915,7 @@ class RandomizeVisitor final : public VNVisitor { m_memberMap.insert(classp, setupTaskp); AstConstraint* const constrCopyp = constrp->cloneTree(false); - ConstraintExprVisitor{constrCopyp->itemsp(), setupTaskp, genArgp, randModeVarp, 1}; + ConstraintExprVisitor{constrCopyp->itemsp(), setupTaskp, genArgp, randModeVarp}; if (constrCopyp->itemsp()) { setupTaskp->addStmtsp(constrCopyp->itemsp()->unlinkFrBackWithNext()); } @@ -2141,10 +2139,7 @@ class RandomizeVisitor final : public VNVisitor { // Generate constraint setup code and a hardcoded call to the solver AstNode* const capturedTreep = withp->exprp()->unlinkFrBackWithNext(); randomizeFuncp->addStmtsp(capturedTreep); - { - ConstraintExprVisitor{capturedTreep, randomizeFuncp, localGenp, randModeVarp, - ++m_withCnt}; - } + { ConstraintExprVisitor{capturedTreep, randomizeFuncp, localGenp, randModeVarp}; } // Call the solver and set return value AstVarRef* const randNextp = new AstVarRef{fl, localGenp, VAccess::READWRITE};