@@ -882,7 +882,7 @@ class_item:
882
882
// | attribute_instance_brace class_method
883
883
// | attribute_instance_brace class_constraint
884
884
attribute_instance_brace class_declaration
885
- // | attribute_instance_brace covergroup_declaration
885
+ | attribute_instance_brace covergroup_declaration
886
886
| local_parameter_declaration ' ;'
887
887
| parameter_declaration ' ;'
888
888
| ' ;'
@@ -1018,6 +1018,7 @@ package_or_generate_item_declaration:
1018
1018
that let constructs may be declared in a
1019
1019
module/interface/program/checker etc. */
1020
1020
| let_declaration
1021
+ | covergroup_declaration
1021
1022
| ' ;'
1022
1023
{ init($$ , ID_verilog_empty_item); }
1023
1024
;
@@ -1249,6 +1250,9 @@ enum_name_declaration_list:
1249
1250
{ $$ =$1 ; mts($$ , $3 ); }
1250
1251
;
1251
1252
1253
+ class_scope : class_type TOK_COLONCOLON
1254
+ ;
1255
+
1252
1256
integer_type :
1253
1257
integer_vector_type
1254
1258
| integer_atom_type
@@ -1828,6 +1832,13 @@ task_declaration:
1828
1832
task_prototype : TOK_TASK task_identifier
1829
1833
;
1830
1834
1835
+ tf_port_list_paren_opt :
1836
+ /* Optional */
1837
+ { init($$ ); }
1838
+ | ' (' tf_port_list_opt ' )'
1839
+ { $$ = $2 ; }
1840
+ ;
1841
+
1831
1842
tf_port_list_opt :
1832
1843
/* Optional */
1833
1844
{ init($$ ); }
@@ -2002,6 +2013,55 @@ expression_or_dist:
2002
2013
expression
2003
2014
;
2004
2015
2016
+ // System Verilog standard 1800-2017
2017
+ // A.2.11 Covergroup declarations
2018
+
2019
+ covergroup_declaration :
2020
+ TOK_COVERGROUP new_identifier tf_port_list_paren_opt coverage_event_opt ' ;'
2021
+ coverage_spec_or_option_brace TOK_ENDGROUP
2022
+ { init($$ , ID_verilog_covergroup); }
2023
+ ;
2024
+
2025
+ coverage_spec_or_option_brace :
2026
+ /* Optional */
2027
+ | coverage_spec_or_option_brace coverage_spec_or_option
2028
+ ;
2029
+
2030
+ coverage_spec_or_option :
2031
+ attribute_instance_brace coverage_spec
2032
+ ;
2033
+
2034
+ coverage_spec :
2035
+ cover_point
2036
+ ;
2037
+
2038
+ coverage_event_opt :
2039
+ /* Optional */
2040
+ | coverage_event
2041
+ ;
2042
+
2043
+ coverage_event :
2044
+ clocking_event
2045
+ ;
2046
+
2047
+ block_event_expression :
2048
+ block_event_expression TOK_OR block_event_expression
2049
+ | TOK_BEGIN hierarchical_btf_identifier
2050
+ | TOK_END hierarchical_btf_identifier
2051
+ ;
2052
+
2053
+ hierarchical_btf_identifier :
2054
+ hierarchical_tf_identifier
2055
+ | hierarchical_block_identifier
2056
+ | method_identifier
2057
+ | hierarchical_identifier ' .' method_identifier
2058
+ | class_scope method_identifier
2059
+ ;
2060
+
2061
+ cover_point :
2062
+ TOK_COVERPOINT expression ' ;'
2063
+ ;
2064
+
2005
2065
// System Verilog standard 1800-2017
2006
2066
// A.2.12 Let declarations
2007
2067
@@ -2845,6 +2905,11 @@ procedural_timing_control:
2845
2905
// System Verilog standard 1800-2017
2846
2906
// A.6.11 Clocking block
2847
2907
2908
+ clocking_event :
2909
+ ' @' identifier
2910
+ | ' @' ' (' event_expression ' )'
2911
+ ;
2912
+
2848
2913
cycle_delay :
2849
2914
" ##" number
2850
2915
{ init($$ , ID_verilog_cycle_delay); mto($$ , $2 ); }
@@ -3329,6 +3394,8 @@ ps_covergroup_identifier:
3329
3394
3330
3395
memory_identifier: identifier;
3331
3396
3397
+ method_identifier: identifier;
3398
+
3332
3399
type_identifier: TOK_TYPE_IDENTIFIER
3333
3400
{
3334
3401
init($$, ID_typedef_type);
@@ -3362,6 +3429,8 @@ function_identifier: hierarchical_identifier
3362
3429
3363
3430
hierarchical_event_identifier: event_identifier;
3364
3431
3432
+ hierarchical_block_identifier: hierarchical_identifier;
3433
+
3365
3434
hierarchical_identifier:
3366
3435
identifier
3367
3436
| hierarchical_identifier ' . ' identifier
0 commit comments