diff --git a/design_dump.cc b/design_dump.cc index bbdf553a6..6f5013b58 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: design_dump.cc,v 1.92 2000/07/27 05:13:44 steve Exp $" +#ident "$Id: design_dump.cc,v 1.93 2000/07/29 03:55:38 steve Exp $" #endif /* @@ -600,10 +600,10 @@ void NetEvTrig::dump(ostream&o, unsigned ind) const void NetEvWait::dump(ostream&o, unsigned ind) const { assert(nevents() > 0); - o << setw(ind) <<"" << "@(" << event(0)->name(); + o << setw(ind) <<"" << "@(" << event(0)->full_name(); for (unsigned idx = 1 ; idx < nevents() ; idx += 1) - o << " or " << event(idx)->name(); + o << " or " << event(idx)->full_name(); o << ") // " << get_line() << endl; @@ -716,8 +716,8 @@ void NetScope::dump(ostream&o) const /* Dump the events in this scope. */ for (NetEvent*cur = events_ ; cur ; cur = cur->snext_) { - o << " event " << cur->name() << "; " - << "// " << cur->get_line() << endl; + o << " event " << cur->name() << "; nprobe=" + << cur->nprobe() << " // " << cur->get_line() << endl; } // Dump the signals, @@ -987,6 +987,9 @@ void Design::dump(ostream&o) const /* * $Log: design_dump.cc,v $ + * Revision 1.93 2000/07/29 03:55:38 steve + * fix problem coalescing events w/ probes. + * * Revision 1.92 2000/07/27 05:13:44 steve * Support elaboration of disable statements. * diff --git a/net_event.cc b/net_event.cc index 59d41ea81..952bccc20 100644 --- a/net_event.cc +++ b/net_event.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: net_event.cc,v 1.8 2000/05/31 02:26:49 steve Exp $" +#ident "$Id: net_event.cc,v 1.9 2000/07/29 03:55:38 steve Exp $" #endif # include "netlist.h" @@ -106,7 +106,9 @@ NetEvent* NetEvent::find_similar_event() NetEvProbe*cur = probes_; /* First locate all the canditate events from the probe - objects that are connected to them. */ + objects that are connected to them and to my first + probe. All of these candidates have at least this probe in + common. */ for (NetNode*idx = cur->next_node() ; idx && (idx != cur) ; idx = idx->next_node()) { @@ -120,10 +122,20 @@ NetEvent* NetEvent::find_similar_event() assert(ncand <= NCAND); } + /* Now go through the remaining probes, checking that all the + candidate events also have a probe connected to this + one. By the time I finish this list, I will have eliminated + all the candidate events that are not connected to all of + my probes. */ + for (cur = cur->enext_ ; cur && ncand ; cur = cur->enext_) { for (unsigned idx = 0 ; idx < ncand ; idx += 1) cflg[idx] = false; + /* For this probe, look for other probes connected to it + and find the event connected to it. Mark that event + as connected to this probe. */ + for (NetNode*idx = cur->next_node() ; idx && (idx != cur) ; idx = idx->next_node()) { NetEvProbe*tmp = dynamic_cast(idx); @@ -139,13 +151,16 @@ NetEvent* NetEvent::find_similar_event() } } + /* Look for all the candidates that did not connect to + this probe (cflg is false) and eliminate them. */ + for (unsigned idx = 0 ; idx < ncand ; ) { if (cflg[idx]) { idx += 1; continue; } - for (unsigned tmp = idx ; idx+1 < ncand ; idx += 1) { + for (unsigned tmp = idx ; (tmp+1) < ncand ; tmp += 1) { cflg[tmp] = cflg[tmp+1]; cand[tmp] = cand[tmp+1]; } @@ -153,6 +168,10 @@ NetEvent* NetEvent::find_similar_event() } } + /* Now, skip any of the remaining candidates for any that have + a different number of probes. These would be events that + have probes that I'm not connected to. */ + for (unsigned idx = 0 ; idx < ncand ; idx += 1) { if (cand[idx]->nprobe() == nprobe()) return cand[idx]; @@ -364,6 +383,9 @@ NetProc* NetEvWait::statement() /* * $Log: net_event.cc,v $ + * Revision 1.9 2000/07/29 03:55:38 steve + * fix problem coalescing events w/ probes. + * * Revision 1.8 2000/05/31 02:26:49 steve * Globally merge redundant event objects. *