Better packed-array misconnect error message

This commit is contained in:
Wilson Snyder 2013-02-02 19:22:02 -05:00
parent 6e6f1045b8
commit 7d44bba95c
2 changed files with 6 additions and 4 deletions

View File

@ -1551,9 +1551,11 @@ private:
bool hiArray = nodep->exprp()->dtypep()->skipRefp()->castUnpackArrayDType();
bool loArray = nodep->modVarp()->dtypep()->skipRefp()->castUnpackArrayDType();
if (loArray != hiArray) {
nodep->v3error("Illegal port connection "<<nodep->prettyName()<<","
<<" port is"<<(hiArray?"":" not")<<" an array"
<<" expression is"<<(loArray?"":" not")<<" an array.");
nodep->v3error("Illegal port connection '"<<nodep->prettyName()<<"',"
<<" mismatch between port which is"<<(hiArray?"":" not")<<" an array,"
<<" and expression which is"<<(loArray?"":" not")<<" an array.");
UINFO(1," Related lo: "<<nodep->exprp()->dtypep()->skipRefp()<<endl);
UINFO(1," Related hi: "<<nodep->modVarp()->dtypep()->skipRefp()<<endl);
}
if (inputPin) {
// input pin is lhs, expr is rhs; resize expr to match

View File

@ -11,7 +11,7 @@ compile (
verilator_flags2 => ["--lint-only"],
fails=>1,
expect=>
'%Error: t/t_inst_misarray_bad.v:\d+: Illegal port connection foo, port is not an array expression is an array.
'%Error: t/t_inst_misarray_bad.v:\d+: Illegal port connection \'foo\', mismatch between port which is not an array, and expression which is an array.
%Error: Exiting due to.*',
);