Support default value on module input (#5358) (#5373)

This commit is contained in:
Drew Ranck
2024-08-15 10:04:07 -04:00
committed by GitHub
parent 563faeb33f
commit 48c71ef76c
22 changed files with 524 additions and 27 deletions
+5 -2
View File
@@ -62,8 +62,11 @@ class LinkLValueVisitor final : public VNVisitor {
if (m_setForcedByCode) {
nodep->varp()->setForcedByCode();
} else if (!nodep->varp()->isFuncLocal() && nodep->varp()->isReadOnly()) {
nodep->v3warn(ASSIGNIN,
"Assigning to input/const variable: " << nodep->prettyNameQ());
// This is allowed with IEEE 1800-2009 module input with default value.
// the checking now happens in V3Width::visit(AstNodeVarRef*)
// If you were to check here, it would fail on module inputs with default value,
// because Inputs are isReadOnly()=true, and we don't yet have visibility into
// it being an Initial style procedure.
}
}
iterateChildren(nodep);