From dab5999621a91982f9a7257b9f3467a9e72d5012 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 26 Apr 2000 18:35:11 +0000 Subject: [PATCH] Handle assigning small values to big registers. --- t-vvm.cc | 18 ++++++++++++++++-- vvm/vvm_signal.cc | 17 ++++++++++++++++- vvm/vvm_signal.h | 11 +++++++---- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/t-vvm.cc b/t-vvm.cc index 9b5eb16c9..a9a72d4b2 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.139 2000/04/23 03:45:24 steve Exp $" +#ident "$Id: t-vvm.cc,v 1.140 2000/04/26 18:35:11 steve Exp $" #endif # include @@ -1885,12 +1885,23 @@ void target_vvm::proc_assign(ostream&os, const NetAssign*net) defn << " }" << endl; } else { - for (unsigned idx = 0 ; idx < net->pin_count() ; idx += 1) { + unsigned min_count = net->pin_count(); + if (net->rval()->expr_width() < min_count) + min_count = net->rval()->expr_width(); + + for (unsigned idx = 0 ; idx < min_count ; idx += 1) { string nexus = nexus_from_link(&net->pin(idx)); unsigned ncode = nexus_wire_map[nexus]; defn << " nexus_wire_table["<pin_count(); idx += 1) { + string nexus = nexus_from_link(&net->pin(idx)); + unsigned ncode = nexus_wire_map[nexus]; + defn << " nexus_wire_table["<