Skip to content
This repository
Browse code

Add vpi numbers to the bits table.

  • Loading branch information...
commit 092b1bded598df97d35777ef58e78b63b2b317a9 1 parent b93415e
steve authored

Showing 1 changed file with 9 additions and 54 deletions. Show diff stats Hide diff stats

  1. +9 54 t-vvm.cc
63 t-vvm.cc
@@ -17,7 +17,7 @@
17 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 18 */
19 19 #if !defined(WINNT) && !defined(macintosh)
20   -#ident "$Id: t-vvm.cc,v 1.150 2000/05/20 02:26:23 steve Exp $"
  20 +#ident "$Id: t-vvm.cc,v 1.151 2000/05/20 02:48:51 steve Exp $"
21 21 #endif
22 22
23 23 # include <iostream>
@@ -421,31 +421,6 @@ void vvm_proc_rval::expr_const(const NetEConst*expr)
421 421 os_ << " vvm_bitset_t " << tname << "(bits_table+"
422 422 << number_off << ", " << expr->expr_width() << ");" << endl;
423 423
424   -#if 0
425   - os_ << " vpip_bit_t " << tname<<"_bits["
426   - << expr->expr_width() << "];" << endl;
427   - for (unsigned idx = 0 ; idx < expr->expr_width() ; idx += 1) {
428   - os_ << " " << tname << "_bits["<<idx<<"] = ";
429   - switch (expr->value().get(idx)) {
430   - case verinum::V0:
431   - os_ << "St0";
432   - break;
433   - case verinum::V1:
434   - os_ << "St1";
435   - break;
436   - case verinum::Vx:
437   - os_ << "StX";
438   - break;
439   - case verinum::Vz:
440   - os_ << "HiZ";
441   - break;
442   - }
443   - os_ << ";" << endl;
444   - }
445   -
446   - os_ << " vvm_bitset_t " << tname << "(" << tname
447   - << "_bits, " << expr->expr_width() << ");" << endl;
448   -#endif
449 424 result = tname;
450 425 }
451 426
@@ -836,30 +811,11 @@ void vvm_parm_rval::expr_const(const NetEConst*expr)
836 811 if (res == 0) {
837 812 res = tgt_->number_counter ++;
838 813 unsigned width = expr->expr_width();
839   - tgt_->init_code << " { vpip_bit_t*bits = new vpip_bit_t["
840   - << width << "];" << endl;
841   -
842   - for (unsigned idx = 0 ; idx < width ; idx += 1) {
843   - tgt_->init_code << " bits[" << idx << "] = ";
844   - switch(expr->value().get(idx)) {
845   - case verinum::V0:
846   - tgt_->init_code << "St0;" << endl;
847   - break;
848   - case verinum::V1:
849   - tgt_->init_code << "St1;" << endl;
850   - break;
851   - case verinum::Vx:
852   - tgt_->init_code << "StX;" << endl;
853   - break;
854   - case verinum::Vz:
855   - tgt_->init_code << "HiZ;" << endl;
856   - break;
857   - }
858   - }
859   - tgt_->init_code << " vpip_make_number_const("
860   - "&number_table[" << res << "], bits, " << width <<
861   - ");" << endl;
862   - tgt_->init_code << " }" << endl;
  814 + unsigned bit_idx = tgt_->bits_table.position(expr->value());
  815 + tgt_->init_code << " vpip_make_number_const("
  816 + << "&number_table[" << res << "], "
  817 + << "bits_table+" << bit_idx << ", "
  818 + << width << ");" << endl;
863 819 }
864 820
865 821 ostrstream tmp;
@@ -2042,10 +1998,6 @@ void target_vvm::net_const(ostream&os, const NetConst*gate)
2042 1998 << val_str << ");" << endl;
2043 1999 }
2044 2000
2045   -#if 0
2046   - for (unsigned idx = 0 ; idx < gate->pin_count() ; idx += 1)
2047   - emit_init_value_(gate->pin(idx), gate->value(idx));
2048   -#endif
2049 2001 }
2050 2002
2051 2003
@@ -3063,6 +3015,9 @@ extern const struct target tgt_vvm = {
3063 3015 };
3064 3016 /*
3065 3017 * $Log: t-vvm.cc,v $
  3018 + * Revision 1.151 2000/05/20 02:48:51 steve
  3019 + * Add vpi numbers to the bits table.
  3020 + *
3066 3021 * Revision 1.150 2000/05/20 02:26:23 steve
3067 3022 * Combine constants into a bit table.
3068 3023 *

0 comments on commit 092b1bd

Please sign in to comment.
Something went wrong with that request. Please try again.