diff --git a/elab_scope.cc b/elab_scope.cc index 5172ded6f..dbc16acdf 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: elab_scope.cc,v 1.7 2000/12/16 01:45:48 steve Exp $" +#ident "$Id: elab_scope.cc,v 1.8 2001/04/28 23:18:08 steve Exp $" #endif /* @@ -191,6 +191,13 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const { + if (get_name() == "") { + cerr << get_line() << ": error: Instantiation of module " + << mod->get_name() << " requires an instance name." << endl; + des->errors += 1; + return; + } + // Missing module instance names have already been rejected. assert(get_name() != ""); @@ -444,6 +451,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const /* * $Log: elab_scope.cc,v $ + * Revision 1.8 2001/04/28 23:18:08 steve + * UDP instances need not have user supplied names. + * * Revision 1.7 2000/12/16 01:45:48 steve * Detect recursive instantiations (PR#2) * diff --git a/elaborate.cc b/elaborate.cc index 4ef26dd24..308fb6803 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: elaborate.cc,v 1.211 2001/04/24 02:23:58 steve Exp $" +#ident "$Id: elaborate.cc,v 1.212 2001/04/28 23:18:08 steve Exp $" #endif /* @@ -613,7 +613,13 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, const string&path) const void PGModule::elaborate_udp_(Design*des, PUdp*udp, const string&path) const { NetScope*scope = des->find_scope(path); - const string my_name = path+"."+get_name(); + + string my_name = get_name(); + if (my_name == "") + my_name = des->local_symbol(path); + else + my_name = path+"."+my_name; + NetUDP*net = new NetUDP(scope, my_name, udp->ports.count(), udp); net->set_attributes(udp->attributes); @@ -2301,6 +2307,9 @@ Design* elaborate(const map&modules, /* * $Log: elaborate.cc,v $ + * Revision 1.212 2001/04/28 23:18:08 steve + * UDP instances need not have user supplied names. + * * Revision 1.211 2001/04/24 02:23:58 steve * Support for UDP devices in VVP (Stephen Boettcher) * diff --git a/pform.cc b/pform.cc index ffed30bab..3a16852ef 100644 --- a/pform.cc +++ b/pform.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: pform.cc,v 1.74 2001/02/17 05:15:33 steve Exp $" +#ident "$Id: pform.cc,v 1.75 2001/04/28 23:18:08 steve Exp $" #endif # include "compiler.h" @@ -443,13 +443,6 @@ static void pform_make_modgate(const string&type, PExpr*msb, PExpr*lsb, const char*fn, unsigned ln) { - if (name == "") { - cerr << fn << ":" << ln << ": Instantiation of " << type - << " module requires an instance name." << endl; - error_count += 1; - return; - } - PGModule*cur = new PGModule(type, name, wires); cur->set_file(fn); cur->set_lineno(ln); @@ -481,13 +474,6 @@ static void pform_make_modgate(const string&type, PExpr*msb, PExpr*lsb, const char*fn, unsigned ln) { - if (name == "") { - cerr << fn << ":" << ln << ": Instantiation of " << type - << " module requires an instance name." << endl; - error_count += 1; - return; - } - unsigned npins = bind->count(); named*pins = new named[npins]; for (unsigned idx = 0 ; idx < npins ; idx += 1) { @@ -1010,6 +996,9 @@ int pform_parse(const char*path, map&modules, /* * $Log: pform.cc,v $ + * Revision 1.75 2001/04/28 23:18:08 steve + * UDP instances need not have user supplied names. + * * Revision 1.74 2001/02/17 05:15:33 steve * Allow task ports to be given real types. *