From 26d97558c4920b967e0b086dabf717f9b751bac1 Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 17 Dec 2004 04:47:47 +0000 Subject: [PATCH] Replace single release with release/net and release/reg. --- vvp/codes.h | 8 ++++++-- vvp/compile.cc | 8 ++++++-- vvp/force.cc | 24 ++++-------------------- vvp/opcodes.txt | 22 +++++++++------------- vvp/vthread.cc | 33 ++++++++++++++++++++++++++++++++- 5 files changed, 57 insertions(+), 38 deletions(-) diff --git a/vvp/codes.h b/vvp/codes.h index f0f0d5d89..32f8473c9 100644 --- a/vvp/codes.h +++ b/vvp/codes.h @@ -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.68 2004/12/15 17:17:42 steve Exp $" +#ident "$Id: codes.h,v 1.69 2004/12/17 04:47:47 steve Exp $" #endif @@ -97,7 +97,8 @@ extern bool of_NOR(vthread_t thr, vvp_code_t code); extern bool of_NORR(vthread_t thr, vvp_code_t code); extern bool of_OR(vthread_t thr, vvp_code_t code); extern bool of_ORR(vthread_t thr, vvp_code_t code); -extern bool of_RELEASE(vthread_t thr, vvp_code_t code); +extern bool of_RELEASE_NET(vthread_t thr, vvp_code_t code); +extern bool of_RELEASE_REG(vthread_t thr, vvp_code_t code); extern bool of_SET_MEM(vthread_t thr, vvp_code_t code); extern bool of_SET_VEC(vthread_t thr, vvp_code_t code); extern bool of_SET_WORDR(vthread_t thr, vvp_code_t code); @@ -168,6 +169,9 @@ extern vvp_code_t codespace_null(void); /* * $Log: codes.h,v $ + * Revision 1.69 2004/12/17 04:47:47 steve + * Replace single release with release/net and release/reg. + * * Revision 1.68 2004/12/15 17:17:42 steve * Add the force/v instruction. * diff --git a/vvp/compile.cc b/vvp/compile.cc index 167f95479..0b67ce2b9 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -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.177 2004/12/15 17:17:42 steve Exp $" +#ident "$Id: compile.cc,v 1.178 2004/12/17 04:47:47 steve Exp $" #endif # include "arith.h" @@ -143,7 +143,8 @@ const static struct opcode_table_s opcode_table[] = { { "%nor/r", of_NORR, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, { "%or", of_OR, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, { "%or/r", of_ORR, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, - { "%release",of_RELEASE,1, {OA_FUNC_PTR, OA_NONE, OA_NONE} }, + { "%release/net",of_RELEASE_NET,1,{OA_FUNC_PTR,OA_NONE,OA_NONE} }, + { "%release/reg",of_RELEASE_REG,1,{OA_FUNC_PTR,OA_NONE,OA_NONE} }, { "%set/m", of_SET_MEM,2, {OA_MEM_PTR, OA_BIT1, OA_NONE} }, { "%set/v", of_SET_VEC,3, {OA_FUNC_PTR, OA_BIT1, OA_BIT2} }, { "%set/wr", of_SET_WORDR,2,{OA_VPI_PTR, OA_BIT1, OA_NONE} }, @@ -1562,6 +1563,9 @@ void compile_param_string(char*label, char*name, char*str, char*value) /* * $Log: compile.cc,v $ + * Revision 1.178 2004/12/17 04:47:47 steve + * Replace single release with release/net and release/reg. + * * Revision 1.177 2004/12/15 17:17:42 steve * Add the force/v instruction. * diff --git a/vvp/force.cc b/vvp/force.cc index fd23cb06e..d9db009d8 100644 --- a/vvp/force.cc +++ b/vvp/force.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: force.cc,v 1.10 2004/12/15 17:17:42 steve Exp $" +#ident "$Id: force.cc,v 1.11 2004/12/17 04:47:47 steve Exp $" #endif # include "codes.h" @@ -97,25 +97,6 @@ static bool release_force(vvp_ipoint_t itgt, functor_t tgt) } -/* - * The %release instruction causes any force functors driving the - * target functor to be released. - */ -bool of_RELEASE(vthread_t thr, vvp_code_t cp) -{ -#if 0 - vvp_ipoint_t itgt = cp->iptr; - functor_t tgt = functor_index(itgt); - - if (release_force(itgt, tgt)) - tgt->enable(itgt); -#else - fprintf(stderr, "XXXX forgot how to implement %%release\n"); -#endif - return true; -} - - /* ** Variable functors receive %set or %assign-ed values at port[0]. ** Continuous assignments are connected to port[1]. @@ -171,6 +152,9 @@ bool var_functor_s::deassign(vvp_ipoint_t itgt) /* * $Log: force.cc,v $ + * Revision 1.11 2004/12/17 04:47:47 steve + * Replace single release with release/net and release/reg. + * * Revision 1.10 2004/12/15 17:17:42 steve * Add the force/v instruction. * diff --git a/vvp/opcodes.txt b/vvp/opcodes.txt index f36ba74fa..f20e18f29 100644 --- a/vvp/opcodes.txt +++ b/vvp/opcodes.txt @@ -1,7 +1,7 @@ /* * Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com) * - * $Id: opcodes.txt,v 1.57 2004/12/15 17:17:42 steve Exp $ + * $Id: opcodes.txt,v 1.58 2004/12/17 04:47:47 steve Exp $ */ @@ -481,21 +481,17 @@ and the is a writable scalar. The gets the value of the or of all the bits of the src vector. -* %release +* %release/net +* %release/reg Release the force on the signal that is represented by the functor -. The force was previously activated with a %force +. The force was previously activated with a %force/v statement. If no force was active on this functor the statement does -nothing. %release restores and propagates the normal value of the -previously forced functor. In case of a forced Verilog register, the -current value of the force expression should be %set to the .var -functor before the force is released, to comply with Verilog release -semantics. Like: - - %load , ; get the forced value - %set , ; set the .var value - %release ; remove the force - +nothing. The %release/net sends to the labeled functor the release +command with net semantics: the unforced value is propagated to the +output of the signal after the release is complete. The %release/reg +sends the release command with reg semantics: the signal holds its +forced value until another value propagates through. * %set/v , , diff --git a/vvp/vthread.cc b/vvp/vthread.cc index 525ad5f93..1a2951e24 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -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.124 2004/12/15 17:17:42 steve Exp $" +#ident "$Id: vthread.cc,v 1.125 2004/12/17 04:47:47 steve Exp $" #endif # include "config.h" @@ -2550,6 +2550,34 @@ bool of_NOR(vthread_t thr, vvp_code_t cp) return true; } +/* + * These implement the %release/net and %release/reg instructions. The + * %release/net instruction applies to a net kind of functor by + * sending the release/net command to the command port. (See vvp_net.h + * for details.) The %release/reg instruction is the same, but sends + * the release/reg command instead. These are very similar to the + * %deassign instruction. + */ +bool of_RELEASE_NET(vthread_t thr, vvp_code_t cp) +{ + vvp_net_t*net = cp->net; + + vvp_net_ptr_t ptr (net, 3); + vvp_send_long(ptr, 2); + + return true; +} + +bool of_RELEASE_REG(vthread_t thr, vvp_code_t cp) +{ + vvp_net_t*net = cp->net; + + vvp_net_ptr_t ptr (net, 3); + vvp_send_long(ptr, 3); + + return true; +} + static const unsigned char strong_values[4] = {St0, St1, StX, HiZ}; bool of_SET_MEM(vthread_t thr, vvp_code_t cp) @@ -3007,6 +3035,9 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp) /* * $Log: vthread.cc,v $ + * Revision 1.125 2004/12/17 04:47:47 steve + * Replace single release with release/net and release/reg. + * * Revision 1.124 2004/12/15 17:17:42 steve * Add the force/v instruction. *