diff --git a/elab_anet.cc b/elab_anet.cc index 9c7a6145c..9d5a311d4 100644 --- a/elab_anet.cc +++ b/elab_anet.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: elab_anet.cc,v 1.11 2005/07/11 16:56:50 steve Exp $" +#ident "$Id: elab_anet.cc,v 1.12 2006/05/01 20:47:58 steve Exp $" #endif # include "config.h" @@ -89,10 +89,13 @@ NetNet* PEConcat::elaborate_anet(Design*des, NetScope*scope) const NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT_REG, pins); + /* Assume that all the data types are the same. */ + osig->data_type(nets[0]->data_type()); pins = 0; for (unsigned idx = nets.count() ; idx > 0 ; idx -= 1) { NetNet*cur = nets[idx-1]; + assert(cur->data_type() == osig->data_type()); for (unsigned pin = 0; pin < cur->pin_count(); pin += 1) { connect(osig->pin(pins), cur->pin(pin)); pins += 1; @@ -166,6 +169,9 @@ NetNet* PEIdent::elaborate_anet(Design*des, NetScope*scope) const /* * $Log: elab_anet.cc,v $ + * Revision 1.12 2006/05/01 20:47:58 steve + * More explicit datatype setup. + * * Revision 1.11 2005/07/11 16:56:50 steve * Remove NetVariable and ivl_variable_t structures. * diff --git a/elab_net.cc b/elab_net.cc index 177629cc7..38679d0c1 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.183 2006/04/30 05:17:48 steve Exp $" +#ident "$Id: elab_net.cc,v 1.184 2006/05/01 20:47:58 steve Exp $" #endif # include "config.h" @@ -873,6 +873,7 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope, temporary signal to represent it. */ NetNet*tmp = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, 1); + tmp->data_type(IVL_VT_LOGIC); tmp->local_flag(true); connect(gate->pin(1), tmp->pin(0)); @@ -894,6 +895,7 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope, temporary signal to represent it. */ NetNet*tmp = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, 1); + tmp->data_type(IVL_VT_LOGIC); tmp->local_flag(true); connect(gate->pin(2), tmp->pin(0)); @@ -943,6 +945,7 @@ NetNet* PEBinary::elaborate_net_mul_(Design*des, NetScope*scope, connect(odev->pin(idx), osig->pin(idx)); des->add_node(odev); + osig->data_type(IVL_VT_LOGIC); osig->local_flag(true); return osig; } @@ -1299,6 +1302,7 @@ NetNet* PECallFunction::elaborate_net(Design*des, NetScope*scope, NetNet::WIRE, def->return_sig()->vector_width()); osig->local_flag(true); + osig->data_type(def->return_sig()->data_type()); connect(net->pin(0), osig->pin(0)); @@ -1824,6 +1828,7 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope, } assert(width == 0); + osig->data_type(nets[0]->data_type()); osig->local_flag(true); return osig; } @@ -2388,6 +2393,7 @@ NetNet* PEString::elaborate_net(Design*des, NetScope*scope, net = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, strbits); } + net->data_type(IVL_VT_BOOL); net->local_flag(true); /* Make a verinum that is filled with the 0 pad. */ @@ -2488,6 +2494,7 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope, NetNet*tmp = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, 1); + tmp->data_type(IVL_VT_LOGIC); tmp->local_flag(true); connect(log->pin(0), tmp->pin(0)); @@ -2541,6 +2548,7 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope, if (rise || fall || decay) { NetNet*tmp = new NetNet(scope, scope->local_symbol(), NetNet::WIRE, dwidth); + sig->data_type(expr_type); NetBUFZ*tmpz = new NetBUFZ(scope, scope->local_symbol(), dwidth); tmpz->rise_time(rise); @@ -2727,6 +2735,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope, NetNet*tmp_sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE, sub_sig->vector_width()); + tmp_sig->data_type(sub_sig->data_type()); tmp_sig->local_flag(true); connect(tmp_sig->pin(0), sub->pin_DataA()); @@ -2765,6 +2774,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope, /* * $Log: elab_net.cc,v $ + * Revision 1.184 2006/05/01 20:47:58 steve + * More explicit datatype setup. + * * Revision 1.183 2006/04/30 05:17:48 steve * Get the data type of part select results right. * diff --git a/elaborate.cc b/elaborate.cc index ddc5eb912..509b22892 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.338 2006/04/30 05:17:48 steve Exp $" +#ident "$Id: elaborate.cc,v 1.339 2006/05/01 20:47:59 steve Exp $" #endif # include "config.h" @@ -536,6 +536,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE, instance_width); + sig->data_type(IVL_VT_LOGIC); sig->local_flag(true); sig->set_line(*this); connect(rep->pin(0), sig->pin(0)); @@ -572,6 +573,8 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const NetNet*tmp2 = new NetNet(scope, scope->local_symbol(), NetNet::WIRE, 1); + tmp2->local_flag(true); + tmp2->data_type(IVL_VT_LOGIC); connect(cc->pin(gdx+1), tmp2->pin(0)); } @@ -585,6 +588,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->local_flag(true); tmp2->data_type(sig->data_type()); connect(tmp1->pin(0), tmp2->pin(0)); connect(cur[gdx]->pin(idx), tmp1->pin(0)); @@ -1444,6 +1448,7 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const NetNet*tmp = new NetNet(scope, scope->local_symbol(), NetNet::REG, wid); tmp->set_line(*this); + tmp->data_type(rv->expr_type()); NetESignal*sig = new NetESignal(tmp); @@ -3128,6 +3133,9 @@ Design* elaborate(listroots) /* * $Log: elaborate.cc,v $ + * Revision 1.339 2006/05/01 20:47:59 steve + * More explicit datatype setup. + * * Revision 1.338 2006/04/30 05:17:48 steve * Get the data type of part select results right. * diff --git a/expr_synth.cc b/expr_synth.cc index 84fe6f6e9..71d922cea 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.76 2006/05/01 05:40:21 steve Exp $" +#ident "$Id: expr_synth.cc,v 1.77 2006/05/01 20:47:59 steve Exp $" #endif # include "config.h" @@ -57,6 +57,7 @@ NetNet* NetEBAdd::synthesize(Design*des) perm_string path = lsig->scope()->local_symbol(); NetNet*osig = new NetNet(lsig->scope(), path, NetNet::IMPLICIT, width); osig->local_flag(true); + osig->data_type(expr_type()); perm_string oname = osig->scope()->local_symbol(); NetAddSub *adder = new NetAddSub(lsig->scope(), oname, width); @@ -107,6 +108,7 @@ NetNet* NetEBBits::synthesize(Design*des) NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, lsig->vector_width()); osig->local_flag(true); + osig->data_type(expr_type()); perm_string oname = scope->local_symbol(); unsigned wid = lsig->vector_width(); @@ -262,6 +264,7 @@ NetNet* NetEBMult::synthesize(Design*des) NetNet::IMPLICIT, expr_width()); osig->data_type(lsig->data_type()); osig->set_line(*this); + osig->data_type(expr_type()); osig->local_flag(true); connect(mult->pin_Result(), osig->pin(0)); @@ -342,6 +345,7 @@ NetNet* NetEBLogic::synthesize(Design*des) NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, 1); + osig->data_type(expr_type()); osig->local_flag(true); @@ -434,6 +438,7 @@ NetNet* NetEBShift::synthesize(Design*des) NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, expr_width()); + osig->data_type(expr_type()); osig->local_flag(true); unsigned long ushift = shift>=0? shift : -shift; @@ -455,6 +460,7 @@ NetNet* NetEBShift::synthesize(Design*des) NetNet*zsig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE, znum.len()); + zsig->data_type(osig->data_type()); connect(zcon->pin(0), zsig->pin(0)); NetConcat*ccat = new NetConcat(scope, scope->local_symbol(), @@ -480,6 +486,7 @@ NetNet* NetEBShift::synthesize(Design*des) NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, expr_width()); + osig->data_type(expr_type()); osig->local_flag(true); assert(op() == 'l'); @@ -579,6 +586,7 @@ NetNet* NetEUBits::synthesize(Design*des) unsigned width = isig->vector_width(); NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, width); + osig->data_type(expr_type()); osig->local_flag(true); perm_string oname = scope->local_symbol(); @@ -609,6 +617,7 @@ NetNet* NetEUReduce::synthesize(Design*des) NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, 1); + osig->data_type(expr_type()); osig->local_flag(true); perm_string oname = scope->local_symbol(); @@ -739,6 +748,7 @@ NetNet* NetESelect::synthesize(Design *des) NetNet*net = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, expr_width()); + net->data_type(expr_type()); if (has_sign()) { NetSignExtend*pad = new NetSignExtend(scope, scope->local_symbol(), @@ -766,6 +776,7 @@ NetNet* NetESelect::synthesize(Design *des) NetNet*tmp = new NetNet(scope, scope->local_symbol(), NetNet::IMPLICIT, pad_width); + tmp->data_type(expr_type()); tmp->local_flag(true); tmp->set_line(*this); connect(tmp->pin(0), con->pin(0)); @@ -796,6 +807,7 @@ NetNet* NetETernary::synthesize(Design *des) unsigned width=expr_width(); NetNet*osig = new NetNet(csig->scope(), path, NetNet::IMPLICIT, width); + osig->data_type(expr_type()); osig->local_flag(true); /* Make sure both value operands are the right width. */ @@ -854,6 +866,9 @@ NetNet* NetESignal::synthesize(Design*des) /* * $Log: expr_synth.cc,v $ + * Revision 1.77 2006/05/01 20:47:59 steve + * More explicit datatype setup. + * * Revision 1.76 2006/05/01 05:40:21 steve * fix net type of multiply output. *