From 0c9fb766b65a4937ea6c942270e8a49e0fa95654 Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 30 Apr 2006 05:17:48 +0000 Subject: [PATCH] Get the data type of part select results right. --- elab_net.cc | 11 +++++++++-- elaborate.cc | 6 +++++- expr_synth.cc | 15 ++++++++++----- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/elab_net.cc b/elab_net.cc index 91adcced8..177629cc7 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: elab_net.cc,v 1.182 2006/04/28 05:09:51 steve Exp $" +#ident "$Id: elab_net.cc,v 1.183 2006/04/30 05:17:48 steve Exp $" #endif # include "config.h" @@ -383,6 +383,7 @@ static NetNet* compare_eq_constant(Design*des, NetScope*scope, 1); NetEConst*ogate = new NetEConst(oval); NetNet*osig = ogate->synthesize(des); + osig->data_type(lsig->data_type()); delete ogate; if (debug_elaborate) @@ -437,7 +438,7 @@ static NetNet* compare_eq_constant(Design*des, NetScope*scope, NetNet*tmp = new NetNet(scope, scope->local_symbol(), NetNet::WIRE, 0, 0); - tmp->data_type(IVL_VT_LOGIC); + tmp->data_type(lsig->data_type()); tmp->local_flag(true); tmp->set_line(*lsig); @@ -1795,6 +1796,9 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope, NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, width); + /* Assume that the data types of the nets are all the same, so + we can take the data type of any, the first will do. */ + osig->data_type(nets[0]->data_type()); if (debug_elaborate) { cerr << get_line() << ": debug: Generating part selects " @@ -2761,6 +2765,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope, /* * $Log: elab_net.cc,v $ + * Revision 1.183 2006/04/30 05:17:48 steve + * Get the data type of part select results right. + * * Revision 1.182 2006/04/28 05:09:51 steve * Handle padding of MUX net results. * diff --git a/elaborate.cc b/elaborate.cc index e89140243..ddc5eb912 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: elaborate.cc,v 1.337 2006/04/26 04:43:50 steve Exp $" +#ident "$Id: elaborate.cc,v 1.338 2006/04/30 05:17:48 steve Exp $" #endif # include "config.h" @@ -585,6 +585,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const connect(tmp1->pin(1), sig->pin(0)); NetNet*tmp2 = new NetNet(scope, scope->local_symbol(), NetNet::WIRE, 1); + tmp2->data_type(sig->data_type()); connect(tmp1->pin(0), tmp2->pin(0)); connect(cur[gdx]->pin(idx), tmp1->pin(0)); } @@ -3127,6 +3128,9 @@ Design* elaborate(listroots) /* * $Log: elaborate.cc,v $ + * Revision 1.338 2006/04/30 05:17:48 steve + * Get the data type of part select results right. + * * Revision 1.337 2006/04/26 04:43:50 steve * Chop down assign r-values that elaborate too wide. * diff --git a/expr_synth.cc b/expr_synth.cc index bc57191df..6cfbbb528 100644 --- a/expr_synth.cc +++ b/expr_synth.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: expr_synth.cc,v 1.74 2006/01/03 05:15:33 steve Exp $" +#ident "$Id: expr_synth.cc,v 1.75 2006/04/30 05:17:48 steve Exp $" #endif # include "config.h" @@ -720,10 +720,12 @@ NetNet* NetESelect::synthesize(Design *des) sel->set_line(*this); des->add_node(sel); - sub = new NetNet(scope, scope->local_symbol(), - NetNet::IMPLICIT, expr_width()); - sub->local_flag(true); - sub->set_line(*this); + NetNet*tmp = new NetNet(scope, scope->local_symbol(), + NetNet::IMPLICIT, expr_width()); + tmp->data_type(sub->data_type()); + tmp->local_flag(true); + tmp->set_line(*this); + sub = tmp; connect(sub->pin(0), sel->pin(0)); } @@ -848,6 +850,9 @@ NetNet* NetESignal::synthesize(Design*des) /* * $Log: expr_synth.cc,v $ + * Revision 1.75 2006/04/30 05:17:48 steve + * Get the data type of part select results right. + * * Revision 1.74 2006/01/03 05:15:33 steve * Fix the return type of a synthesized divide. *