diff --git a/t-vvm.cc b/t-vvm.cc index f7faf2076..69f917092 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.123 2000/03/24 03:47:01 steve Exp $" +#ident "$Id: t-vvm.cc,v 1.124 2000/03/25 02:43:56 steve Exp $" #endif # include @@ -258,12 +258,21 @@ void vvm_proc_rval::expr_ident(const NetEIdent*expr) result = mangle(expr->name()); } +/* + * a bitset rval that is a memory reference. + */ void vvm_proc_rval::expr_memory(const NetEMemory*mem) { + const string tname = make_temp(); + os_ << setw(indent_) << "" << "vvm_bitset_t<" + << mem->expr_width() << "> " << tname << ";" << endl; + const string mname = mangle(mem->name()); assert(mem->index()); mem->index()->expr_scan(this); - result = mname + ".get_word(" + result + ".as_unsigned())"; + os_ << setw(indent_) << "" << mname << ".get_word(" << + result<<".as_unsigned(), " << tname << ");"; + result = tname; } void vvm_proc_rval::expr_signal(const NetESignal*expr) @@ -329,8 +338,13 @@ void vvm_proc_rval::expr_ufunc(const NetEUFunc*expr) the parameter port register. */ for (unsigned idx = 0 ; idx < pcnt ; idx += 1) { expr->parm(idx)->expr_scan(this); - os_ << " " << mangle(def->port(idx+1)->name()) << - "_bits = " << result << ";" << endl; + string bname = mangle(def->port(idx+1)->name()); + for (unsigned bit = 0 ; + bit < expr->parm(idx)->expr_width() ; bit += 1) { + + os_ << " " << bname << "_bits["<result()->name()) + "_bits"; - os_ << " vvm_bitset_t<" << expr->expr_width() << "> " << - result << " = " << rbits << ";" << endl; + os_ << " vvm_bitset_t<" << expr->expr_width() << "> " << + result << ";" << endl; + + for (unsigned idx = 0 ; idx < expr->expr_width() ; idx += 1) { + os_ << " " << result<<"["<op()) { case '~': - os_ << "vvm_unop_not(" << tname << "," << result << ");" << endl; + os_ << " vvm_unop_not(" << tname << "," << result << + ");" << endl; break; case '&': os_ << " " << tname << "[0] " @@ -410,19 +430,19 @@ void vvm_proc_rval::expr_binary(const NetEBinary*expr) expr->expr_width() << ">" << result << ";" << endl; switch (expr->op()) { case 'a': // logical and (&&) - os_ << setw(indent_) << "" << result << " = vvm_binop_land(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_land(" << lres << "," << rres << ");" << endl; break; case 'E': // === - os_ << setw(indent_) << "" << result << " = vvm_binop_eeq(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_eeq(" << lres << "," << rres << ");" << endl; break; case 'e': // == - os_ << setw(indent_) << "" << result << " = vvm_binop_eq(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_eq(" << lres << "," << rres << ");" << endl; break; case 'G': // >= - os_ << setw(indent_) << "" << result << " = vvm_binop_ge(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_ge(" << lres << "," << rres << ");" << endl; break; case 'l': // left shift(<<) @@ -430,27 +450,27 @@ void vvm_proc_rval::expr_binary(const NetEBinary*expr) << ", " << lres << "," << rres << ");" << endl; break; case 'L': // <= - os_ << setw(indent_) << "" << result << " = vvm_binop_le(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_le(" << lres << "," << rres << ");" << endl; break; case 'N': // !== - os_ << setw(indent_) << "" << result << " = vvm_binop_nee(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_nee(" << lres << "," << rres << ");" << endl; break; case 'n': - os_ << setw(indent_) << "" << result << " = vvm_binop_ne(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_ne(" << lres << "," << rres << ");" << endl; break; case '<': - os_ << setw(indent_) << "" << result << " = vvm_binop_lt(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_lt(" << lres << "," << rres << ");" << endl; break; case '>': - os_ << setw(indent_) << "" << result << " = vvm_binop_gt(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_gt(" << lres << "," << rres << ");" << endl; break; case 'o': // logical or (||) - os_ << setw(indent_) << "" << result << " = vvm_binop_lor(" + os_ << setw(indent_) << "" << result << "[0] = vvm_binop_lor(" << lres << "," << rres << ");" << endl; break; case 'r': // right shift(>>) @@ -1897,7 +1917,7 @@ void target_vvm::proc_case(ostream&os, const NetCase*net) string guard = emit_proc_rval(defn, 8, net->expr(idx)); defn << " if (B_IS1(" << test_func << "(" << guard << "," - << expr << ")[0])) {" << endl; + << expr << "))) {" << endl; defn << " step_ = &" << thread_class_ << "::step_" << thread_step_ << "_;" << endl; defn << " return true;" << endl; @@ -2009,7 +2029,7 @@ void target_vvm::proc_case_fun(ostream&os, const NetCase*net) string guard = emit_proc_rval(defn, 6, net->expr(idx)); defn << " if (B_IS1(" << test_func << "(" << - guard << "," << expr << ")[0])) {" << endl; + guard << "," << expr << "))) {" << endl; if (net->stat(idx)) net->stat(idx)->emit_proc(os, this); defn << " break; }" << endl; @@ -2275,7 +2295,7 @@ void target_vvm::proc_event(ostream&os, const NetPEvent*proc) /* POSITIVE is for the wait construct, and needs to be handled specially. The structure of the generated code is: - if (event.get()==V1) { + if (event.get(0)==V1) { return true; } else { event.wait(this); @@ -2295,7 +2315,7 @@ void target_vvm::proc_event(ostream&os, const NetPEvent*proc) svector*list = proc->back_list(); if ((list->count()==1) && ((*list)[0]->type() == NetNEvent::POSITIVE)) { defn << " if (B_IS1(" << mangle((*list)[0]->name()) << - ".get()[0])) {" << endl; + ".get(0))) {" << endl; defn << " return true;" << endl; defn << " } else {" << endl; defn << " " << mangle(proc->name()) << @@ -2367,6 +2387,10 @@ extern const struct target tgt_vvm = { }; /* * $Log: t-vvm.cc,v $ + * Revision 1.124 2000/03/25 02:43:56 steve + * Remove all remain vvm_bitset_t return values, + * and disallow vvm_bitset_t copying. + * * Revision 1.123 2000/03/24 03:47:01 steve * Update vvm_ram_dq to nexus style. * diff --git a/vvm/vvm_func.cc b/vvm/vvm_func.cc index d7fc9975d..f596828ea 100644 --- a/vvm/vvm_func.cc +++ b/vvm/vvm_func.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vvm_func.cc,v 1.3 2000/03/24 02:43:37 steve Exp $" +#ident "$Id: vvm_func.cc,v 1.4 2000/03/25 02:43:56 steve Exp $" #endif # include "vvm_func.h" @@ -77,27 +77,22 @@ vpip_bit_t vvm_unop_xnor(const vvm_bits_t&r) return B_NOT(v); } -vvm_bitset_t<1> vvm_binop_eq(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_eq(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result; - result[0] = St1; const unsigned lwid = l.get_width(); const unsigned rwid = r.get_width(); if (lwid <= rwid) { for (unsigned idx = 0 ; idx < lwid ; idx += 1) { - if (B_ISXZ(l.get_bit(idx))) { - result[0] = StX; - return result; - } - if (B_ISXZ(r.get_bit(idx))) { - result[0] = StX; - return result; - } - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (B_ISXZ(l.get_bit(idx))) + return StX; + + if (B_ISXZ(r.get_bit(idx))) + return StX; + + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; + } for (unsigned idx = lwid ; idx < rwid ; idx += 1) { @@ -105,106 +100,83 @@ vvm_bitset_t<1> vvm_binop_eq(const vvm_bits_t&l, const vvm_bits_t&r) if (B_IS0(r.get_bit(idx))) continue; - if (B_IS1(r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (B_IS1(r.get_bit(idx))) + return St0; - result[0] = StX; - return result; + return StX; } - return result; + return St1; } else { for (unsigned idx = 0 ; idx < rwid ; idx += 1) { - if (B_ISXZ(l.get_bit(idx))) { - result[0] = StX; - return result; - } - if (B_ISXZ(r.get_bit(idx))) { - result[0] = StX; - return result; - } - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (B_ISXZ(l.get_bit(idx))) + return StX; + + if (B_ISXZ(r.get_bit(idx))) + return StX; + + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; + } for (unsigned idx = rwid ; idx < lwid ; idx += 1) { if (B_IS0(l.get_bit(idx))) continue; - if (B_IS1(l.get_bit(idx))) { - result[0] = St0; - return result; - } + if (B_IS1(l.get_bit(idx))) + return St0; - result[0] = StX; - return result; + return StX; } - return result; + return St1; } } -vvm_bitset_t<1> vvm_binop_ne(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_ne(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result = vvm_binop_eq(l,r); - result[0] = B_NOT(result[0]); - return result; + vpip_bit_t result = vvm_binop_eq(l,r); + return B_NOT(result); } -vvm_bitset_t<1> vvm_binop_eeq(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_eeq(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result; - result[0] = St1; const unsigned lwid = l.get_width(); const unsigned rwid = r.get_width(); if (lwid <= rwid) { for (unsigned idx = 0 ; idx < lwid ; idx += 1) - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; for (unsigned idx = lwid ; idx < rwid ; idx += 1) - if (! B_IS0(r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_IS0(r.get_bit(idx))) + return St0; } else { for (unsigned idx = 0 ; idx < rwid ; idx += 1) - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; for (unsigned idx = rwid ; idx < lwid ; idx += 1) - if (! B_IS0(l.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_IS0(l.get_bit(idx))) + return St0; } - return result; + return St1; } -vvm_bitset_t<1> vvm_binop_nee(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_nee(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result = vvm_binop_eeq(l,r); - result[0] = B_NOT(result[0]); - return result; + vpip_bit_t result = vvm_binop_eeq(l,r); + return B_NOT(result); } -vvm_bitset_t<1> vvm_binop_xeq(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_xeq(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result; - result[0] = St1; const unsigned lwid = l.get_width(); const unsigned rwid = r.get_width(); @@ -214,18 +186,15 @@ vvm_bitset_t<1> vvm_binop_xeq(const vvm_bits_t&l, const vvm_bits_t&r) continue; if (B_ISXZ(r.get_bit(idx))) continue; - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; } + for (unsigned idx = lwid ; idx < rwid ; idx += 1) { if (B_ISXZ(r.get_bit(idx))) continue; - if (! B_IS0(r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_IS0(r.get_bit(idx))) + return St0; } } else { @@ -234,28 +203,23 @@ vvm_bitset_t<1> vvm_binop_xeq(const vvm_bits_t&l, const vvm_bits_t&r) continue; if (B_ISXZ(r.get_bit(idx))) continue; - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; + } for (unsigned idx = rwid ; idx < lwid ; idx += 1) { if (B_ISXZ(l.get_bit(idx))) continue; - if (! B_IS0(l.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_IS0(l.get_bit(idx))) + return St0; } } - return result; + return St1; } -vvm_bitset_t<1> vvm_binop_zeq(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_zeq(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result; - result[0] = St1; const unsigned lwid = l.get_width(); const unsigned rwid = r.get_width(); @@ -263,180 +227,149 @@ vvm_bitset_t<1> vvm_binop_zeq(const vvm_bits_t&l, const vvm_bits_t&r) for (unsigned idx = 0 ; idx < lwid ; idx += 1) { if (B_ISZ(l.get_bit(idx)) || B_ISZ(r.get_bit(idx))) continue; - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; } + for (unsigned idx = lwid ; idx < rwid ; idx += 1) { if (B_ISZ(r.get_bit(idx))) continue; - if (! B_IS0(r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_IS0(r.get_bit(idx))) + return St0; + } } else { for (unsigned idx = 0 ; idx < rwid ; idx += 1) { if (B_ISZ(l.get_bit(idx)) || B_ISZ(r.get_bit(idx))) continue; - if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_EQ(l.get_bit(idx), r.get_bit(idx))) + return St0; } + for (unsigned idx = rwid ; idx < lwid ; idx += 1) { if (B_ISZ(l.get_bit(idx))) continue; - if (! B_IS0(l.get_bit(idx))) { - result[0] = St0; - return result; - } + if (! B_IS0(l.get_bit(idx))) + return St0; } } - return result; + return St1; } -vvm_bitset_t<1> vvm_binop_lt(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_lt(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result; - result[0] = St0; + vpip_bit_t result; + result = St0; const unsigned lwid = l.get_width(); const unsigned rwid = r.get_width(); const unsigned common = (lwid < rwid)? lwid : rwid; for (unsigned idx = 0 ; idx < common ; idx += 1) - result[0] = less_with_cascade(l.get_bit(idx), + result = less_with_cascade(l.get_bit(idx), r.get_bit(idx), result); + + if (lwid > rwid) { + for (unsigned idx = rwid ; idx < lwid ; idx += 1) + result = less_with_cascade(l.get_bit(idx), St0, result); + } else { + for (unsigned idx = lwid ; idx < rwid ; idx += 1) + result = less_with_cascade(St0, r.get_bit(idx), result); + } + + return result; +} + +vpip_bit_t vvm_binop_le(const vvm_bits_t&l, const vvm_bits_t&r) +{ + vpip_bit_t result = St1; + const unsigned lwid = l.get_width(); + const unsigned rwid = r.get_width(); + const unsigned common = (lwid < rwid)? lwid : rwid; + + for (unsigned idx = 0 ; idx < common ; idx += 1) + result = less_with_cascade(l.get_bit(idx), r.get_bit(idx), result); + + if (lwid > rwid) { + for (unsigned idx = rwid ; idx < lwid ; idx += 1) + result = less_with_cascade(l.get_bit(idx), St0, result); + } else { + for (unsigned idx = lwid ; idx < rwid ; idx += 1) + result = less_with_cascade(St0, r.get_bit(idx), result); + } + + return result; +} + +vpip_bit_t vvm_binop_gt(const vvm_bits_t&l, const vvm_bits_t&r) +{ + vpip_bit_t result = St0; + + const unsigned lwid = l.get_width(); + const unsigned rwid = r.get_width(); + const unsigned common = (lwid < rwid)? lwid : rwid; + + for (unsigned idx = 0 ; idx < common ; idx += 1) + result = greater_with_cascade(l.get_bit(idx), r.get_bit(idx), - result[0]); + result); if (lwid > rwid) { for (unsigned idx = rwid ; idx < lwid ; idx += 1) - result[0] = less_with_cascade(l.get_bit(idx), - St0, - result[0]); + result = greater_with_cascade(l.get_bit(idx), St0, result); } else { for (unsigned idx = lwid ; idx < rwid ; idx += 1) - result[0] = less_with_cascade(St0, - r.get_bit(idx), - result[0]); + result = greater_with_cascade(St0, r.get_bit(idx), result); } return result; } -vvm_bitset_t<1> vvm_binop_le(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_ge(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result; - result[0] = St1; - const unsigned lwid = l.get_width(); - const unsigned rwid = r.get_width(); - const unsigned common = (lwid < rwid)? lwid : rwid; - - for (unsigned idx = 0 ; idx < common ; idx += 1) - result[0] = less_with_cascade(l.get_bit(idx), - r.get_bit(idx), - result[0]); - - if (lwid > rwid) { - for (unsigned idx = rwid ; idx < lwid ; idx += 1) - result[0] = less_with_cascade(l.get_bit(idx), - St0, - result[0]); - } else { - for (unsigned idx = lwid ; idx < rwid ; idx += 1) - result[0] = less_with_cascade(St0, - r.get_bit(idx), - result[0]); - } - - return result; -} - -vvm_bitset_t<1> vvm_binop_gt(const vvm_bits_t&l, const vvm_bits_t&r) -{ - vvm_bitset_t<1> result; - result[0] = St0; + vpip_bit_t result = St1; const unsigned lwid = l.get_width(); const unsigned rwid = r.get_width(); const unsigned common = (lwid < rwid)? lwid : rwid; for (unsigned idx = 0 ; idx < common ; idx += 1) - result[0] = greater_with_cascade(l.get_bit(idx), - r.get_bit(idx), - result[0]); + result = greater_with_cascade(l.get_bit(idx), + r.get_bit(idx), result); if (lwid > rwid) { for (unsigned idx = rwid ; idx < lwid ; idx += 1) - result[0] = greater_with_cascade(l.get_bit(idx), - St0, - result[0]); + result = greater_with_cascade(l.get_bit(idx), St0, result); } else { for (unsigned idx = lwid ; idx < rwid ; idx += 1) - result[0] = greater_with_cascade(St0, - r.get_bit(idx), - result[0]); + result = greater_with_cascade(St0, r.get_bit(idx), result); } return result; } -vvm_bitset_t<1> vvm_binop_ge(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_land(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> result; - result[0] = St1; - - const unsigned lwid = l.get_width(); - const unsigned rwid = r.get_width(); - const unsigned common = (lwid < rwid)? lwid : rwid; - - for (unsigned idx = 0 ; idx < common ; idx += 1) - result[0] = greater_with_cascade(l.get_bit(idx), - r.get_bit(idx), - result[0]); - - if (lwid > rwid) { - for (unsigned idx = rwid ; idx < lwid ; idx += 1) - result[0] = greater_with_cascade(l.get_bit(idx), - St0, - result[0]); - } else { - for (unsigned idx = lwid ; idx < rwid ; idx += 1) - result[0] = greater_with_cascade(St0, - r.get_bit(idx), - result[0]); - } - - return result; + vpip_bit_t res1 = vvm_unop_or(l); + vpip_bit_t res2 = vvm_unop_or(r); + return B_AND(res1, res2); } -vvm_bitset_t<1> vvm_binop_land(const vvm_bits_t&l, const vvm_bits_t&r) +vpip_bit_t vvm_binop_lor(const vvm_bits_t&l, const vvm_bits_t&r) { - vvm_bitset_t<1> res1; - res1[0] = vvm_unop_or(l); - vvm_bitset_t<1> res2; - res2[0] = vvm_unop_or(r); - res1[0] = B_AND(res1[0], res2[0]); - return res1; -} - -vvm_bitset_t<1> vvm_binop_lor(const vvm_bits_t&l, const vvm_bits_t&r) -{ - vvm_bitset_t<1> res1; - res1[0] = vvm_unop_or(l); - vvm_bitset_t<1> res2; - res2[0] = vvm_unop_or(r); - res1[0] = B_OR(res1[0], res2[0]); - return res1; + vpip_bit_t res1 = vvm_unop_or(l); + vpip_bit_t res2 = vvm_unop_or(r); + return B_OR(res1, res2); } /* * $Log: vvm_func.cc,v $ + * Revision 1.4 2000/03/25 02:43:56 steve + * Remove all remain vvm_bitset_t return values, + * and disallow vvm_bitset_t copying. + * * Revision 1.3 2000/03/24 02:43:37 steve * vvm_unop and vvm_binop pass result by reference * instead of returning a value. diff --git a/vvm/vvm_func.h b/vvm/vvm_func.h index 40b460329..b448e5436 100644 --- a/vvm/vvm_func.h +++ b/vvm/vvm_func.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vvm_func.h,v 1.24 2000/03/24 02:43:37 steve Exp $" +#ident "$Id: vvm_func.h,v 1.25 2000/03/25 02:43:57 steve Exp $" #endif # include "vvm.h" @@ -212,45 +212,45 @@ void vvm_binop_shiftr(vvm_bitset_t&v, * extended with zeros. Also, if there is Vx or Vz anywhere in either * vectors, the result is Vx. */ -extern vvm_bitset_t<1> vvm_binop_eq(const vvm_bits_t&l, const vvm_bits_t&r); -extern vvm_bitset_t<1> vvm_binop_ne(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_eq(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_ne(const vvm_bits_t&l, const vvm_bits_t&r); /* * This function return true if all the bits are the same. Even x and * z bites are compared for equality. */ -extern vvm_bitset_t<1> vvm_binop_eeq(const vvm_bits_t&l, const vvm_bits_t&r); -extern vvm_bitset_t<1> vvm_binop_nee(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_eeq(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_nee(const vvm_bits_t&l, const vvm_bits_t&r); /* * This function return true if all the bits are the same. The x and z * bits are don't care, s don't make the result false. */ -extern vvm_bitset_t<1> vvm_binop_xeq(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_xeq(const vvm_bits_t&l, const vvm_bits_t&r); /* * This function return true if all the bits are the same. The z * bits are don't care, so don't make the result false. */ -extern vvm_bitset_t<1> vvm_binop_zeq(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_zeq(const vvm_bits_t&l, const vvm_bits_t&r); -extern vvm_bitset_t<1> vvm_binop_lt(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_lt(const vvm_bits_t&l, const vvm_bits_t&r); /* * The <= operator takes operands of natural width and returns a * single bit. The result is V1 if l <= r, otherwise V0; */ -extern vvm_bitset_t<1> vvm_binop_le(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_le(const vvm_bits_t&l, const vvm_bits_t&r); -extern vvm_bitset_t<1> vvm_binop_gt(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_gt(const vvm_bits_t&l, const vvm_bits_t&r); -extern vvm_bitset_t<1> vvm_binop_ge(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_ge(const vvm_bits_t&l, const vvm_bits_t&r); -extern vvm_bitset_t<1> vvm_binop_land(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_land(const vvm_bits_t&l, const vvm_bits_t&r); -extern vvm_bitset_t<1> vvm_binop_lor(const vvm_bits_t&l, const vvm_bits_t&r); +extern vpip_bit_t vvm_binop_lor(const vvm_bits_t&l, const vvm_bits_t&r); template void vvm_ternary(vvm_bitset_t&v, vpip_bit_t c, @@ -278,6 +278,10 @@ void vvm_ternary(vvm_bitset_t&v, vpip_bit_t c, /* * $Log: vvm_func.h,v $ + * Revision 1.25 2000/03/25 02:43:57 steve + * Remove all remain vvm_bitset_t return values, + * and disallow vvm_bitset_t copying. + * * Revision 1.24 2000/03/24 02:43:37 steve * vvm_unop and vvm_binop pass result by reference * instead of returning a value. diff --git a/vvm/vvm_gates.h b/vvm/vvm_gates.h index 93ec13868..e675b6be7 100644 --- a/vvm/vvm_gates.h +++ b/vvm/vvm_gates.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vvm_gates.h,v 1.50 2000/03/24 03:47:01 steve Exp $" +#ident "$Id: vvm_gates.h,v 1.51 2000/03/25 02:43:57 steve Exp $" #endif # include "vvm.h" @@ -488,7 +488,8 @@ class vvm_ram_dq : protected vvm_ram_callback, public vvm_nexus::recvr_t { } void send_out_() - { vvm_bitset_tov = mem_->get_word(addr_val_); + { vvm_bitset_tov; + mem_->get_word(addr_val_, ov); for (unsigned bit = 0 ; bit < WIDTH ; bit += 1) { vvm_out_event*ev = new vvm_out_event(ov[bit], out_+bit); ev->schedule(); @@ -754,7 +755,7 @@ template class vvm_pevent : public vvm_nexus::recvr_t { value_[idx] = HiZ; } - vvm_bitset_t get() const { return value_; } + vpip_bit_t get(unsigned idx) const { return value_[idx]; } void init_P(int idx, vpip_bit_t val) { assert(idx < WIDTH); @@ -794,6 +795,10 @@ template class vvm_pevent : public vvm_nexus::recvr_t { /* * $Log: vvm_gates.h,v $ + * Revision 1.51 2000/03/25 02:43:57 steve + * Remove all remain vvm_bitset_t return values, + * and disallow vvm_bitset_t copying. + * * Revision 1.50 2000/03/24 03:47:01 steve * Update vvm_ram_dq to nexus style. * diff --git a/vvm/vvm_signal.h b/vvm/vvm_signal.h index 60d63e114..0b030c678 100644 --- a/vvm/vvm_signal.h +++ b/vvm/vvm_signal.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vvm_signal.h,v 1.4 2000/03/24 02:43:37 steve Exp $" +#ident "$Id: vvm_signal.h,v 1.5 2000/03/25 02:43:57 steve Exp $" #endif # include "vvm.h" @@ -38,23 +38,6 @@ template class vvm_bitset_t : public vvm_bits_t { { for (unsigned idx = 0 ; idx < WIDTH ; idx += 1) bits[idx] = HiZ; } -#if 0 - vvm_bitset_t(const vvm_bits_t&that) - { unsigned wid = WIDTH; - if (that.get_width() < WIDTH) - wid = that.get_width(); - for (unsigned idx = 0 ; idx < wid ; idx += 1) - bits[idx] = that.get_bit(idx); - for (unsigned idx = wid ; idx < WIDTH ; idx += 1) - bits[idx] = St0; - } -#endif -#if 0 - vvm_bitset_t(const vvm_bitset_t&that) - { for (unsigned idx = 0; idx < WIDTH; idx += 1) - bits[idx] = that.bits[idx]; - } -#endif vpip_bit_t operator[] (unsigned idx) const { return bits[idx]; } vpip_bit_t&operator[] (unsigned idx) { return bits[idx]; } @@ -64,6 +47,10 @@ template class vvm_bitset_t : public vvm_bits_t { public: vpip_bit_t bits[WIDTH]; + + private: // not implemented + vvm_bitset_t(const vvm_bitset_t&); + vvm_bitset_t& operator= (const vvm_bitset_t&); }; /* @@ -117,13 +104,11 @@ class vvm_memory_t : public __vpiMemory { call_list_(addr); } - vvm_bitset_t get_word(unsigned addr) const - { vvm_bitset_t val; - unsigned base = WIDTH * addr; + void get_word(unsigned addr, vvm_bitset_t&val) const + { unsigned base = WIDTH * addr; assert(addr < size); for (unsigned idx = 0 ; idx < WIDTH ; idx += 1) val[idx] = bits[base+idx]; - return val; } void set_callback(vvm_ram_callback*ram) @@ -135,7 +120,10 @@ class vvm_memory_t : public __vpiMemory { public: assign_nb(vvm_memory_t&m, unsigned i, const vvm_bitset_t&v) - : mem_(m), index_(i), val_(v) { } + : mem_(m), index_(i) + { for (unsigned idx = 0 ; idx < WIDTH ; idx += 1) + val_[idx] = v[idx]; + } void event_function() { mem_.set_word(index_, val_); } @@ -156,6 +144,10 @@ class vvm_memory_t : public __vpiMemory { /* * $Log: vvm_signal.h,v $ + * Revision 1.5 2000/03/25 02:43:57 steve + * Remove all remain vvm_bitset_t return values, + * and disallow vvm_bitset_t copying. + * * Revision 1.4 2000/03/24 02:43:37 steve * vvm_unop and vvm_binop pass result by reference * instead of returning a value.