Apply 'make format'

This commit is contained in:
github action 2026-04-30 11:23:36 +00:00
parent 7f01806e15
commit 021f5f7d02
2 changed files with 19 additions and 20 deletions

View File

@ -354,16 +354,17 @@ class FsmDetectVisitor final : public VNVisitor {
explicit RegisterAlwaysAnalyzer(AstScope* scopep) explicit RegisterAlwaysAnalyzer(AstScope* scopep)
: m_scopep{scopep} {} : m_scopep{scopep} {}
std::vector<std::pair<AstCase*, AstNodeExpr*>> oneBlockCandidates(AstAlways* alwaysp) const { std::vector<std::pair<AstCase*, AstNodeExpr*>>
oneBlockCandidates(AstAlways* alwaysp) const {
std::vector<std::pair<AstCase*, AstNodeExpr*>> candidates; std::vector<std::pair<AstCase*, AstNodeExpr*>> candidates;
AstNode* const stmtsp = alwaysp->stmtsp(); AstNode* const stmtsp = alwaysp->stmtsp();
AstIf* const firstIfp = VN_CAST(stmtsp, If); AstIf* const firstIfp = VN_CAST(stmtsp, If);
if (firstIfp) { if (firstIfp) {
if (AstCase* const casep = VN_CAST(firstIfp->elsesp(), Case)) { if (AstCase* const casep = VN_CAST(firstIfp->elsesp(), Case)) {
candidates.emplace_back( candidates.emplace_back(casep,
casep, FsmDetectVisitor::isSimpleResetCond(firstIfp->condp()) FsmDetectVisitor::isSimpleResetCond(firstIfp->condp())
? firstIfp->condp() ? firstIfp->condp()
: nullptr); : nullptr);
} }
} }
for (AstNode* nodep = stmtsp; nodep; nodep = nodep->nextp()) { for (AstNode* nodep = stmtsp; nodep; nodep = nodep->nextp()) {
@ -377,8 +378,8 @@ class FsmDetectVisitor final : public VNVisitor {
return FsmDetectVisitor::matchRegisterAlways(alwaysp, m_scopep, cand); return FsmDetectVisitor::matchRegisterAlways(alwaysp, m_scopep, cand);
} }
void buildOneBlockCandidate(AstAlways* alwaysp, AstVarScope* vscp, void buildOneBlockCandidate(AstAlways* alwaysp, AstVarScope* vscp, AstNodeExpr* resetCondp,
AstNodeExpr* resetCondp, FsmRegisterCandidate& reg) const { FsmRegisterCandidate& reg) const {
reg.scopep(m_scopep); reg.scopep(m_scopep);
reg.alwaysp(alwaysp); reg.alwaysp(alwaysp);
reg.stateVscp(vscp); reg.stateVscp(vscp);
@ -441,9 +442,8 @@ class FsmDetectVisitor final : public VNVisitor {
} else if (selp->varScopep() != reg.stateVscp()) { } else if (selp->varScopep() != reg.stateVscp()) {
continue; continue;
} }
AstNode* const warnNodep AstNode* const warnNodep = FsmDetectVisitor::caseSupportedTransitionNode(
= FsmDetectVisitor::caseSupportedTransitionNode(casep, reg.nextVscp(), casep, reg.nextVscp(), reg.inclCond());
reg.inclCond());
if (!warnNodep) continue; if (!warnNodep) continue;
match.matchedp = &reg; match.matchedp = &reg;
match.warnNodep = warnNodep; match.warnNodep = warnNodep;
@ -1034,16 +1034,16 @@ class FsmDetectVisitor final : public VNVisitor {
if (!matchedp) continue; if (!matchedp) continue;
if (!firstCand.stateVscp) { if (!firstCand.stateVscp) {
const auto insertPair = m_comboPaired.emplace( const auto insertPair = m_comboPaired.emplace(
matchedp->stateVscp(), FsmCaseCandidate{matchedWarnNodep, matchedp->stateVscp(),
const_cast<AstVarScope*>( FsmCaseCandidate{matchedWarnNodep,
matchedp->stateVscp())}); const_cast<AstVarScope*>(matchedp->stateVscp())});
if (!insertPair.second) { if (!insertPair.second) {
matchedWarnNodep->v3warn( matchedWarnNodep->v3warn(
FSMMULTI, FSMMULTI, "FSM coverage: multiple supported transition candidates found "
"FSM coverage: multiple supported transition candidates found " "for the same FSM in combinational always blocks. Only the "
"for the same FSM in combinational always blocks. Only the " "first candidate will be instrumented."
"first candidate will be instrumented." << candidateConflictContext(matchedWarnNodep,
<< candidateConflictContext(matchedWarnNodep, insertPair.first->second)); insertPair.first->second));
continue; continue;
} }
firstCand.warnNodep = matchedWarnNodep; firstCand.warnNodep = matchedWarnNodep;
@ -1060,8 +1060,7 @@ class FsmDetectVisitor final : public VNVisitor {
"supported case statements found in the same " "supported case statements found in the same "
"combinational always block. Only the first " "combinational always block. Only the first "
"candidate will be instrumented." "candidate will be instrumented."
<< candidateConflictContext(matchedWarnNodep, << candidateConflictContext(matchedWarnNodep, firstCand));
firstCand));
} }
} }

View File