Add error on real to non-real output pins (#2690).

This commit is contained in:
Wilson Snyder
2020-12-13 13:33:48 -05:00
parent 5898c22b3b
commit 82fc142c1c
5 changed files with 115 additions and 0 deletions
+9
View File
@@ -4183,6 +4183,8 @@ private:
<< conDTypep->prettyDTypeNameQ() << " data type.");
} else if (nodep->modVarp()->isTristate()) {
if (pinwidth != conwidth) {
// Ideally should call pinReconnectSimple which would tolerate this
// then have a conversion warning
nodep->v3warn(E_UNSUPPORTED,
"Unsupported: " << ucfirst(nodep->prettyOperatorName())
<< " to inout signal requires " << pinwidth
@@ -4191,7 +4193,14 @@ private:
<< " generates " << conwidth << " bits.");
// otherwise would need some mess to force both sides to proper size
}
} else if (nodep->modVarp()->direction().isWritable()
&& ((conDTypep->isDouble() && !modDTypep->isDouble())
|| (!conDTypep->isDouble() && modDTypep->isDouble()))) {
nodep->v3warn(E_UNSUPPORTED,
"Unsupported: " << ucfirst(nodep->prettyOperatorName())
<< " connects real to non-real");
}
// Check if an interface is connected to a non-interface and vice versa
if ((VN_IS(modDTypep, IfaceRefDType) && !VN_IS(conDTypep, IfaceRefDType))
|| (VN_IS(conDTypep, IfaceRefDType) && !VN_IS(modDTypep, IfaceRefDType))) {