From ff5846100c170712fa746b84831267a63c3a8279 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 18 Nov 2000 05:12:45 +0000 Subject: [PATCH] Delete unreferenced signals no matter what. --- nodangle.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/nodangle.cc b/nodangle.cc index 4714e8860..e0167488d 100644 --- a/nodangle.cc +++ b/nodangle.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: nodangle.cc,v 1.8 2000/06/25 19:59:42 steve Exp $" +#ident "$Id: nodangle.cc,v 1.9 2000/11/18 05:12:45 steve Exp $" #endif /* @@ -52,12 +52,12 @@ void nodangle_f::event(Design*des, NetEvent*ev) void nodangle_f::signal(Design*des, NetNet*sig) { - if (! sig->local_flag()) - return; + /* Cannot delete signals referenced in an expression. */ if (sig->get_eref() > 0) return; - /* Look for a completely unconnected signal. */ + /* Check to see if the signal is completely unconnected. If + all the bits are unlinked, then delete it. */ unsigned unlinked = 0; for (unsigned idx = 0 ; idx < sig->pin_count() ; idx += 1) if (! sig->pin(idx).is_linked()) unlinked += 1; @@ -67,6 +67,11 @@ void nodangle_f::signal(Design*des, NetNet*sig) return; } + /* The remaining things can only be done to synthesized + signals, not ones that appear in the original Verilog. */ + if (! sig->local_flag()) + return; + /* Check to see if there is some significant signal connected to every pin of this signal. */ unsigned significant_flags = 0; @@ -105,6 +110,9 @@ void nodangle(Design*des) /* * $Log: nodangle.cc,v $ + * Revision 1.9 2000/11/18 05:12:45 steve + * Delete unreferenced signals no matter what. + * * Revision 1.8 2000/06/25 19:59:42 steve * Redesign Links to include the Nexus class that * carries properties of the connected set of links.