Error message for inconnected primitive ports.

Error message (instead of a seg fault) when a primitive port
is left unconnected.

Signed-off-by: Stephen Williams <steve@icarus.com>
This commit is contained in:
Stephen Williams 2007-09-04 16:26:43 -07:00
parent 2fc5f4f7d8
commit c92b37b1bd
1 changed files with 6 additions and 0 deletions

View File

@ -469,6 +469,12 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
const PExpr*ex = pin(idx);
if (ex == 0) {
cerr << get_line() << ": error: Logic gate port "
"expressions are not optional." << endl;
des->errors += 1;
return;
}
NetNet*sig = (idx == 0)
? ex->elaborate_lnet(des, scope, true)
: ex->elaborate_net(des, scope, 0, 0, 0, 0);