Handle assigning small values to big registers.

This commit is contained in:
steve 2000-04-26 18:35:11 +00:00
parent 906c7b4783
commit dab5999621
3 changed files with 39 additions and 7 deletions

View File

@ -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 <iostream>
@ -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["<<ncode<<"].reg_assign("
<< rval << "[" << idx << "]);" << endl;
}
for (unsigned idx = min_count; idx < net->pin_count(); idx += 1) {
string nexus = nexus_from_link(&net->pin(idx));
unsigned ncode = nexus_wire_map[nexus];
defn << " nexus_wire_table["<<ncode<<"]"
<< ".reg_assign(St0);" << endl;
}
}
}
@ -2676,6 +2687,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
* Revision 1.140 2000/04/26 18:35:11 steve
* Handle assigning small values to big registers.
*
* Revision 1.139 2000/04/23 03:45:24 steve
* Add support for the procedural release statement.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vvm_signal.cc,v 1.4 2000/03/26 16:55:41 steve Exp $"
#ident "$Id: vvm_signal.cc,v 1.5 2000/04/26 18:35:12 steve Exp $"
#endif
# include "vvm_signal.h"
@ -27,6 +27,18 @@ vvm_bitset_t::~vvm_bitset_t()
{
}
vpip_bit_t&vvm_bitset_t::operator[] (unsigned idx)
{
assert(idx < nbits);
return bits[idx];
}
vpip_bit_t vvm_bitset_t::get_bit(unsigned idx) const
{
assert(idx < nbits);
return bits[idx];
}
unsigned vvm_bitset_t::as_unsigned() const
{
unsigned result = 0;
@ -82,6 +94,9 @@ vvm_ram_callback::~vvm_ram_callback()
/*
* $Log: vvm_signal.cc,v $
* Revision 1.5 2000/04/26 18:35:12 steve
* Handle assigning small values to big registers.
*
* Revision 1.4 2000/03/26 16:55:41 steve
* Remove the vvm_bits_t abstract class.
*

View File

@ -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.8 2000/03/26 16:55:41 steve Exp $"
#ident "$Id: vvm_signal.h,v 1.9 2000/04/26 18:35:12 steve Exp $"
#endif
# include "vvm.h"
@ -42,11 +42,11 @@ class vvm_bitset_t {
~vvm_bitset_t();
vpip_bit_t operator[] (unsigned idx) const { return bits[idx]; }
vpip_bit_t&operator[] (unsigned idx) { return bits[idx]; }
vpip_bit_t operator[] (unsigned idx) const { return get_bit(idx); }
vpip_bit_t&operator[] (unsigned idx);
unsigned get_width() const { return nbits; }
vpip_bit_t get_bit(unsigned idx) const { return bits[idx]; }
vpip_bit_t get_bit(unsigned idx) const;
unsigned as_unsigned() const;
@ -154,6 +154,9 @@ class vvm_memory_t : public __vpiMemory {
/*
* $Log: vvm_signal.h,v $
* Revision 1.9 2000/04/26 18:35:12 steve
* Handle assigning small values to big registers.
*
* Revision 1.8 2000/03/26 16:55:41 steve
* Remove the vvm_bits_t abstract class.
*