mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix error when force assignment is used with ref function args (#6244)
This commit is contained in:
+5
-4
@@ -364,9 +364,6 @@ class ForceReplaceVisitor final : public VNVisitor {
|
||||
// Replace VarRef from forced LHS with rdVscp.
|
||||
if (ForceState::ForceComponentsVarScope* const fcp
|
||||
= m_state.tryGetForceComponents(nodep)) {
|
||||
FileLine* const flp = nodep->fileline();
|
||||
AstVarRef* const origp = new AstVarRef{flp, nodep->varScopep(), VAccess::READ};
|
||||
ForceState::markNonReplaceable(origp);
|
||||
nodep->varp(fcp->m_rdVscp->varp());
|
||||
nodep->varScopep(fcp->m_rdVscp);
|
||||
}
|
||||
@@ -398,7 +395,11 @@ class ForceReplaceVisitor final : public VNVisitor {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
nodep->v3error("Unsupported: Signals used via read-write reference cannot be forced");
|
||||
if (!m_inLogic) return;
|
||||
if (m_state.tryGetForceComponents(nodep) || ForceState::getValVscp(nodep)) {
|
||||
nodep->v3error(
|
||||
"Unsupported: Signals used via read-write reference cannot be forced");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user