From 0c62321402cb1f42f6a4e0f93784e851d29e27ee Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 25 May 2000 06:02:12 +0000 Subject: [PATCH] Emin init code only once per nexus. --- t-vvm.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/t-vvm.cc b/t-vvm.cc index 7e3c5e29d..629c580d1 100644 --- a/t-vvm.cc +++ b/t-vvm.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-vvm.cc,v 1.152 2000/05/25 01:45:35 steve Exp $" +#ident "$Id: t-vvm.cc,v 1.153 2000/05/25 06:02:12 steve Exp $" #endif # include @@ -1069,15 +1069,21 @@ void target_vvm::signal(ostream&os, const NetNet*sig) string net_name = mangle(sig->name()); for (unsigned idx = 0 ; idx < sig->pin_count() ; idx += 1) { + bool new_nexus_flag = false; string nexus = nexus_from_link(&sig->pin(idx)); unsigned ncode = nexus_wire_map[nexus]; if (ncode == 0) { - nexus_wire_map[nexus] = ncode = nexus_wire_counter; + nexus_wire_map[nexus] = (ncode = nexus_wire_counter); nexus_wire_counter += 1; + new_nexus_flag = true; } init_code << " nexus_wire_table[" << ncode << "].connect(&" << net_name << ", " << idx << ");" << endl; + + // Propogate the initial value to inputs throughout. + if (new_nexus_flag) + emit_init_value_(sig->pin(idx), sig->get_ival(idx)); } os << "static vvm_signal_t " << net_name << ";" << endl; @@ -1118,9 +1124,6 @@ void target_vvm::signal(ostream&os, const NetNet*sig) break; } init_code << ");" << endl; - - // Propogate the initial value to inputs throughout. - emit_init_value_(sig->pin(idx), sig->get_ival(idx)); } } @@ -3043,6 +3046,9 @@ extern const struct target tgt_vvm = { }; /* * $Log: t-vvm.cc,v $ + * Revision 1.153 2000/05/25 06:02:12 steve + * Emin init code only once per nexus. + * * Revision 1.152 2000/05/25 01:45:35 steve * Optimize assignment from signals. *