From c97692d7154330f7ab428c4437274dd2d7ccb42c Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 21 Apr 2001 00:55:46 +0000 Subject: [PATCH] Generate code for disable. --- ivl_target.h | 7 +++++-- parse.y | 24 +++++++++++++---------- t-dll-api.cc | 8 +++++++- tgt-vvp/vvp_process.c | 45 ++++++++++++++++++++++++++++++++----------- 4 files changed, 60 insertions(+), 24 deletions(-) diff --git a/ivl_target.h b/ivl_target.h index d1d05e849..5ef84827d 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #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 #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); /* IVL_ST_BLOCK, IVL_ST_FORK */ 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); /* IVL_ST_CASE */ extern unsigned ivl_stmt_case_count(ivl_statement_t net); @@ -765,6 +765,9 @@ _END_DECL /* * $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 * vvp support for <= with internal delay. * diff --git a/parse.y b/parse.y index 00b1a7022..07da95478 100644 --- a/parse.y +++ b/parse.y @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #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 # include "parse_misc.h" @@ -1802,13 +1802,7 @@ register_variable_list specify_item : K_specparam specparam_list ';' - | specify_simple_path '=' '(' delay_value ')' ';' - { - } - | specify_simple_path '=' '(' delay_value ',' delay_value ')' ';' - { - } - | specify_simple_path '=' '(' delay_value ',' delay_value ',' delay_value ')' ';' + | specify_simple_path '=' '(' specify_delay_value_list ')' ';' { } | 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 | specify_item_list specify_item ; specify_simple_path - : '(' IDENTIFIER spec_polarity K_EG IDENTIFIER ')' - | '(' IDENTIFIER spec_polarity K_SG IDENTIFIER ')' + : '(' specify_path_identifiers spec_polarity K_EG IDENTIFIER ')' + | '(' specify_path_identifiers spec_polarity K_SG IDENTIFIER ')' + ; + +specify_path_identifiers + : IDENTIFIER { } + | specify_path_identifiers ',' IDENTIFIER { } ; specparam diff --git a/t-dll-api.cc b/t-dll-api.cc index 023ba2061..b5222740d 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #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 # 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) { switch (net->type_) { + case IVL_ST_DISABLE: + return net->u_.disable_.scope; + case IVL_ST_UTASK: return net->u_.utask_.def; default: @@ -903,6 +906,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) /* * $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 * vvp support for <= with internal delay. * diff --git a/tgt-vvp/vvp_process.c b/tgt-vvp/vvp_process.c index c2d1d9e37..7c4dde3eb 100644 --- a/tgt-vvp/vvp_process.c +++ b/tgt-vvp/vvp_process.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #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 # include "vvp_priv.h" @@ -215,6 +215,19 @@ static int show_stmt_assign_nb(ivl_statement_t net) 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) { 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; } +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) { 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); break; - /* Begin-end blocks simply draw their contents. */ - case IVL_ST_BLOCK: { - 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; - } + case IVL_ST_BLOCK: + rc += show_stmt_block(net, sscope); + break; case IVL_ST_CASE: 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); break; + case IVL_ST_DISABLE: + rc += show_stmt_disable(net, sscope); + break; + case IVL_ST_FOREVER: rc += show_stmt_forever(net, sscope); break; @@ -729,6 +749,9 @@ int draw_func_definition(ivl_scope_t scope) /* * $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 * Use the new %fork syntax. *