Skip to content

Commit

Permalink
UDP instances need not have user supplied names.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Apr 28, 2001
1 parent 4f3bdd9 commit 9bb2cee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
12 changes: 11 additions & 1 deletion elab_scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*
Expand Down Expand Up @@ -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() != "");

Expand Down Expand Up @@ -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)
*
Expand Down
13 changes: 11 additions & 2 deletions elaborate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -2301,6 +2307,9 @@ Design* elaborate(const map<string,Module*>&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)
*
Expand Down
19 changes: 4 additions & 15 deletions pform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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<PExpr*>*pins = new named<PExpr*>[npins];
for (unsigned idx = 0 ; idx < npins ; idx += 1) {
Expand Down Expand Up @@ -1010,6 +996,9 @@ int pform_parse(const char*path, map<string,Module*>&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.
*
Expand Down

0 comments on commit 9bb2cee

Please sign in to comment.