Fix internal error on array pin mismatch, bug393.

This commit is contained in:
Wilson Snyder 2013-01-20 12:59:27 -05:00
parent 929aeebf12
commit 5d6a053f98
2 changed files with 9 additions and 3 deletions

View File

@ -1499,6 +1499,14 @@ private:
// otherwise would need some mess to force both sides to proper size
}
}
// Simple dtype checking, should be a more general check
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.");
}
if (inputPin) {
// input pin is lhs, expr is rhs; resize expr to match
awidth = pinwidth;

View File

@ -7,13 +7,11 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
$Self->{vlt} and $Self->unsupported("Verilator unsupported, bug595");
compile (
verilator_flags2 => ["--lint-only"],
fails=>1,
expect=>
'TBD
'%Error: t/t_inst_misarray_bad.v:\d+: Illegal port connection foo, port is not an array expression is an array.
%Error: Exiting due to.*',
);