Handle relink of continuous assignment.

This commit is contained in:
steve 2007-02-05 01:08:10 +00:00
parent 7d42c50253
commit d958a4a5af
3 changed files with 31 additions and 7 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: vthread.cc,v 1.159 2007/01/31 22:28:55 steve Exp $"
#ident "$Id: vthread.cc,v 1.160 2007/02/05 01:08:10 steve Exp $"
#endif
# include "config.h"
@ -759,10 +759,23 @@ bool of_CASSIGN_LINK(vthread_t thr, vvp_code_t cp)
vvp_net_t*dst = cp->net;
vvp_net_t*src = cp->net2;
/* For now, assert that the destination continuous assign
input is empty. That should be so as you can have only one
continuous assignment active for the destination. */
assert(dst->port[1].nil());
vvp_fun_signal_base*sig
= reinterpret_cast<vvp_fun_signal_base*>(dst->fun);
assert(sig);
/* Detect the special case that we are already continuous
assigning the source onto the destination. */
if (sig->cassign_link == src)
return true;
/* If there is an existing cassign driving this node, then
unlink it. We can have only 1 cassign at a time. */
if (sig->cassign_link != 0) {
vvp_net_ptr_t tmp (dst,1);
unlink_from_driver(sig->cassign_link, tmp);
}
sig->cassign_link = src;
/* Link the output of the src to the port[1] (the cassign
port) of the destination. */
@ -3378,6 +3391,9 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp)
/*
* $Log: vthread.cc,v $
* Revision 1.160 2007/02/05 01:08:10 steve
* Handle relink of continuous assignment.
*
* Revision 1.159 2007/01/31 22:28:55 steve
* Fix missing check for thread bits width in ADDI
*

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.57 2006/12/10 17:15:48 steve Exp $"
#ident "$Id: vvp_net.cc,v 1.58 2007/02/05 01:08:10 steve Exp $"
# include "config.h"
# include "vvp_net.h"
@ -1386,6 +1386,7 @@ vvp_fun_signal_base::vvp_fun_signal_base()
needs_init_ = true;
continuous_assign_active_ = false;
force_link = 0;
cassign_link = 0;
}
void vvp_fun_signal_base::deassign()
@ -2256,6 +2257,9 @@ vvp_bit4_t compare_gtge_signed(const vvp_vector4_t&a,
/*
* $Log: vvp_net.cc,v $
* Revision 1.58 2007/02/05 01:08:10 steve
* Handle relink of continuous assignment.
*
* Revision 1.57 2006/12/10 17:15:48 steve
* Fix build error overloading pow function.
*

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.54 2007/01/16 05:44:17 steve Exp $"
#ident "$Id: vvp_net.h,v 1.55 2007/02/05 01:08:10 steve Exp $"
# include "config.h"
# include <stddef.h>
@ -800,6 +800,7 @@ class vvp_fun_signal_base : public vvp_net_fun_t, public vvp_vpi_callback {
source node of the force, so that subsequent %force and
%release instructions can undo the link as needed. */
struct vvp_net_t*force_link;
struct vvp_net_t*cassign_link;
protected:
@ -1035,6 +1036,9 @@ inline void vvp_send_vec4_pv(vvp_net_ptr_t ptr, const vvp_vector4_t&val,
/*
* $Log: vvp_net.h,v $
* Revision 1.55 2007/02/05 01:08:10 steve
* Handle relink of continuous assignment.
*
* Revision 1.54 2007/01/16 05:44:17 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory