diff --git a/src/V3Control.cpp b/src/V3Control.cpp index 1973d7eb3..e95e3c086 100644 --- a/src/V3Control.cpp +++ b/src/V3Control.cpp @@ -270,8 +270,8 @@ public: void setFsmRegisterWrapper(FileLine* fl, const V3Control::FsmRegisterWrapper& desc) { if (m_hasFsmRegisterWrapper) { fl->v3warn(BADVLTPRAGMA, "Duplicate fsm_register_wrapper descriptor for module " - << AstNode::prettyNameQ(desc.moduleName) - << "; replacing previous descriptor"); + << AstNode::prettyNameQ(desc.moduleName) + << "; replacing previous descriptor"); } m_fsmRegisterWrapper = desc; m_hasFsmRegisterWrapper = true; @@ -896,8 +896,8 @@ void V3Control::addHierWorkers(FileLine* fl, const string& model, int workers) { } void V3Control::addFsmRegisterWrapper(FileLine* fl, const string& module, const string& d, - const string& q, const string& clock, - const string& reset, const string& resetValue) { + const string& q, const string& clock, const string& reset, + const string& resetValue) { string missing; if (module.empty()) missing += "-module"; if (d.empty()) missing = VString::dot(missing, ", ", "-d"); diff --git a/src/V3Control.h b/src/V3Control.h index 68173625e..5b8ba76df 100644 --- a/src/V3Control.h +++ b/src/V3Control.h @@ -50,8 +50,8 @@ public: static void addCoverageBlockOff(const string& module, const string& blockname); static void addHierWorkers(FileLine* fl, const string& model, int workers); static void addFsmRegisterWrapper(FileLine* fl, const string& module, const string& d, - const string& q, const string& clock, - const string& reset, const string& resetValue); + const string& q, const string& clock, const string& reset, + const string& resetValue); static void addIgnore(V3ErrorCode code, bool on, const string& filename, int min, int max); static void addIgnoreMatch(V3ErrorCode code, const string& filename, const string& contents, const string& match); diff --git a/src/V3FsmDetect.cpp b/src/V3FsmDetect.cpp index 83da5908b..8f51b7469 100644 --- a/src/V3FsmDetect.cpp +++ b/src/V3FsmDetect.cpp @@ -762,7 +762,8 @@ class FsmDetectVisitor final : public VNVisitor { } cellp->v3warn(COVERIGN, "Ignoring unsupported: fsm_register_wrapper reset arcs require both " - "reset polarity and static reset value; " + reason); + "reset polarity and static reset value; " + + reason); } // This candidate represents a register proven through an instance @@ -991,11 +992,13 @@ class FsmDetectVisitor final : public VNVisitor { AstCond* const rhsp = VN_CAST(assp->rhsp(), Cond); if (!rhsp) return nullptr; if (AstVarRef* const elsep = VN_CAST(rhsp->elsep(), VarRef)) { - if (constValueStatus(rhsp->thenp(), resetValue) != ConstValueStatus::OK) return nullptr; + if (constValueStatus(rhsp->thenp(), resetValue) != ConstValueStatus::OK) + return nullptr; fromVscp = elsep->varScopep(); resetActiveLow = false; } else if (AstVarRef* const thenp = VN_CAST(rhsp->thenp(), VarRef)) { - if (constValueStatus(rhsp->elsep(), resetValue) != ConstValueStatus::OK) return nullptr; + if (constValueStatus(rhsp->elsep(), resetValue) != ConstValueStatus::OK) + return nullptr; fromVscp = thenp->varScopep(); resetActiveLow = true; } else { @@ -1411,9 +1414,8 @@ class FsmDetectVisitor final : public VNVisitor { AstNodeExpr* resetCondp = nullptr; bool resetActiveLow = false; FsmStateValue resetValue; - if (AstNodeAssign* const assp - = directCondStateVarAssign(nodep, stateVscp, nextVscp, resetCondp, resetActiveLow, - resetValue)) { + if (AstNodeAssign* const assp = directCondStateVarAssign( + nodep, stateVscp, nextVscp, resetCondp, resetActiveLow, resetValue)) { // Inlined wrappers can normalize into a compact active-low // assignment form that earlier direct-register FSM support did // not accept. The pre-inline marker is the architectural fence: diff --git a/test_regress/t/t_fsm_register_wrapper.py b/test_regress/t/t_fsm_register_wrapper.py old mode 100644 new mode 100755 diff --git a/test_regress/t/t_fsm_register_wrapper_noinline.py b/test_regress/t/t_fsm_register_wrapper_noinline.py old mode 100644 new mode 100755 index a95e3a4be..e14e8228c --- a/test_regress/t/t_fsm_register_wrapper_noinline.py +++ b/test_regress/t/t_fsm_register_wrapper_noinline.py @@ -13,7 +13,8 @@ import vltest_bootstrap test.scenarios('simulator') -test.compile(verilator_flags2=['--cc --coverage-fsm -fno-inline t/t_fsm_register_wrapper_noinline.vlt']) +test.compile( + verilator_flags2=['--cc --coverage-fsm -fno-inline t/t_fsm_register_wrapper_noinline.vlt']) test.execute() diff --git a/test_regress/t/t_fsm_register_wrapper_vlt_bad.py b/test_regress/t/t_fsm_register_wrapper_vlt_bad.py old mode 100644 new mode 100755 diff --git a/test_regress/t/t_fsm_register_wrapper_warn_bad.py b/test_regress/t/t_fsm_register_wrapper_warn_bad.py old mode 100644 new mode 100755