From 1f0c274e82cbff0a2e4d0b194201bc8d09c99f75 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 20 Sep 2003 01:05:35 +0000 Subject: [PATCH] Obsolete find_symbol and find_event from the Design class. --- elaborate.cc | 57 ++++++++++++++++++++++++++++++--------------------- net_design.cc | 28 ++++--------------------- netlist.h | 15 +++++--------- 3 files changed, 43 insertions(+), 57 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index 702c953f8..96fef87e2 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.288 2003/09/13 01:01:51 steve Exp $" +#ident "$Id: elaborate.cc,v 1.289 2003/09/20 01:05:35 steve Exp $" #endif # include "config.h" @@ -1811,22 +1811,6 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope, { assert(scope); - - /* Handle the special case of an event name as an identifier - in an expression. Make a named event reference. */ - - if (expr_.count() == 1) { - assert(expr_[0]->expr()); - PEIdent*id = dynamic_cast(expr_[0]->expr()); - NetEvent*ev; - if (id && (ev = des->find_event(scope, id->path()))) { - NetEvWait*pr = new NetEvWait(enet); - pr->add_event(ev); - pr->set_line(*this); - return pr; - } - } - /* Create a single NetEvent and NetEvWait. Then, create a NetEvProbe for each conjunctive event in the event list. The NetEvProbe objects all refer back to the NetEvent @@ -1879,13 +1863,22 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope, skip the rest of the expression handling. */ if (PEIdent*id = dynamic_cast(expr_[idx]->expr())) { - NetEvent*tmp = des->find_event(scope, id->path()); - if (tmp) { - wa->add_event(tmp); + NetNet* sig = 0; + NetMemory* mem = 0; + NetVariable* var = 0; + const NetExpr*par = 0; + NetEvent* eve = 0; + + NetScope*found_in = symbol_search(des, scope, id->path(), + sig, mem, var, par, eve); + + if (found_in && eve) { + wa->add_event(eve); continue; } } + /* So now we have a normal event expression. Elaborate the sub-expression as a net and decide how to handle the edge. */ @@ -2361,15 +2354,30 @@ NetProc* PTrigger::elaborate(Design*des, NetScope*scope) const { assert(scope); - NetEvent*ev = des->find_event(scope, event_); - if (ev == 0) { + NetNet* sig = 0; + NetMemory* mem = 0; + NetVariable* var = 0; + const NetExpr*par = 0; + NetEvent* eve = 0; + + NetScope*found_in = symbol_search(des, scope, event_, + sig, mem, var, par, eve); + + if (found_in == 0) { cerr << get_line() << ": error: event <" << event_ << ">" << " not found." << endl; des->errors += 1; return 0; } - NetEvTrig*trig = new NetEvTrig(ev); + if (eve == 0) { + cerr << get_line() << ": error: <" << event_ << ">" + << " is not a named event." << endl; + des->errors += 1; + return 0; + } + + NetEvTrig*trig = new NetEvTrig(eve); trig->set_line(*this); return trig; } @@ -2615,6 +2623,9 @@ Design* elaborate(listroots) /* * $Log: elaborate.cc,v $ + * Revision 1.289 2003/09/20 01:05:35 steve + * Obsolete find_symbol and find_event from the Design class. + * * Revision 1.288 2003/09/13 01:01:51 steve * Spelling fixes. * diff --git a/net_design.cc b/net_design.cc index ff1d62f0a..b253dcb2c 100644 --- a/net_design.cc +++ b/net_design.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: net_design.cc,v 1.40 2003/09/19 03:50:12 steve Exp $" +#ident "$Id: net_design.cc,v 1.41 2003/09/20 01:05:36 steve Exp $" #endif # include "config.h" @@ -540,29 +540,6 @@ NetScope* Design::find_task(const hname_t&key) return 0; } -NetEvent* Design::find_event(NetScope*scope, const hname_t&p) -{ - hname_t path = p; - assert(scope); - - char*key = path.remove_tail_name(); - if (path.peek_name(0)) - scope = find_scope(scope, path); - - while (scope) { - if (NetEvent*ev = scope->find_event(key)) { - delete key; - return ev; - } - - if (scope->type() == NetScope::MODULE) - break; - scope = scope->parent(); - } - - delete key; - return 0; -} void Design::add_node(NetNode*net) @@ -640,6 +617,9 @@ void Design::delete_process(NetProcTop*top) /* * $Log: net_design.cc,v $ + * Revision 1.41 2003/09/20 01:05:36 steve + * Obsolete find_symbol and find_event from the Design class. + * * Revision 1.40 2003/09/19 03:50:12 steve * Remove find_memory method from Design class. * diff --git a/netlist.h b/netlist.h index 1bd7dbb32..e204c6a74 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: netlist.h,v 1.301 2003/09/19 03:50:12 steve Exp $" +#ident "$Id: netlist.h,v 1.302 2003/09/20 01:05:36 steve Exp $" #endif /* @@ -1747,7 +1747,7 @@ class NetDisable : public NetProc { * The NetEvWait class represents a thread wait for an event. When * this statement is executed, it starts waiting on the * event. Conceptually, it puts itself on the event list for the - * referenced event. When the event is triggered, the wit ends its + * referenced event. When the event is triggered, the wait ends its * block and starts the associated statement. * * The NetEvTrig class represents trigger statements. Executing this @@ -3214,11 +3214,6 @@ class Design { NetNet*find_signal(NetScope*scope, hname_t path); - /* This is a more general lookup that finds the named signal - or memory, whichever is first in the search path. */ - void find_symbol(NetScope*,const string&key, - NetNet*&sig, NetMemory*&mem); - // Functions NetFuncDef* find_function(NetScope*scope, const hname_t&key); NetFuncDef* find_function(const hname_t&path); @@ -3227,9 +3222,6 @@ 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*); @@ -3316,6 +3308,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.302 2003/09/20 01:05:36 steve + * Obsolete find_symbol and find_event from the Design class. + * * Revision 1.301 2003/09/19 03:50:12 steve * Remove find_memory method from Design class. *