Generate code for disable.

This commit is contained in:
steve 2001-04-21 00:55:46 +00:00
parent 66f83f3b08
commit c97692d715
4 changed files with 60 additions and 24 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: ivl_target.h,v 1.52 2001/04/15 02:58:11 steve Exp $" #ident "$Id: ivl_target.h,v 1.53 2001/04/21 00:55:46 steve Exp $"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
@ -710,7 +710,7 @@ extern ivl_statement_type_t ivl_statement_type(ivl_statement_t net);
extern unsigned ivl_stmt_block_count(ivl_statement_t net); extern unsigned ivl_stmt_block_count(ivl_statement_t net);
/* IVL_ST_BLOCK, IVL_ST_FORK */ /* IVL_ST_BLOCK, IVL_ST_FORK */
extern ivl_statement_t ivl_stmt_block_stmt(ivl_statement_t net, unsigned i); extern ivl_statement_t ivl_stmt_block_stmt(ivl_statement_t net, unsigned i);
/* IVL_ST_UTASK */ /* IVL_ST_UTASK IVL_ST_DISABLE */
extern ivl_scope_t ivl_stmt_call(ivl_statement_t net); extern ivl_scope_t ivl_stmt_call(ivl_statement_t net);
/* IVL_ST_CASE */ /* IVL_ST_CASE */
extern unsigned ivl_stmt_case_count(ivl_statement_t net); extern unsigned ivl_stmt_case_count(ivl_statement_t net);
@ -765,6 +765,9 @@ _END_DECL
/* /*
* $Log: ivl_target.h,v $ * $Log: ivl_target.h,v $
* Revision 1.53 2001/04/21 00:55:46 steve
* Generate code for disable.
*
* Revision 1.52 2001/04/15 02:58:11 steve * Revision 1.52 2001/04/15 02:58:11 steve
* vvp support for <= with internal delay. * vvp support for <= with internal delay.
* *

24
parse.y
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: parse.y,v 1.118 2001/01/14 23:04:56 steve Exp $" #ident "$Id: parse.y,v 1.119 2001/04/21 00:55:46 steve Exp $"
#endif #endif
# include "parse_misc.h" # include "parse_misc.h"
@ -1802,13 +1802,7 @@ register_variable_list
specify_item specify_item
: K_specparam specparam_list ';' : K_specparam specparam_list ';'
| specify_simple_path '=' '(' delay_value ')' ';' | specify_simple_path '=' '(' specify_delay_value_list ')' ';'
{
}
| specify_simple_path '=' '(' delay_value ',' delay_value ')' ';'
{
}
| specify_simple_path '=' '(' delay_value ',' delay_value ',' delay_value ')' ';'
{ {
} }
| specify_simple_path '=' delay_value_simple ';' | specify_simple_path '=' delay_value_simple ';'
@ -1816,14 +1810,24 @@ specify_item
} }
; ;
specify_delay_value_list
: delay_value { }
| specify_delay_value_list ',' delay_value { }
;
specify_item_list specify_item_list
: specify_item : specify_item
| specify_item_list specify_item | specify_item_list specify_item
; ;
specify_simple_path specify_simple_path
: '(' IDENTIFIER spec_polarity K_EG IDENTIFIER ')' : '(' specify_path_identifiers spec_polarity K_EG IDENTIFIER ')'
| '(' IDENTIFIER spec_polarity K_SG IDENTIFIER ')' | '(' specify_path_identifiers spec_polarity K_SG IDENTIFIER ')'
;
specify_path_identifiers
: IDENTIFIER { }
| specify_path_identifiers ',' IDENTIFIER { }
; ;
specparam specparam

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll-api.cc,v 1.38 2001/04/15 02:58:11 steve Exp $" #ident "$Id: t-dll-api.cc,v 1.39 2001/04/21 00:55:46 steve Exp $"
#endif #endif
# include "t-dll.h" # include "t-dll.h"
@ -669,6 +669,9 @@ extern "C" ivl_statement_t ivl_stmt_block_stmt(ivl_statement_t net,
extern "C" ivl_scope_t ivl_stmt_call(ivl_statement_t net) extern "C" ivl_scope_t ivl_stmt_call(ivl_statement_t net)
{ {
switch (net->type_) { switch (net->type_) {
case IVL_ST_DISABLE:
return net->u_.disable_.scope;
case IVL_ST_UTASK: case IVL_ST_UTASK:
return net->u_.utask_.def; return net->u_.utask_.def;
default: default:
@ -903,6 +906,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/* /*
* $Log: t-dll-api.cc,v $ * $Log: t-dll-api.cc,v $
* Revision 1.39 2001/04/21 00:55:46 steve
* Generate code for disable.
*
* Revision 1.38 2001/04/15 02:58:11 steve * Revision 1.38 2001/04/15 02:58:11 steve
* vvp support for <= with internal delay. * vvp support for <= with internal delay.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #if !defined(WINNT)
#ident "$Id: vvp_process.c,v 1.28 2001/04/18 05:12:03 steve Exp $" #ident "$Id: vvp_process.c,v 1.29 2001/04/21 00:55:46 steve Exp $"
#endif #endif
# include "vvp_priv.h" # include "vvp_priv.h"
@ -215,6 +215,19 @@ static int show_stmt_assign_nb(ivl_statement_t net)
return 0; return 0;
} }
static int show_stmt_block(ivl_statement_t net, ivl_scope_t sscope)
{
int rc = 0;
unsigned idx;
unsigned cnt = ivl_stmt_block_count(net);
for (idx = 0 ; idx < cnt ; idx += 1) {
rc += show_statement(ivl_stmt_block_stmt(net, idx), sscope);
}
return rc;
}
static int show_stmt_case(ivl_statement_t net, ivl_scope_t sscope) static int show_stmt_case(ivl_statement_t net, ivl_scope_t sscope)
{ {
ivl_expr_t exp = ivl_stmt_cond_expr(net); ivl_expr_t exp = ivl_stmt_cond_expr(net);
@ -363,6 +376,16 @@ static int show_stmt_delay(ivl_statement_t net, ivl_scope_t sscope)
return rc; return rc;
} }
static int show_stmt_disable(ivl_statement_t net, ivl_scope_t sscope)
{
int rc = 0;
ivl_scope_t target = ivl_stmt_call(net);
fprintf(vvp_out, " %%disable S_%s;\n", ivl_scope_name(target));
return rc;
}
static int show_stmt_forever(ivl_statement_t net, ivl_scope_t sscope) static int show_stmt_forever(ivl_statement_t net, ivl_scope_t sscope)
{ {
int rc = 0; int rc = 0;
@ -577,16 +600,9 @@ static int show_statement(ivl_statement_t net, ivl_scope_t sscope)
rc += show_stmt_assign_nb(net); rc += show_stmt_assign_nb(net);
break; break;
/* Begin-end blocks simply draw their contents. */ case IVL_ST_BLOCK:
case IVL_ST_BLOCK: { rc += show_stmt_block(net, sscope);
unsigned idx;
unsigned cnt = ivl_stmt_block_count(net);
for (idx = 0 ; idx < cnt ; idx += 1) {
rc += show_statement(ivl_stmt_block_stmt(net, idx),
sscope);
}
break; break;
}
case IVL_ST_CASE: case IVL_ST_CASE:
case IVL_ST_CASEX: case IVL_ST_CASEX:
@ -602,6 +618,10 @@ static int show_statement(ivl_statement_t net, ivl_scope_t sscope)
rc += show_stmt_delay(net, sscope); rc += show_stmt_delay(net, sscope);
break; break;
case IVL_ST_DISABLE:
rc += show_stmt_disable(net, sscope);
break;
case IVL_ST_FOREVER: case IVL_ST_FOREVER:
rc += show_stmt_forever(net, sscope); rc += show_stmt_forever(net, sscope);
break; break;
@ -729,6 +749,9 @@ int draw_func_definition(ivl_scope_t scope)
/* /*
* $Log: vvp_process.c,v $ * $Log: vvp_process.c,v $
* Revision 1.29 2001/04/21 00:55:46 steve
* Generate code for disable.
*
* Revision 1.28 2001/04/18 05:12:03 steve * Revision 1.28 2001/04/18 05:12:03 steve
* Use the new %fork syntax. * Use the new %fork syntax.
* *