From f536a43e92c80579e33b820d81fe057ca7b00400 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 16 Apr 2013 14:39:54 -0700 Subject: [PATCH] Add support for timeunit / --- parse.y | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/parse.y b/parse.y index 49c2c30f8..ab0429375 100644 --- a/parse.y +++ b/parse.y @@ -1847,6 +1847,10 @@ tf_port_list /* IEEE1800-2005: A.2.7 */ timeunits_declaration /* IEEE1800-2005: A.1.2 */ : K_timeunit TIME_LITERAL ';' { pform_set_timeunit($2, false, false); } + | K_timeunit TIME_LITERAL '/' TIME_LITERAL ';' + { pform_set_timeunit($2, false, false); + pform_set_timeprecision($4, false, false); + } | K_timeprecision TIME_LITERAL ';' { pform_set_timeprecision($2, false, false); } ; @@ -3895,14 +3899,20 @@ cont_assign_list /* We allow zero, one or two unique declarations. */ local_timeunit_prec_decl_opt : /* Empty */ - | local_timeunit_prec_decl - | local_timeunit_prec_decl local_timeunit_prec_decl + | K_timeunit TIME_LITERAL '/' TIME_LITERAL ';' + { pform_set_timeunit($2, true, false); + have_timeunit_decl = true; + pform_set_timeprecision($4, true, false); + have_timeprec_decl = true; + } + | local_timeunit_prec_decl + | local_timeunit_prec_decl local_timeunit_prec_decl2 ; /* By setting the appropriate have_time???_decl we allow only one declaration of each type in this module. */ local_timeunit_prec_decl - : K_timeunit TIME_LITERAL ';' + : K_timeunit TIME_LITERAL ';' { pform_set_timeunit($2, true, false); have_timeunit_decl = true; } @@ -3911,6 +3921,21 @@ local_timeunit_prec_decl have_timeprec_decl = true; } ; +local_timeunit_prec_decl2 + : K_timeunit TIME_LITERAL ';' + { pform_set_timeunit($2, true, false); + have_timeunit_decl = true; + } + | K_timeprecision TIME_LITERAL ';' + { pform_set_timeprecision($2, true, false); + have_timeprec_decl = true; + } + /* As the second item this form is always a check. */ + | K_timeunit TIME_LITERAL '/' TIME_LITERAL ';' + { pform_set_timeunit($2, true, true); + pform_set_timeprecision($4, true, true); + } + ; /* This is the global structure of a module. A module in a start section, with optional ports, then an optional list of module @@ -4414,6 +4439,10 @@ module_item | K_timeunit_check TIME_LITERAL ';' { pform_set_timeunit($2, true, true); } + | K_timeunit_check TIME_LITERAL '/' TIME_LITERAL ';' + { pform_set_timeunit($2, true, true); + pform_set_timeprecision($4, true, true); + } | K_timeprecision_check TIME_LITERAL ';' { pform_set_timeprecision($2, true, true); } ;