Add support for notif0/1 gates.
Make delay nodes support inertial delay. Add the %force/link instruction.
This commit is contained in:
parent
aa2e178667
commit
42433f4df9
|
|
@ -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.12 2005/04/13 06:34:20 steve Exp $"
|
||||
#ident "$Id: bufif.cc,v 1.13 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "bufif.h"
|
||||
|
|
@ -39,7 +39,7 @@ void vvp_fun_bufif::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
|
|||
{
|
||||
switch (ptr.port()) {
|
||||
case 0:
|
||||
bit_ = bit;
|
||||
bit_ = inv_? ~bit : bit;
|
||||
break;
|
||||
case 1:
|
||||
en_ = pol_? ~bit : bit;
|
||||
|
|
@ -87,6 +87,11 @@ void vvp_fun_bufif::recv_vec4(vvp_net_ptr_t ptr, vvp_vector4_t bit)
|
|||
|
||||
/*
|
||||
* $Log: bufif.cc,v $
|
||||
* Revision 1.13 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.12 2005/04/13 06:34:20 steve
|
||||
* Add vvp driver functor for logic outputs,
|
||||
* Add ostream output operators for debugging.
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: codes.h,v 1.72 2005/05/07 03:15:42 steve Exp $"
|
||||
#ident "$Id: codes.h,v 1.73 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -68,6 +68,7 @@ extern bool of_DIV(vthread_t thr, vvp_code_t code);
|
|||
extern bool of_DIV_S(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_DIV_WR(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_END(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_FORCE_LINK(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_FORCE_V(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_FORK(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_INV(vthread_t thr, vvp_code_t code);
|
||||
|
|
@ -173,6 +174,11 @@ extern vvp_code_t codespace_null(void);
|
|||
|
||||
/*
|
||||
* $Log: codes.h,v $
|
||||
* Revision 1.73 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.72 2005/05/07 03:15:42 steve
|
||||
* Implement non-blocking part assign.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: compile.cc,v 1.203 2005/05/25 05:44:51 steve Exp $"
|
||||
#ident "$Id: compile.cc,v 1.204 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "arith.h"
|
||||
|
|
@ -115,6 +115,7 @@ const static struct opcode_table_s opcode_table[] = {
|
|||
{ "%div/s", of_DIV_S, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
{ "%div/wr", of_DIV_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
|
||||
{ "%end", of_END, 0, {OA_NONE, OA_NONE, OA_NONE} },
|
||||
{ "%force/link",of_FORCE_LINK,2,{OA_FUNC_PTR,OA_FUNC_PTR2,OA_NONE} },
|
||||
{ "%force/v",of_FORCE_V,3, {OA_FUNC_PTR, OA_BIT1, OA_BIT2} },
|
||||
{ "%inv", of_INV, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
|
||||
{ "%ix/add", of_IX_ADD, 2, {OA_BIT1, OA_NUMBER, OA_NONE} },
|
||||
|
|
@ -1547,6 +1548,11 @@ void compile_param_string(char*label, char*name, char*str, char*value)
|
|||
|
||||
/*
|
||||
* $Log: compile.cc,v $
|
||||
* Revision 1.204 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.203 2005/05/25 05:44:51 steve
|
||||
* Handle event/or with specific, efficient nodes.
|
||||
*
|
||||
|
|
|
|||
20
vvp/delay.cc
20
vvp/delay.cc
|
|
@ -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.5 2005/05/14 19:43:23 steve Exp $"
|
||||
#ident "$Id: delay.cc,v 1.6 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
#include "delay.h"
|
||||
|
|
@ -92,8 +92,8 @@ vvp_time64_t vvp_delay_t::get_delay(vvp_bit4_t from, vvp_bit4_t to)
|
|||
return 0;
|
||||
}
|
||||
|
||||
vvp_fun_delay::vvp_fun_delay(vvp_bit4_t init, const vvp_delay_t&d)
|
||||
: delay_(d), cur_(1)
|
||||
vvp_fun_delay::vvp_fun_delay(vvp_net_t*n, vvp_bit4_t init, const vvp_delay_t&d)
|
||||
: net_(n), delay_(d), cur_(1)
|
||||
{
|
||||
cur_.set_bit(0, init);
|
||||
}
|
||||
|
|
@ -118,13 +118,23 @@ void vvp_fun_delay::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
|
|||
|
||||
cur_ = bit;
|
||||
if (use_delay == 0)
|
||||
vvp_send_vec4(port.ptr()->out, cur_);
|
||||
vvp_send_vec4(net_->out, cur_);
|
||||
else
|
||||
schedule_assign_vector(port.ptr()->out, cur_, use_delay);
|
||||
schedule_generic(this, 0, use_delay, false);
|
||||
}
|
||||
|
||||
void vvp_fun_delay::run_run()
|
||||
{
|
||||
vvp_send_vec4(net_->out, cur_);
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: delay.cc,v $
|
||||
* Revision 1.6 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.5 2005/05/14 19:43:23 steve
|
||||
* Move functor delays to vvp_delay_fun object.
|
||||
*
|
||||
|
|
|
|||
19
vvp/delay.h
19
vvp/delay.h
|
|
@ -19,13 +19,14 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: delay.h,v 1.6 2005/05/14 19:43:23 steve Exp $"
|
||||
#ident "$Id: delay.h,v 1.7 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
# include "vvp_net.h"
|
||||
# include "schedule.h"
|
||||
|
||||
/*
|
||||
* Instances of this object are functions that calculate the delay for
|
||||
|
|
@ -51,23 +52,35 @@ class vvp_delay_t {
|
|||
* carries delays. The output that it propagates is vvp_vector4_t so
|
||||
* drive strengths are lost, but then again it doesn't go through the
|
||||
* effort of calculating strength values either.
|
||||
*
|
||||
* The node needs a pointer to the vvp_net_t input so that it knows
|
||||
* how to find its output when propaging delayed output.
|
||||
*/
|
||||
class vvp_fun_delay : public vvp_net_fun_t {
|
||||
class vvp_fun_delay : public vvp_net_fun_t, private vvp_gen_event_s {
|
||||
|
||||
public:
|
||||
vvp_fun_delay(vvp_bit4_t init, const vvp_delay_t&d);
|
||||
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_long(vvp_net_ptr_t port, long bit);
|
||||
|
||||
private:
|
||||
virtual void run_run();
|
||||
|
||||
private:
|
||||
vvp_net_t*net_;
|
||||
vvp_delay_t delay_;
|
||||
vvp_vector4_t cur_;
|
||||
};
|
||||
|
||||
/*
|
||||
* $Log: delay.h,v $
|
||||
* Revision 1.7 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.6 2005/05/14 19:43:23 steve
|
||||
* Move functor delays to vvp_delay_fun object.
|
||||
*
|
||||
|
|
|
|||
25
vvp/logic.cc
25
vvp/logic.cc
|
|
@ -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.23 2005/05/14 19:43:23 steve Exp $"
|
||||
#ident "$Id: logic.cc,v 1.24 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "logic.h"
|
||||
|
|
@ -249,6 +249,14 @@ void compile_functor(char*label, char*type,
|
|||
obj = new vvp_fun_bufif(false,false, ostr0, ostr1);
|
||||
strength_aware = true;
|
||||
|
||||
} else if (strcmp(type, "NOTIF0") == 0) {
|
||||
obj = new vvp_fun_bufif(true,true, ostr0, ostr1);
|
||||
strength_aware = true;
|
||||
|
||||
} else if (strcmp(type, "NOTIF1") == 0) {
|
||||
obj = new vvp_fun_bufif(false,true, ostr0, ostr1);
|
||||
strength_aware = true;
|
||||
|
||||
} else if (strcmp(type, "BUFZ") == 0) {
|
||||
obj = new vvp_fun_bufz();
|
||||
#if 0
|
||||
|
|
@ -281,13 +289,7 @@ void compile_functor(char*label, char*type,
|
|||
|
||||
} else if (strcmp(type, "NOT") == 0) {
|
||||
obj = new table_functor_s(ft_NOT);
|
||||
#if 0
|
||||
} else if (strcmp(type, "NOTIF0") == 0) {
|
||||
obj = new vvp_bufif_s(true,true, ostr0, ostr1);
|
||||
|
||||
} else if (strcmp(type, "NOTIF1") == 0) {
|
||||
obj = new vvp_bufif_s(false,true, ostr0, ostr1);
|
||||
#endif
|
||||
} else if (strcmp(type, "XNOR") == 0) {
|
||||
obj = new table_functor_s(ft_XNOR);
|
||||
|
||||
|
|
@ -320,15 +322,15 @@ void compile_functor(char*label, char*type,
|
|||
return;
|
||||
}
|
||||
|
||||
vvp_net_t*net_drv = new vvp_net_t;
|
||||
vvp_net_fun_t*obj_drv;
|
||||
|
||||
if (ostr0 == 6 && ostr1 == 6 && delay != 0) {
|
||||
obj_drv = new vvp_fun_delay(BIT4_X, *delay);
|
||||
obj_drv = new vvp_fun_delay(net_drv, BIT4_X, *delay);
|
||||
} else {
|
||||
obj_drv = new vvp_fun_drive(BIT4_X, ostr0, ostr1);
|
||||
}
|
||||
|
||||
vvp_net_t*net_drv = new vvp_net_t;
|
||||
net_drv->fun = obj_drv;
|
||||
|
||||
/* Point the gate to the drive node. */
|
||||
|
|
@ -344,6 +346,11 @@ void compile_functor(char*label, char*type,
|
|||
|
||||
/*
|
||||
* $Log: logic.cc,v $
|
||||
* Revision 1.24 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.23 2005/05/14 19:43:23 steve
|
||||
* Move functor delays to vvp_delay_fun object.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: schedule.cc,v 1.34 2005/05/07 03:15:42 steve Exp $"
|
||||
#ident "$Id: schedule.cc,v 1.35 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "schedule.h"
|
||||
|
|
@ -139,8 +139,8 @@ struct generic_event_s : public event_s {
|
|||
void generic_event_s::run_run(void)
|
||||
{
|
||||
count_gen_events += 1;
|
||||
if (obj && obj->run)
|
||||
obj->run(obj, val);
|
||||
if (obj)
|
||||
obj->run_run();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -583,6 +583,11 @@ void schedule_simulate(void)
|
|||
|
||||
/*
|
||||
* $Log: schedule.cc,v $
|
||||
* Revision 1.35 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.34 2005/05/07 03:15:42 steve
|
||||
* Implement non-blocking part assign.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: schedule.h,v 1.21 2005/05/07 03:15:42 steve Exp $"
|
||||
#ident "$Id: schedule.h,v 1.22 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vthread.h"
|
||||
|
|
@ -84,7 +84,7 @@ extern void schedule_generic(vvp_gen_event_t obj, unsigned char val,
|
|||
|
||||
struct vvp_gen_event_s
|
||||
{
|
||||
void (*run)(vvp_gen_event_t obj, unsigned char val);
|
||||
virtual void run_run() =0;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -131,6 +131,11 @@ extern unsigned long count_event_pool;
|
|||
|
||||
/*
|
||||
* $Log: schedule.h,v $
|
||||
* Revision 1.22 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.21 2005/05/07 03:15:42 steve
|
||||
* Implement non-blocking part assign.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: vpi_callback.cc,v 1.35 2004/12/11 02:31:30 steve Exp $"
|
||||
#ident "$Id: vpi_callback.cc,v 1.36 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -81,6 +81,8 @@ const struct __vpirt callback_rt = {
|
|||
struct sync_cb : public vvp_gen_event_s {
|
||||
struct __vpiCallback*handle;
|
||||
bool sync_flag;
|
||||
|
||||
virtual void run_run();
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -166,13 +168,12 @@ static struct __vpiCallback* make_value_change(p_cb_data data)
|
|||
return obj;
|
||||
}
|
||||
|
||||
static void make_sync_run(vvp_gen_event_t obj, unsigned char)
|
||||
void sync_cb::run_run()
|
||||
{
|
||||
struct sync_cb*cb = (struct sync_cb*)obj;
|
||||
if (cb->handle == 0)
|
||||
if (handle == 0)
|
||||
return;
|
||||
|
||||
struct __vpiCallback*cur = cb->handle;
|
||||
struct __vpiCallback*cur = handle;
|
||||
cur->cb_data.time->type = vpiSimTime;
|
||||
vpip_time_to_timestruct(cur->cb_data.time, schedule_simtime());
|
||||
|
||||
|
|
@ -181,7 +182,7 @@ static void make_sync_run(vvp_gen_event_t obj, unsigned char)
|
|||
the usual way to cancel one-time callbacks of this sort. */
|
||||
if (cur->cb_data.cb_rtn != 0) {
|
||||
assert(vpi_mode_flag == VPI_MODE_NONE);
|
||||
vpi_mode_flag = cb->sync_flag? VPI_MODE_ROSYNC : VPI_MODE_RWSYNC;
|
||||
vpi_mode_flag = sync_flag? VPI_MODE_ROSYNC : VPI_MODE_RWSYNC;
|
||||
(cur->cb_data.cb_rtn)(&cur->cb_data);
|
||||
vpi_mode_flag = VPI_MODE_NONE;
|
||||
}
|
||||
|
|
@ -201,7 +202,6 @@ static struct __vpiCallback* make_sync(p_cb_data data, bool readonly_flag)
|
|||
|
||||
struct sync_cb*cb = new sync_cb;
|
||||
cb->sync_flag = readonly_flag? true : false;
|
||||
cb->run = &make_sync_run;
|
||||
cb->handle = obj;
|
||||
obj->cb_sync = cb;
|
||||
|
||||
|
|
@ -240,7 +240,6 @@ static struct __vpiCallback* make_afterdelay(p_cb_data data)
|
|||
|
||||
struct sync_cb*cb = new sync_cb;
|
||||
cb->sync_flag = false;
|
||||
cb->run = &make_sync_run;
|
||||
cb->handle = obj;
|
||||
obj->cb_sync = cb;
|
||||
|
||||
|
|
@ -480,6 +479,11 @@ void vvp_fun_signal::run_vpi_callbacks()
|
|||
|
||||
/*
|
||||
* $Log: vpi_callback.cc,v $
|
||||
* Revision 1.36 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.35 2004/12/11 02:31:30 steve
|
||||
* Rework of internals to carry vectors through nexus instead
|
||||
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: vpi_priv.cc,v 1.46 2004/05/19 03:26:24 steve Exp $"
|
||||
#ident "$Id: vpi_priv.cc,v 1.47 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vpi_priv.h"
|
||||
|
|
@ -394,13 +394,12 @@ void vpi_get_value(vpiHandle expr, s_vpi_value*vp)
|
|||
struct vpip_put_value_event : vvp_gen_event_s {
|
||||
vpiHandle handle;
|
||||
s_vpi_value value;
|
||||
virtual void run_run();
|
||||
};
|
||||
|
||||
static void vpip_put_value_callback(vvp_gen_event_t eobj, unsigned char)
|
||||
void vpip_put_value_event::run_run()
|
||||
{
|
||||
vpip_put_value_event*put = (vpip_put_value_event*)eobj;
|
||||
|
||||
put->handle->vpi_type->vpi_put_value_ (put->handle, &put->value);
|
||||
handle->vpi_type->vpi_put_value_ (handle, &value);
|
||||
}
|
||||
|
||||
vpiHandle vpi_put_value(vpiHandle obj, s_vpi_value*vp,
|
||||
|
|
@ -432,7 +431,6 @@ vpiHandle vpi_put_value(vpiHandle obj, s_vpi_value*vp,
|
|||
vpip_put_value_event*put = new vpip_put_value_event;
|
||||
put->handle = obj;
|
||||
put->value = *vp;
|
||||
put->run = &vpip_put_value_callback;
|
||||
schedule_generic(put, 0, dly, false);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -687,6 +685,11 @@ extern "C" void vpi_control(PLI_INT32 operation, ...)
|
|||
|
||||
/*
|
||||
* $Log: vpi_priv.cc,v $
|
||||
* Revision 1.47 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.46 2004/05/19 03:26:24 steve
|
||||
* Support delayed/non-blocking assignment to reals and others.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.136 2005/05/17 20:51:06 steve Exp $"
|
||||
#ident "$Id: vthread.cc,v 1.137 2005/06/02 16:02:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1505,6 +1505,39 @@ bool of_END(vthread_t thr, vvp_code_t)
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* the %force/link instruction connects a source node to a
|
||||
* destination node. The destination node must be a signal, as it is
|
||||
* marked with the source of the force so that it may later be
|
||||
* unlinked without specifically knowing the source that this
|
||||
* instruction used.
|
||||
*/
|
||||
bool of_FORCE_LINK(vthread_t thr, vvp_code_t cp)
|
||||
{
|
||||
vvp_net_t*dst = cp->net;
|
||||
vvp_net_t*src = cp->net2;
|
||||
|
||||
vvp_fun_signal*sig = reinterpret_cast<vvp_fun_signal*>(dst->fun);
|
||||
assert(sig);
|
||||
|
||||
/* Detect the special case that we are already forced the
|
||||
source onto the destination. */
|
||||
if (sig->force_link == src)
|
||||
return true;
|
||||
|
||||
/* FIXME: Don't yet support changing the force. */
|
||||
assert(sig->force_link == 0);
|
||||
sig->force_link = src;
|
||||
|
||||
/* Link the output of the src to the port[2] (the force
|
||||
port) of the destination. */
|
||||
vvp_net_ptr_t dst_ptr (dst, 2);
|
||||
dst->port[2] = src->out;
|
||||
src->out = dst_ptr;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* The %force/v instruction invokes a force assign of a constant value
|
||||
* to a signal. The instruction arguments are:
|
||||
|
|
@ -2706,6 +2739,12 @@ bool of_RELEASE_NET(vthread_t thr, vvp_code_t cp)
|
|||
{
|
||||
vvp_net_t*net = cp->net;
|
||||
|
||||
vvp_fun_signal*sig = reinterpret_cast<vvp_fun_signal*>(net->fun);
|
||||
assert(sig);
|
||||
|
||||
/* XXXX Release for %force/link not yet implemented. */
|
||||
assert(sig->force_link == 0);
|
||||
|
||||
vvp_net_ptr_t ptr (net, 3);
|
||||
vvp_send_long(ptr, 2);
|
||||
|
||||
|
|
@ -2716,6 +2755,12 @@ bool of_RELEASE_REG(vthread_t thr, vvp_code_t cp)
|
|||
{
|
||||
vvp_net_t*net = cp->net;
|
||||
|
||||
vvp_fun_signal*sig = reinterpret_cast<vvp_fun_signal*>(net->fun);
|
||||
assert(sig);
|
||||
|
||||
/* XXXX Release for %force/link not yet implemented. */
|
||||
assert(sig->force_link == 0);
|
||||
|
||||
vvp_net_ptr_t ptr (net, 3);
|
||||
vvp_send_long(ptr, 3);
|
||||
|
||||
|
|
@ -3177,6 +3222,11 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp)
|
|||
|
||||
/*
|
||||
* $Log: vthread.cc,v $
|
||||
* Revision 1.137 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.136 2005/05/17 20:51:06 steve
|
||||
* Clean up instruction type reverences to bits.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.28 2005/05/17 20:54:56 steve Exp $"
|
||||
#ident "$Id: vvp_net.cc,v 1.29 2005/06/02 16:02:11 steve Exp $"
|
||||
|
||||
# include "config.h"
|
||||
# include "vvp_net.h"
|
||||
|
|
@ -697,6 +697,7 @@ void vvp_fun_drive::recv_vec4(vvp_net_ptr_t port, vvp_vector4_t bit)
|
|||
vvp_fun_signal::vvp_fun_signal(unsigned wid)
|
||||
: bits4_(wid), needs_init_(true)
|
||||
{
|
||||
force_link = 0;
|
||||
vpi_callbacks = 0;
|
||||
continuous_assign_active_ = false;
|
||||
force_active_ = false;
|
||||
|
|
@ -1346,6 +1347,11 @@ vvp_bit4_t compare_gtge_signed(const vvp_vector4_t&a,
|
|||
|
||||
/*
|
||||
* $Log: vvp_net.cc,v $
|
||||
* Revision 1.29 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.28 2005/05/17 20:54:56 steve
|
||||
* Clean up definition of vvp_vector4_t insertion into ostream.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.28 2005/05/24 01:43:27 steve Exp $"
|
||||
#ident "$Id: vvp_net.h,v 1.29 2005/06/02 16:02:11 steve Exp $"
|
||||
|
||||
# include "config.h"
|
||||
# include <assert.h>
|
||||
|
|
@ -649,6 +649,11 @@ class vvp_fun_signal : public vvp_net_fun_t {
|
|||
public:
|
||||
struct __vpiCallback*vpi_callbacks;
|
||||
|
||||
/* The %force/link instruction needs a place to write the
|
||||
source node of the force, so that subsequent %force and
|
||||
%release instructions can undo the link as needed. */
|
||||
struct vvp_net_t*force_link;
|
||||
|
||||
private:
|
||||
vvp_vector4_t bits4_;
|
||||
vvp_vector8_t bits8_;
|
||||
|
|
@ -739,6 +744,11 @@ class vvp_wide_fun_t : public vvp_net_fun_t {
|
|||
|
||||
/*
|
||||
* $Log: vvp_net.h,v $
|
||||
* Revision 1.29 2005/06/02 16:02:11 steve
|
||||
* Add support for notif0/1 gates.
|
||||
* Make delay nodes support inertial delay.
|
||||
* Add the %force/link instruction.
|
||||
*
|
||||
* Revision 1.28 2005/05/24 01:43:27 steve
|
||||
* Add a sign-extension node.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue