Fix scope search for events.

This commit is contained in:
steve 2002-07-03 05:34:59 +00:00
parent 70abb2ce5c
commit 3f1cd14f6c
3 changed files with 35 additions and 6 deletions

View File

@ -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.254 2002/06/19 04:20:03 steve Exp $"
#ident "$Id: elaborate.cc,v 1.255 2002/07/03 05:34:59 steve Exp $"
#endif
# include "config.h"
@ -1813,7 +1813,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
assert(expr_[0]->expr());
PEIdent*id = dynamic_cast<PEIdent*>(expr_[0]->expr());
NetEvent*ev;
if (id && (ev = scope->find_event(id->path()))) {
if (id && (ev = des->find_event(scope, id->path()))) {
NetEvWait*pr = new NetEvWait(enet);
pr->add_event(ev);
pr->set_line(*this);
@ -1873,7 +1873,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
skip the rest of the expression handling. */
if (PEIdent*id = dynamic_cast<PEIdent*>(expr_[idx]->expr())) {
NetEvent*tmp = scope->find_event(id->path());
NetEvent*tmp = des->find_event(scope, id->path());
if (tmp) {
wa->add_event(tmp);
continue;
@ -2247,7 +2247,7 @@ NetProc* PTrigger::elaborate(Design*des, NetScope*scope) const
{
assert(scope);
NetEvent*ev = scope->find_event(event_);
NetEvent*ev = des->find_event(scope, event_);
if (ev == 0) {
cerr << get_line() << ": error: event <" << event_ << ">"
<< " not found." << endl;
@ -2464,6 +2464,9 @@ Design* elaborate(list<const char*>roots)
/*
* $Log: elaborate.cc,v $
* Revision 1.255 2002/07/03 05:34:59 steve
* Fix scope search for events.
*
* Revision 1.254 2002/06/19 04:20:03 steve
* Remove NetTmp and add NetSubnet class.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: net_design.cc,v 1.24 2002/06/25 02:39:34 steve Exp $"
#ident "$Id: net_design.cc,v 1.25 2002/07/03 05:34:59 steve Exp $"
#endif
# include "config.h"
@ -406,6 +406,23 @@ NetScope* Design::find_task(const hname_t&key)
return 0;
}
NetEvent* Design::find_event(NetScope*scope, hname_t path)
{
assert(scope);
while (scope) {
if (NetEvent*ev = scope->find_event(path)) {
return ev;
}
if (scope->type() == NetScope::MODULE)
break;
scope = scope->parent();
}
return 0;
}
void Design::add_node(NetNode*net)
{
assert(net->design_ == 0);
@ -468,6 +485,9 @@ void Design::delete_process(NetProcTop*top)
/*
* $Log: net_design.cc,v $
* Revision 1.25 2002/07/03 05:34:59 steve
* Fix scope search for events.
*
* Revision 1.24 2002/06/25 02:39:34 steve
* Fix mishandling of incorect defparam error message.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: netlist.h,v 1.250 2002/07/02 03:02:57 steve Exp $"
#ident "$Id: netlist.h,v 1.251 2002/07/03 05:35:00 steve Exp $"
#endif
/*
@ -2911,6 +2911,9 @@ class Design {
NetScope* find_task(NetScope*scope, const hname_t&name);
NetScope* find_task(const hname_t&key);
// Events
NetEvent* find_event(NetScope*scope, const hname_t path);
// NODES
void add_node(NetNode*);
void del_node(NetNode*);
@ -2994,6 +2997,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.251 2002/07/03 05:35:00 steve
* Fix scope search for events.
*
* Revision 1.250 2002/07/02 03:02:57 steve
* Change the signal to a net when assignments go away.
*