Detemplatize the vvm_signal_t class.
This commit is contained in:
parent
e71413123e
commit
3adaf23aab
9
t-vvm.cc
9
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.114 2000/03/17 19:23:59 steve Exp $"
|
||||
#ident "$Id: t-vvm.cc,v 1.115 2000/03/17 20:21:14 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include <iostream>
|
||||
|
|
@ -817,8 +817,8 @@ void target_vvm::signal(ostream&os, const NetNet*sig)
|
|||
os << "static vvm_bitset_t<" << sig->pin_count() << "> " <<
|
||||
net_name<< "_bits; /* " << sig->name() <<
|
||||
" */" << endl;
|
||||
os << "static vvm_signal_t<" << sig->pin_count() << "> " <<
|
||||
net_name << "(&" << net_name << "_bits);" << endl;
|
||||
os << "static vvm_signal_t " << net_name << "(" << net_name <<
|
||||
"_bits.bits, " << sig->pin_count() << ");" << endl;
|
||||
|
||||
init_code << " vpip_make_reg(&" << net_name <<
|
||||
", \"" << sig->name() << "\");" << endl;
|
||||
|
|
@ -2245,6 +2245,9 @@ extern const struct target tgt_vvm = {
|
|||
};
|
||||
/*
|
||||
* $Log: t-vvm.cc,v $
|
||||
* Revision 1.115 2000/03/17 20:21:14 steve
|
||||
* Detemplatize the vvm_signal_t class.
|
||||
*
|
||||
* Revision 1.114 2000/03/17 19:23:59 steve
|
||||
* nor2 and and2 optimized gates.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,11 +17,33 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: vvm_signal.cc,v 1.1 2000/03/16 19:03:04 steve Exp $"
|
||||
#ident "$Id: vvm_signal.cc,v 1.2 2000/03/17 20:21:14 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvm_signal.h"
|
||||
|
||||
vvm_signal_t::vvm_signal_t(vpip_bit_t*b, unsigned nb)
|
||||
{
|
||||
bits = b;
|
||||
nbits = nb;
|
||||
}
|
||||
|
||||
vvm_signal_t::~vvm_signal_t()
|
||||
{
|
||||
}
|
||||
|
||||
void vvm_signal_t::init_P(unsigned idx, vpip_bit_t val)
|
||||
{
|
||||
assert(idx < nbits);
|
||||
bits[idx] = val;
|
||||
}
|
||||
|
||||
void vvm_signal_t::take_value(unsigned key, vpip_bit_t val)
|
||||
{
|
||||
bits[key] = val;
|
||||
vpip_run_value_changes(this);
|
||||
}
|
||||
|
||||
vvm_ram_callback::vvm_ram_callback()
|
||||
{
|
||||
}
|
||||
|
|
@ -32,6 +54,9 @@ vvm_ram_callback::~vvm_ram_callback()
|
|||
|
||||
/*
|
||||
* $Log: vvm_signal.cc,v $
|
||||
* Revision 1.2 2000/03/17 20:21:14 steve
|
||||
* Detemplatize the vvm_signal_t class.
|
||||
*
|
||||
* Revision 1.1 2000/03/16 19:03:04 steve
|
||||
* Revise the VVM backend to use nexus objects so that
|
||||
* drivers and resolution functions can be used, and
|
||||
|
|
|
|||
|
|
@ -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.1 2000/03/16 19:03:04 steve Exp $"
|
||||
#ident "$Id: vvm_signal.h,v 1.2 2000/03/17 20:21:14 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvm.h"
|
||||
|
|
@ -68,27 +68,19 @@ template <unsigned WIDTH> class vvm_bitset_t : public vvm_bits_t {
|
|||
/*
|
||||
* The vvm_signal_t template is the real object that handles the
|
||||
* receiving of assignments and doing whatever is done. It also
|
||||
* connects VPI to the C++/vvm design.
|
||||
* connects VPI to the C++/vvm design. The vvm_bitset_t stores the
|
||||
* actual bits, this just attaches the name and vpiSignal stuff to the
|
||||
* set.
|
||||
*/
|
||||
template <unsigned WIDTH>
|
||||
class vvm_signal_t : public __vpiSignal, public vvm_nexus::recvr_t {
|
||||
|
||||
public:
|
||||
vvm_signal_t(vvm_bitset_t<WIDTH>*b)
|
||||
{ bits = b->bits;
|
||||
nbits = WIDTH;
|
||||
}
|
||||
~vvm_signal_t() { }
|
||||
vvm_signal_t(vpip_bit_t*b, unsigned nb);
|
||||
~vvm_signal_t();
|
||||
|
||||
void init_P(unsigned idx, vpip_bit_t val)
|
||||
{ bits[idx] = val; }
|
||||
void init_P(unsigned idx, vpip_bit_t val);
|
||||
|
||||
void set_P(unsigned idx, vpip_bit_t val)
|
||||
{ bits[idx] = val;
|
||||
vpip_run_value_changes(this);
|
||||
}
|
||||
|
||||
void take_value(unsigned key, vpip_bit_t val) { set_P(key, val); }
|
||||
void take_value(unsigned key, vpip_bit_t val);
|
||||
};
|
||||
|
||||
struct vvm_ram_callback {
|
||||
|
|
@ -163,6 +155,9 @@ class vvm_memory_t : public __vpiMemory {
|
|||
|
||||
/*
|
||||
* $Log: vvm_signal.h,v $
|
||||
* Revision 1.2 2000/03/17 20:21:14 steve
|
||||
* Detemplatize the vvm_signal_t class.
|
||||
*
|
||||
* Revision 1.1 2000/03/16 19:03:04 steve
|
||||
* Revise the VVM backend to use nexus objects so that
|
||||
* drivers and resolution functions can be used, and
|
||||
|
|
|
|||
Loading…
Reference in New Issue