Reduce vvp_vector4 copies by using const references.

This commit is contained in:
steve 2005-06-22 00:04:48 +00:00
parent 5513974b78
commit 7091915b73
25 changed files with 186 additions and 139 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: arith.cc,v 1.43 2005/03/19 06:23:49 steve Exp $"
#ident "$Id: arith.cc,v 1.44 2005/06/22 00:04:48 steve Exp $"
#endif
# include "arith.h"
@ -72,7 +72,7 @@ void vvp_arith_div::wide_(vvp_net_ptr_t ptr)
assert(0);
}
void vvp_arith_div::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_arith_div::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -143,7 +143,7 @@ void vvp_arith_mod::wide_(vvp_net_ptr_t ptr)
assert(0);
}
void vvp_arith_mod::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_arith_mod::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -236,7 +236,7 @@ void vvp_arith_mult::wide_(vvp_net_ptr_t ptr)
vvp_send_vec4(ptr.ptr()->out, res4);
}
void vvp_arith_mult::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_arith_mult::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -383,7 +383,7 @@ vvp_arith_sum::~vvp_arith_sum()
{
}
void vvp_arith_sum::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_arith_sum::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -427,7 +427,7 @@ vvp_arith_sub::~vvp_arith_sub()
* further reduce the operation to adding in the inverted value and
* adding a correction.
*/
void vvp_arith_sub::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_arith_sub::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -461,7 +461,7 @@ vvp_cmp_eeq::vvp_cmp_eeq(unsigned wid)
{
}
void vvp_cmp_eeq::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_cmp_eeq::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -485,7 +485,7 @@ vvp_cmp_nee::vvp_cmp_nee(unsigned wid)
{
}
void vvp_cmp_nee::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_cmp_nee::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -515,7 +515,7 @@ vvp_cmp_eq::vvp_cmp_eq(unsigned wid)
* there are X/Z bits anywhere in A or B, the result is X. Finally,
* the result is 1.
*/
void vvp_cmp_eq::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_cmp_eq::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -558,7 +558,7 @@ vvp_cmp_ne::vvp_cmp_ne(unsigned wid)
* there are X/Z bits anywhere in A or B, the result is X. Finally,
* the result is 0.
*/
void vvp_cmp_ne::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_cmp_ne::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -618,7 +618,7 @@ vvp_cmp_ge::vvp_cmp_ge(unsigned wid, bool flag)
{
}
void vvp_cmp_ge::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_cmp_ge::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
recv_vec4_base_(ptr, bit, BIT4_1);
}
@ -628,7 +628,7 @@ vvp_cmp_gt::vvp_cmp_gt(unsigned wid, bool flag)
{
}
void vvp_cmp_gt::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_cmp_gt::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
recv_vec4_base_(ptr, bit, BIT4_0);
}
@ -643,7 +643,7 @@ vvp_shiftl::~vvp_shiftl()
{
}
void vvp_shiftl::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_shiftl::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -676,7 +676,7 @@ vvp_shiftr::~vvp_shiftr()
{
}
void vvp_shiftr::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_shiftr::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
dispatch_operand_(ptr, bit);
@ -703,6 +703,9 @@ void vvp_shiftr::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
/*
* $Log: arith.cc,v $
* Revision 1.44 2005/06/22 00:04:48 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.43 2005/03/19 06:23:49 steve
* Handle LPM shifts.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: arith.h,v 1.30 2005/06/11 18:11:18 steve Exp $"
#ident "$Id: arith.h,v 1.31 2005/06/22 00:04:48 steve Exp $"
#endif
# include "vvp_net.h"
@ -57,7 +57,7 @@ class vvp_arith_div : public vvp_arith_ {
public:
explicit vvp_arith_div(unsigned wid, bool signed_flag);
~vvp_arith_div();
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
private:
void wide_(vvp_net_ptr_t ptr);
bool signed_flag_;
@ -68,7 +68,7 @@ class vvp_arith_mod : public vvp_arith_ {
public:
explicit vvp_arith_mod(unsigned wid, bool signed_flag);
~vvp_arith_mod();
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
private:
void wide_(vvp_net_ptr_t ptr);
bool signed_flag_;
@ -84,7 +84,7 @@ class vvp_cmp_eeq : public vvp_arith_ {
public:
explicit vvp_cmp_eeq(unsigned wid);
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
};
@ -92,7 +92,7 @@ class vvp_cmp_nee : public vvp_arith_ {
public:
explicit vvp_cmp_nee(unsigned wid);
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
};
@ -100,7 +100,7 @@ class vvp_cmp_eq : public vvp_arith_ {
public:
explicit vvp_cmp_eq(unsigned wid);
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
};
@ -108,7 +108,7 @@ class vvp_cmp_ne : public vvp_arith_ {
public:
explicit vvp_cmp_ne(unsigned wid);
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
};
@ -135,7 +135,7 @@ class vvp_cmp_ge : public vvp_cmp_gtge_base_ {
public:
explicit vvp_cmp_ge(unsigned wid, bool signed_flag);
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
};
@ -144,7 +144,7 @@ class vvp_cmp_gt : public vvp_cmp_gtge_base_ {
public:
explicit vvp_cmp_gt(unsigned wid, bool signed_flag);
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
};
/*
@ -157,7 +157,7 @@ class vvp_arith_mult : public vvp_arith_ {
public:
explicit vvp_arith_mult(unsigned wid);
~vvp_arith_mult();
void recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit);
private:
void wide_(vvp_net_ptr_t ptr);
};
@ -167,7 +167,7 @@ class vvp_arith_sub : public vvp_arith_ {
public:
explicit vvp_arith_sub(unsigned wid);
~vvp_arith_sub();
virtual void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
virtual void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
};
@ -176,7 +176,7 @@ class vvp_arith_sum : public vvp_arith_ {
public:
explicit vvp_arith_sum(unsigned wid);
~vvp_arith_sum();
virtual void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
virtual void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
};
@ -185,7 +185,7 @@ class vvp_shiftl : public vvp_arith_ {
public:
explicit vvp_shiftl(unsigned wid);
~vvp_shiftl();
virtual void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
virtual void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
};
class vvp_shiftr : public vvp_arith_ {
@ -193,11 +193,14 @@ class vvp_shiftr : public vvp_arith_ {
public:
explicit vvp_shiftr(unsigned wid);
~vvp_shiftr();
virtual void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
virtual void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
};
/*
* $Log: arith.h,v $
* Revision 1.31 2005/06/22 00:04:48 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.30 2005/06/11 18:11:18 steve
* Remove unneeded references to functor.h
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: bufif.cc,v 1.13 2005/06/02 16:02:11 steve Exp $"
#ident "$Id: bufif.cc,v 1.14 2005/06/22 00:04:48 steve Exp $"
#endif
# include "bufif.h"
@ -35,7 +35,7 @@ vvp_fun_bufif::vvp_fun_bufif(bool en_invert, bool out_invert,
count_functors_bufif += 1;
}
void vvp_fun_bufif::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_fun_bufif::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
switch (ptr.port()) {
case 0:
@ -87,6 +87,9 @@ void vvp_fun_bufif::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
/*
* $Log: bufif.cc,v $
* Revision 1.14 2005/06/22 00:04:48 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.13 2005/06/02 16:02:11 steve
* Add support for notif0/1 gates.
* Make delay nodes support inertial delay.

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: bufif.h,v 1.7 2005/02/07 22:42:42 steve Exp $"
#ident "$Id: bufif.h,v 1.8 2005/06/22 00:04:48 steve Exp $"
#endif
# include "vvp_net.h"
@ -40,7 +40,7 @@ class vvp_fun_bufif : public vvp_net_fun_t {
vvp_fun_bufif(bool en_invert, bool out_invert,
unsigned str0, unsigned str1);
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
vvp_vector4_t bit_;
@ -53,6 +53,9 @@ class vvp_fun_bufif : public vvp_net_fun_t {
/*
* $Log: bufif.h,v $
* Revision 1.8 2005/06/22 00:04:48 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.7 2005/02/07 22:42:42 steve
* Add .repeat functor and BIFIF functors.
*

View File

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ident "$Id: concat.cc,v 1.4 2005/06/17 03:46:52 steve Exp $"
#ident "$Id: concat.cc,v 1.5 2005/06/22 00:04:48 steve Exp $"
# include "compile.h"
# include "vvp_net.h"
@ -45,7 +45,7 @@ vvp_fun_concat::~vvp_fun_concat()
{
}
void vvp_fun_concat::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_concat::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
unsigned pdx = port.port();
@ -91,7 +91,7 @@ vvp_fun_repeat::~vvp_fun_repeat()
{
}
void vvp_fun_repeat::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_repeat::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
assert(bit.size() == wid_/rep_);
@ -124,6 +124,9 @@ void compile_repeat(char*label, long width, long repeat, struct symb_s arg)
/*
* $Log: concat.cc,v $
* Revision 1.5 2005/06/22 00:04:48 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.4 2005/06/17 03:46:52 steve
* Make functors know their own width.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: delay.cc,v 1.7 2005/06/09 05:04:45 steve Exp $"
#ident "$Id: delay.cc,v 1.8 2005/06/22 00:04:49 steve Exp $"
#endif
#include "delay.h"
@ -108,7 +108,7 @@ vvp_fun_delay::~vvp_fun_delay()
* account for different delays for different bits by generating a
* stream of vectors that lead up to the actual value.
*/
void vvp_fun_delay::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_delay::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
if (cur_.eeq(bit))
return;
@ -130,6 +130,9 @@ void vvp_fun_delay::run_run()
/*
* $Log: delay.cc,v $
* Revision 1.8 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.7 2005/06/09 05:04:45 steve
* Support UDP initial values.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: delay.h,v 1.7 2005/06/02 16:02:11 steve Exp $"
#ident "$Id: delay.h,v 1.8 2005/06/22 00:04:49 steve Exp $"
#endif
/*
@ -62,7 +62,7 @@ class vvp_fun_delay : public vvp_net_fun_t, private vvp_gen_event_s {
vvp_fun_delay(vvp_net_t*net, vvp_bit4_t init, const vvp_delay_t&d);
~vvp_fun_delay();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
//void recv_long(vvp_net_ptr_t port, long bit);
private:
@ -76,6 +76,9 @@ class vvp_fun_delay : public vvp_net_fun_t, private vvp_gen_event_s {
/*
* $Log: delay.h,v $
* Revision 1.8 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.7 2005/06/02 16:02:11 steve
* Add support for notif0/1 gates.
* Make delay nodes support inertial delay.

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: dff.cc,v 1.1 2005/04/24 20:07:26 steve Exp $"
#ident "$Id: dff.cc,v 1.2 2005/06/22 00:04:49 steve Exp $"
#endif
# include "compile.h"
@ -41,7 +41,7 @@ vvp_dff::~vvp_dff()
{
}
void vvp_dff::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_dff::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
vvp_bit4_t tmp;

View File

@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ident "$Id: dff.h,v 1.1 2005/04/24 20:07:26 steve Exp $"
#ident "$Id: dff.h,v 1.2 2005/06/22 00:04:49 steve Exp $"
# include "vvp_net.h"
@ -40,7 +40,7 @@ class vvp_dff : public vvp_net_fun_t {
explicit vvp_dff(bool invert_clk =false, bool invert_ce =false);
~vvp_dff();
virtual void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
bool iclk_, ice_;

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: event.cc,v 1.19 2005/06/17 23:47:02 steve Exp $"
#ident "$Id: event.cc,v 1.20 2005/06/22 00:04:49 steve Exp $"
#endif
# include "event.h"
@ -79,7 +79,7 @@ vvp_fun_edge::~vvp_fun_edge()
{
}
void vvp_fun_edge::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_edge::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
/* See what kind of edge this represents. */
edge_t mask = VVP_EDGE(bits_[port.port()], bit.value(0));
@ -104,7 +104,7 @@ vvp_fun_anyedge::~vvp_fun_anyedge()
{
}
void vvp_fun_anyedge::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_anyedge::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
unsigned pdx = port.port();
bool flag = false;
@ -137,7 +137,7 @@ vvp_fun_event_or::~vvp_fun_event_or()
{
}
void vvp_fun_event_or::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_event_or::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
run_waiting_threads_();
vvp_net_t*net = port.ptr();
@ -153,7 +153,7 @@ vvp_named_event::~vvp_named_event()
{
}
void vvp_named_event::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_named_event::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
run_waiting_threads_();
vvp_net_t*net = port.ptr();
@ -248,6 +248,9 @@ void compile_named_event(char*label, char*name)
/*
* $Log: event.cc,v $
* Revision 1.20 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.19 2005/06/17 23:47:02 steve
* threads member for waitable_hook_s needs initailizing.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: event.h,v 1.10 2005/06/17 23:47:02 steve Exp $"
#ident "$Id: event.h,v 1.11 2005/06/22 00:04:49 steve Exp $"
#endif
# include "vvp_net.h"
@ -56,7 +56,7 @@ class vvp_fun_edge : public vvp_net_fun_t, public waitable_hooks_s {
virtual ~vvp_fun_edge();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
vvp_bit4_t bits_[4];
@ -79,7 +79,7 @@ class vvp_fun_anyedge : public vvp_net_fun_t, public waitable_hooks_s {
explicit vvp_fun_anyedge();
virtual ~vvp_fun_anyedge();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
vvp_vector4_t bits_[4];
@ -95,7 +95,7 @@ class vvp_fun_event_or : public vvp_net_fun_t, public waitable_hooks_s {
explicit vvp_fun_event_or();
~vvp_fun_event_or();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
};
@ -111,7 +111,7 @@ class vvp_named_event : public vvp_net_fun_t, public waitable_hooks_s {
explicit vvp_named_event(struct __vpiHandle*eh);
~vvp_named_event();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
struct __vpiHandle*handle_;
@ -120,6 +120,9 @@ class vvp_named_event : public vvp_net_fun_t, public waitable_hooks_s {
/*
* $Log: event.h,v $
* Revision 1.11 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.10 2005/06/17 23:47:02 steve
* threads member for waitable_hook_s needs initailizing.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: extend.cc,v 1.2 2005/06/14 00:42:06 steve Exp $"
#ident "$Id: extend.cc,v 1.3 2005/06/22 00:04:49 steve Exp $"
#endif
# include "vvp_net.h"
@ -35,7 +35,7 @@ vvp_fun_extend_signed::~vvp_fun_extend_signed()
{
}
void vvp_fun_extend_signed::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_extend_signed::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
if (bit.size() >= width_) {
vvp_send_vec4(port.ptr()->out, bit);

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: logic.cc,v 1.28 2005/06/21 22:48:23 steve Exp $"
#ident "$Id: logic.cc,v 1.29 2005/06/22 00:04:49 steve Exp $"
#endif
# include "logic.h"
@ -53,7 +53,7 @@ table_functor_s::~table_functor_s()
* WARNING: This function assumes that the table generator encodes the
* values 0/1/x/z the same as the vvp_bit4_t enumeration values.
*/
void table_functor_s::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t val)
void table_functor_s::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&val)
{
input_[ptr.port()] = val;
@ -87,7 +87,7 @@ vvp_fun_and::~vvp_fun_and()
{
}
void vvp_fun_and::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_fun_and::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
input_[ptr.port()] = bit;
@ -123,13 +123,14 @@ vvp_fun_buf::~vvp_fun_buf()
* The buf functor is very simple--change the z bits to x bits in the
* vector it passes, and propagate the result.
*/
void vvp_fun_buf::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_fun_buf::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
if (ptr.port() != 0)
return;
bit.change_z2x();
vvp_send_vec4(ptr.ptr()->out, bit);
vvp_vector4_t tmp = bit;
tmp.change_z2x();
vvp_send_vec4(ptr.ptr()->out, tmp);
}
vvp_fun_bufz::vvp_fun_bufz()
@ -145,7 +146,7 @@ vvp_fun_bufz::~vvp_fun_bufz()
* The bufz is similar to the buf device, except that it does not
* bother translating z bits to x.
*/
void vvp_fun_bufz::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_fun_bufz::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
if (ptr.port() != 0)
return;
@ -168,7 +169,7 @@ vvp_fun_muxz::~vvp_fun_muxz()
{
}
void vvp_fun_muxz::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_fun_muxz::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
switch (ptr.port()) {
case 0:
@ -355,6 +356,9 @@ void compile_functor(char*label, char*type, unsigned width,
/*
* $Log: logic.cc,v $
* Revision 1.29 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.28 2005/06/21 22:48:23 steve
* Optimize vvp_scalar_t handling, and fun_buf Z handling.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: logic.h,v 1.18 2005/06/17 03:46:53 steve Exp $"
#ident "$Id: logic.h,v 1.19 2005/06/22 00:04:49 steve Exp $"
#endif
# include "vvp_net.h"
@ -39,7 +39,7 @@ class table_functor_s: public vvp_net_fun_t {
explicit table_functor_s(truth_t t);
virtual ~table_functor_s();
void recv_vec4(vvp_net_ptr_t p, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t p, const vvp_vector4_t&bit);
private:
truth_t table;
@ -60,7 +60,7 @@ class vvp_fun_and : public vvp_fun_boolean_ {
public:
explicit vvp_fun_and();
~vvp_fun_and();
void recv_vec4(vvp_net_ptr_t p, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t p, const vvp_vector4_t&bit);
};
/*
@ -75,7 +75,7 @@ class vvp_fun_buf: public vvp_net_fun_t {
explicit vvp_fun_buf();
virtual ~vvp_fun_buf();
void recv_vec4(vvp_net_ptr_t p, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t p, const vvp_vector4_t&bit);
private:
};
@ -90,7 +90,7 @@ class vvp_fun_bufz: public vvp_net_fun_t {
explicit vvp_fun_bufz();
virtual ~vvp_fun_bufz();
void recv_vec4(vvp_net_ptr_t p, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t p, const vvp_vector4_t&bit);
private:
};
@ -112,7 +112,7 @@ class vvp_fun_muxz : public vvp_net_fun_t {
explicit vvp_fun_muxz(unsigned width);
virtual ~vvp_fun_muxz();
void recv_vec4(vvp_net_ptr_t p, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t p, const vvp_vector4_t&bit);
private:
vvp_vector4_t a_;
@ -135,6 +135,9 @@ extern const unsigned char ft_XOR[];
/*
* $Log: logic.h,v $
* Revision 1.19 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.18 2005/06/17 03:46:53 steve
* Make functors know their own width.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: memory.cc,v 1.26 2005/03/09 04:52:40 steve Exp $"
#ident "$Id: memory.cc,v 1.27 2005/06/22 00:04:49 steve Exp $"
#endif
#include "memory.h"
@ -213,7 +213,7 @@ vvp_fun_memport::~vvp_fun_memport()
{
}
void vvp_fun_memport::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_memport::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
bool addr_valid_flag;
@ -223,8 +223,7 @@ void vvp_fun_memport::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
addr_valid_flag = vector4_to_value(bit, addr_);
if (! addr_valid_flag)
addr_ = memory_word_count(mem_);
bit = memory_get_word(mem_, addr_);
vvp_send_vec4(port.ptr()->out, bit);
vvp_send_vec4(port.ptr()->out, memory_get_word(mem_,addr_));
break;
default:
@ -250,6 +249,9 @@ void vvp_fun_memport::check_word_change(unsigned long addr)
/*
* $Log: memory.cc,v $
* Revision 1.27 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.26 2005/03/09 04:52:40 steve
* reimplement memory ports.
*

View File

@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: memory.h,v 1.9 2005/03/09 04:52:40 steve Exp $"
#ident "$Id: memory.h,v 1.10 2005/06/22 00:04:49 steve Exp $"
#endif
#include "vvp_net.h"
@ -124,7 +124,7 @@ class vvp_fun_memport : public vvp_net_fun_t {
explicit vvp_fun_memport(vvp_memory_t mem, vvp_net_t*net);
~vvp_fun_memport();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
vvp_memory_t mem_;
@ -152,6 +152,9 @@ vvp_memory_t memory_create(char *label);
/*
* $Log: memory.h,v $
* Revision 1.10 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.9 2005/03/09 04:52:40 steve
* reimplement memory ports.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: npmos.cc,v 1.12 2005/06/12 15:13:37 steve Exp $"
#ident "$Id: npmos.cc,v 1.13 2005/06/22 00:04:49 steve Exp $"
#endif
# include "npmos.h"
@ -28,7 +28,7 @@ vvp_fun_pmos_::vvp_fun_pmos_(bool enable_invert)
}
void vvp_fun_pmos_::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_fun_pmos_::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
/* Data input is processed throught eh recv_vec8 method,
because the strength most be preserved. */
@ -120,6 +120,9 @@ void vvp_fun_rpmos::recv_vec8(vvp_net_ptr_t ptr, vvp_vector8_t bit)
/*
* $Log: npmos.cc,v $
* Revision 1.13 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.12 2005/06/12 15:13:37 steve
* Support resistive mos devices.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: npmos.h,v 1.7 2005/06/12 15:13:37 steve Exp $"
#ident "$Id: npmos.h,v 1.8 2005/06/22 00:04:49 steve Exp $"
#endif
# include "vvp_net.h"
@ -51,7 +51,7 @@ class vvp_fun_pmos_ : public vvp_net_fun_t {
public:
explicit vvp_fun_pmos_(bool enable_invert);
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
protected:
void generate_output_(vvp_net_ptr_t port);
@ -84,6 +84,9 @@ class vvp_fun_rpmos : public vvp_fun_pmos_ {
/*
* $Log: npmos.h,v $
* Revision 1.8 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.7 2005/06/12 15:13:37 steve
* Support resistive mos devices.
*

View File

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ident "$Id: part.cc,v 1.5 2005/05/09 00:36:58 steve Exp $"
#ident "$Id: part.cc,v 1.6 2005/06/22 00:04:49 steve Exp $"
# include "compile.h"
# include "vvp_net.h"
@ -36,7 +36,7 @@ vvp_fun_part::~vvp_fun_part()
{
}
void vvp_fun_part::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_part::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
assert(port.port() == 0);
@ -61,7 +61,7 @@ vvp_fun_part_pv::~vvp_fun_part_pv()
{
}
void vvp_fun_part_pv::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_part_pv::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
assert(port.port() == 0);
assert(bit.size() == wid_);
@ -77,7 +77,7 @@ vvp_fun_part_var::~vvp_fun_part_var()
{
}
void vvp_fun_part_var::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_part_var::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
unsigned long tmp;
switch (port.port()) {
@ -158,6 +158,9 @@ void compile_part_select_var(char*label, char*source, char*var,
/*
* $Log: part.cc,v $
* Revision 1.6 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.5 2005/05/09 00:36:58 steve
* Force part base out of bounds if index is invalid.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: reduce.cc,v 1.1 2005/02/03 04:55:13 steve Exp $"
#ident "$Id: reduce.cc,v 1.2 2005/06/22 00:04:49 steve Exp $"
#endif
# include "compile.h"
@ -35,7 +35,7 @@ class vvp_reduce_and : public vvp_net_fun_t {
public:
vvp_reduce_and();
~vvp_reduce_and();
void recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit);
};
vvp_reduce_and::vvp_reduce_and()
@ -46,7 +46,7 @@ vvp_reduce_and::~vvp_reduce_and()
{
}
void vvp_reduce_and::recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit)
void vvp_reduce_and::recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit)
{
vvp_bit4_t res = BIT4_1;
@ -63,7 +63,7 @@ class vvp_reduce_or : public vvp_net_fun_t {
public:
vvp_reduce_or();
~vvp_reduce_or();
void recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit);
};
vvp_reduce_or::vvp_reduce_or()
@ -74,7 +74,7 @@ vvp_reduce_or::~vvp_reduce_or()
{
}
void vvp_reduce_or::recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit)
void vvp_reduce_or::recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit)
{
vvp_bit4_t res = BIT4_0;
@ -91,7 +91,7 @@ class vvp_reduce_xor : public vvp_net_fun_t {
public:
vvp_reduce_xor();
~vvp_reduce_xor();
void recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit);
};
vvp_reduce_xor::vvp_reduce_xor()
@ -102,7 +102,7 @@ vvp_reduce_xor::~vvp_reduce_xor()
{
}
void vvp_reduce_xor::recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit)
void vvp_reduce_xor::recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit)
{
vvp_bit4_t res = BIT4_0;
@ -119,7 +119,7 @@ class vvp_reduce_nand : public vvp_net_fun_t {
public:
vvp_reduce_nand();
~vvp_reduce_nand();
void recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit);
};
vvp_reduce_nand::vvp_reduce_nand()
@ -130,7 +130,7 @@ vvp_reduce_nand::~vvp_reduce_nand()
{
}
void vvp_reduce_nand::recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit)
void vvp_reduce_nand::recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit)
{
vvp_bit4_t res = BIT4_1;
@ -147,7 +147,7 @@ class vvp_reduce_nor : public vvp_net_fun_t {
public:
vvp_reduce_nor();
~vvp_reduce_nor();
void recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit);
};
vvp_reduce_nor::vvp_reduce_nor()
@ -158,7 +158,7 @@ vvp_reduce_nor::~vvp_reduce_nor()
{
}
void vvp_reduce_nor::recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit)
void vvp_reduce_nor::recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit)
{
vvp_bit4_t res = BIT4_0;
@ -175,7 +175,7 @@ class vvp_reduce_xnor : public vvp_net_fun_t {
public:
vvp_reduce_xnor();
~vvp_reduce_xnor();
void recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit);
};
vvp_reduce_xnor::vvp_reduce_xnor()
@ -186,7 +186,7 @@ vvp_reduce_xnor::~vvp_reduce_xnor()
{
}
void vvp_reduce_xnor::recv_vec4(vvp_net_ptr_t prt, vvp_vector4_t bit)
void vvp_reduce_xnor::recv_vec4(vvp_net_ptr_t prt, const vvp_vector4_t&bit)
{
vvp_bit4_t res = BIT4_0;
@ -247,6 +247,9 @@ void compile_reduce_xnor(char*label, struct symb_s arg)
/*
* $Log: reduce.cc,v $
* Revision 1.2 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.1 2005/02/03 04:55:13 steve
* Add support for reduction logic gates.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: resolv.cc,v 1.24 2005/06/15 00:47:15 steve Exp $"
#ident "$Id: resolv.cc,v 1.25 2005/06/22 00:04:49 steve Exp $"
#endif
# include "resolv.h"
@ -36,7 +36,7 @@ resolv_functor::~resolv_functor()
{
}
void resolv_functor::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void resolv_functor::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
recv_vec8(port, vvp_vector8_t(bit, 6 /* STRONG */));
}
@ -93,6 +93,9 @@ void resolv_functor::recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit)
/*
* $Log: resolv.cc,v $
* Revision 1.25 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.24 2005/06/15 00:47:15 steve
* Resolv do not propogate inputs that do not change.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: resolv.h,v 1.13 2005/03/12 04:27:43 steve Exp $"
#ident "$Id: resolv.h,v 1.14 2005/06/22 00:04:49 steve Exp $"
#endif
# include "config.h"
@ -43,7 +43,7 @@ class resolv_functor : public vvp_net_fun_t {
explicit resolv_functor(vvp_scalar_t hiz_value);
~resolv_functor();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
void recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit);
void recv_vec4_pv(vvp_net_ptr_t port, vvp_vector4_t bit,
@ -56,6 +56,9 @@ class resolv_functor : public vvp_net_fun_t {
/*
* $Log: resolv.h,v $
* Revision 1.14 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.13 2005/03/12 04:27:43 steve
* Implement VPI access to signal strengths,
* Fix resolution of ambiguous drive pairs,

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ufunc.h,v 1.5 2005/04/01 06:02:45 steve Exp $"
#ident "$Id: ufunc.h,v 1.6 2005/06/22 00:04:49 steve Exp $"
#endif
# include "pointers.h"
@ -86,29 +86,12 @@ class ufunc_core : public vvp_wide_fun_core {
vvp_net_t*result_;
};
#if 0
/*
* The job of the input functor is only to monitor inputs to the
* function and pass them to the ufunc_core object. Each functor takes
* up to 4 inputs, with the base the port number for the first
* function input that this functor represents.
*/
class ufunc_input_functor : public vvp_net_fun_t {
public:
ufunc_input_functor(ufunc_core*c, unsigned base);
~ufunc_input_functor();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
private:
ufunc_core*core_;
unsigned port_base_;
};
#endif
/*
* $Log: ufunc.h,v $
* Revision 1.6 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.5 2005/04/01 06:02:45 steve
* Reimplement combinational UDPs.
*

View File

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ident "$Id: vvp_net.cc,v 1.35 2005/06/21 22:48:23 steve Exp $"
#ident "$Id: vvp_net.cc,v 1.36 2005/06/22 00:04:49 steve Exp $"
# include "config.h"
# include "vvp_net.h"
@ -595,7 +595,7 @@ vvp_net_fun_t::~vvp_net_fun_t()
{
}
void vvp_net_fun_t::recv_vec4(vvp_net_ptr_t, vvp_vector4_t)
void vvp_net_fun_t::recv_vec4(vvp_net_ptr_t, const vvp_vector4_t&)
{
fprintf(stderr, "internal error: %s: recv_vec4 not implemented\n",
typeid(*this).name());
@ -644,7 +644,7 @@ vvp_fun_drive::~vvp_fun_drive()
{
}
void vvp_fun_drive::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_fun_drive::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
assert(port.port() == 0);
vvp_send_vec8(port.ptr()->out, vvp_vector8_t(bit, drive0_, drive1_));
@ -674,7 +674,7 @@ vvp_fun_signal::vvp_fun_signal(unsigned wid)
* the first propagation, and forces the first propagation to happen
* even if it matches the initial value.
*/
void vvp_fun_signal::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
void vvp_fun_signal::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit)
{
switch (ptr.port()) {
case 0: // Normal input (feed from net, or set from process)
@ -705,10 +705,11 @@ void vvp_fun_signal::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
// Force from a node may not have been sized completely
// by the source, so coerce the size here.
if (bit.size() != size())
bit = coerce_to_width(bit, size());
force_ = coerce_to_width(bit, size());
else
force_ = bit;
force_active_ = true;
force_ = bit;
vvp_send_vec4(ptr.ptr()->out, force_);
run_vpi_callbacks();
break;
@ -896,7 +897,7 @@ vvp_wide_fun_t::~vvp_wide_fun_t()
{
}
void vvp_wide_fun_t::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
void vvp_wide_fun_t::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
unsigned pidx = port_base_ + port.port();
core_->dispatch_vec4_from_input_(pidx, bit);
@ -1304,6 +1305,9 @@ vvp_bit4_t compare_gtge_signed(const vvp_vector4_t&a,
/*
* $Log: vvp_net.cc,v $
* Revision 1.36 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.35 2005/06/21 22:48:23 steve
* Optimize vvp_scalar_t handling, and fun_buf Z handling.
*

View File

@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ident "$Id: vvp_net.h,v 1.37 2005/06/21 22:48:23 steve Exp $"
#ident "$Id: vvp_net.h,v 1.38 2005/06/22 00:04:49 steve Exp $"
# include "config.h"
# include <stddef.h>
@ -503,7 +503,7 @@ class vvp_net_fun_t {
vvp_net_fun_t();
virtual ~vvp_net_fun_t();
virtual void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
virtual void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
virtual void recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit);
virtual void recv_real(vvp_net_ptr_t port, double bit);
virtual void recv_long(vvp_net_ptr_t port, long bit);
@ -537,7 +537,7 @@ class vvp_fun_concat : public vvp_net_fun_t {
unsigned w2, unsigned w3);
~vvp_fun_concat();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
unsigned wid_[4];
@ -556,7 +556,7 @@ class vvp_fun_repeat : public vvp_net_fun_t {
vvp_fun_repeat(unsigned width, unsigned repeat);
~vvp_fun_repeat();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
unsigned wid_;
@ -580,7 +580,7 @@ class vvp_fun_drive : public vvp_net_fun_t {
vvp_fun_drive(vvp_bit4_t init, unsigned str0 =6, unsigned str1 =6);
~vvp_fun_drive();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
//void recv_long(vvp_net_ptr_t port, long bit);
private:
@ -600,7 +600,7 @@ class vvp_fun_extend_signed : public vvp_net_fun_t {
explicit vvp_fun_extend_signed(unsigned wid);
~vvp_fun_extend_signed();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
unsigned width_;
@ -619,7 +619,7 @@ class vvp_fun_part : public vvp_net_fun_t {
~vvp_fun_part();
public:
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
unsigned base_;
@ -638,7 +638,7 @@ class vvp_fun_part_pv : public vvp_net_fun_t {
~vvp_fun_part_pv();
public:
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
unsigned base_;
@ -658,7 +658,7 @@ class vvp_fun_part_var : public vvp_net_fun_t {
~vvp_fun_part_var();
public:
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
unsigned base_;
@ -726,7 +726,7 @@ class vvp_fun_signal : public vvp_net_fun_t {
public:
explicit vvp_fun_signal(unsigned wid);
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
void recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit);
void recv_long(vvp_net_ptr_t port, long bit);
@ -833,7 +833,7 @@ class vvp_wide_fun_t : public vvp_net_fun_t {
vvp_wide_fun_t(vvp_wide_fun_core*c, unsigned base);
~vvp_wide_fun_t();
void recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit);
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
private:
vvp_wide_fun_core*core_;
@ -880,6 +880,9 @@ extern void vvp_send_vec4_pv(vvp_net_ptr_t ptr, vvp_vector4_t val,
/*
* $Log: vvp_net.h,v $
* Revision 1.38 2005/06/22 00:04:49 steve
* Reduce vvp_vector4 copies by using const references.
*
* Revision 1.37 2005/06/21 22:48:23 steve
* Optimize vvp_scalar_t handling, and fun_buf Z handling.
*