Apply 'make format'

This commit is contained in:
github action 2026-05-21 17:51:28 +00:00
parent f282335600
commit a208d17939
7 changed files with 16 additions and 13 deletions

View File

@ -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");

View File

@ -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);

View File

@ -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:

0
test_regress/t/t_fsm_register_wrapper.py Normal file → Executable file
View File

3
test_regress/t/t_fsm_register_wrapper_noinline.py Normal file → Executable file
View File

@ -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()

0
test_regress/t/t_fsm_register_wrapper_vlt_bad.py Normal file → Executable file
View File

0
test_regress/t/t_fsm_register_wrapper_warn_bad.py Normal file → Executable file
View File