From fc3118bd7f110d4c6c3dbdd63167b1e81ff67dbc Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 24 Feb 2011 20:58:15 -0800 Subject: [PATCH] Don't delete L-value concat signals and give a better error message. This patch removes the code that was deleting the signals in an L-value concat if the concatenation failed to elaborate. This is incorrect since the signal could be used in another context that is processed later. The error message when an output/inout port fails to elaborate was also improved to give the expression that is connected to the port. --- elab_net.cc | 5 ----- elaborate.cc | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/elab_net.cc b/elab_net.cc index 452ef8e6a..05cbaf525 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -84,12 +84,7 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope, } - /* If any of the sub expressions failed to elaborate, then - delete all those that did and abort myself. */ if (errors) { - for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) { - if (nets[idx]) delete nets[idx]; - } des->errors += errors; return 0; } diff --git a/elaborate.cc b/elaborate.cc index 64dcdd7b0..0ecc01b0f 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -1411,8 +1411,9 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const << "Inout port expression must support " << "continuous assignment." << endl; cerr << pins[idx]->get_fileline() << ": : " - << "Port of " << rmod->mod_name() - << " is " << rmod->ports[idx]->name << endl; + << "Port " << rmod->ports[idx]->name << " of " + << rmod->mod_name() << " is connected to " + << *pins[idx] << endl; des->errors += 1; continue; } @@ -1457,8 +1458,9 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const << "Output port expression must support " << "continuous assignment." << endl; cerr << pins[idx]->get_fileline() << ": : " - << "Port of " << rmod->mod_name() - << " is " << rmod->ports[idx]->name << endl; + << "Port " << rmod->ports[idx]->name << " of " + << rmod->mod_name() << " is connected to " + << *pins[idx] << endl; des->errors += 1; continue; }