Fix error message for invalid parameter overrides (#4559)

This commit is contained in:
Anthony Donlon
2023-10-15 12:59:36 -04:00
committed by GitHub
parent 4e2c63c8cb
commit 4427f03b08
14 changed files with 182 additions and 72 deletions
+4 -4
View File
@@ -699,8 +699,8 @@ class ParamProcessor final : public VNDeleter {
if (!pinp->exprp()) return; // No-connect
if (AstVar* const modvarp = pinp->modVarp()) {
if (!modvarp->isGParam()) {
pinp->v3error("Attempted parameter setting of non-parameter: Param "
<< pinp->prettyNameQ() << " of " << nodep->prettyNameQ());
pinp->v3fatalSrc("Attempted parameter setting of non-parameter: Param "
<< pinp->prettyNameQ() << " of " << nodep->prettyNameQ());
} else if (VN_IS(pinp->exprp(), InitArray) && arraySubDTypep(modvarp->subDTypep())) {
// Array assigned to array
AstNode* const exprp = pinp->exprp();
@@ -761,8 +761,8 @@ class ParamProcessor final : public VNDeleter {
}
}
} else {
pinp->v3error("Parameter not found in sub-module: Param "
<< pinp->prettyNameQ() << " of " << nodep->prettyNameQ());
pinp->v3fatalSrc("Parameter not found in sub-module: Param "
<< pinp->prettyNameQ() << " of " << nodep->prettyNameQ());
}
}