@@ -750,19 +750,68 @@ program_declaration:
750
750
;
751
751
752
752
checker_declaration:
753
- TOK_CHECKER checker_identifier
754
- {
755
- init ($$, ID_verilog_checker);
756
- stack_expr ($$).set (ID_base_name, stack_expr ($2 ).id ());
757
- }
758
- ' ;'
753
+ TOK_CHECKER { init ($$); } checker_identifier
754
+ checker_port_list_paren_opt ' ;'
759
755
checker_or_generate_item_brace
760
756
TOK_ENDCHECKER
761
757
{
762
- $$ = $3 ;
758
+ init ($$);
759
+ irept attributes;
760
+ exprt parameter_port_list;
761
+ stack_expr ($$) = verilog_parse_treet::create_module (
762
+ attributes, // attributes,
763
+ stack_expr ($2 ), // module_keyword
764
+ stack_expr ($3 ), // name
765
+ parameter_port_list, // parameter_port_list
766
+ stack_expr ($4 ), // ports
767
+ stack_expr ($6 ) // module_items
768
+ );
769
+ stack_expr ($$).id (ID_verilog_checker);
763
770
}
764
771
;
765
772
773
+ checker_port_list_paren_opt:
774
+ /* Optional */
775
+ { init ($$); }
776
+ | ' (' checker_port_list_opt ' )'
777
+ { $$ = $2 ; }
778
+ ;
779
+
780
+ checker_port_list_opt:
781
+ /* Optional */
782
+ { init ($$); }
783
+ | checker_port_list
784
+ ;
785
+
786
+ checker_port_list:
787
+ checker_port_item
788
+ { init ($$); mts ($$, $1 ); }
789
+ | checker_port_list checker_port_item
790
+ { $$ = $1 ; mts ($$, $2 ); }
791
+ ;
792
+
793
+ checker_port_item:
794
+ attribute_instance_brace
795
+ checker_port_direction_opt
796
+ property_formal_type
797
+ formal_port_identifier
798
+ variable_dimension_brace
799
+ { init ($$, ID_decl);
800
+ stack_expr ($$).set (ID_class, stack_expr ($2 ).id ());
801
+ addswap ($$, ID_type, $3 );
802
+ mto ($$, $4 ); /* declarator */
803
+ }
804
+ ;
805
+
806
+ checker_port_direction_opt:
807
+ /* Optional */
808
+ { init ($$); }
809
+ | TOK_INPUT
810
+ { init ($$, ID_input); }
811
+ | TOK_OUTPUT
812
+ { init ($$, ID_output); }
813
+ ;
814
+
766
815
class_declaration:
767
816
TOK_CLASS class_identifier
768
817
' ;'
@@ -1030,7 +1079,9 @@ non_port_interface_item:
1030
1079
1031
1080
checker_or_generate_item_brace:
1032
1081
/* Optional */
1082
+ { init ($$); }
1033
1083
| checker_or_generate_item_brace attribute_instance_brace checker_or_generate_item
1084
+ { $$ = $1 ; mts ($$, $3 ); }
1034
1085
;
1035
1086
1036
1087
checker_or_generate_item:
@@ -2323,7 +2374,8 @@ property_port_item:
2323
2374
;
2324
2375
2325
2376
property_formal_type:
2326
- TOK_PROPERTY
2377
+ sequence_formal_type
2378
+ | TOK_PROPERTY
2327
2379
;
2328
2380
2329
2381
property_spec:
@@ -2334,6 +2386,14 @@ property_spec:
2334
2386
| property_expr
2335
2387
;
2336
2388
2389
+ sequence_formal_type:
2390
+ data_type
2391
+ | TOK_SEQUENCE
2392
+ { init ($$, ID_verilog_sequence); }
2393
+ | TOK_UNTYPED
2394
+ { init ($$, ID_verilog_untyped); }
2395
+ ;
2396
+
2337
2397
// The 1800-2017 grammar has an ambiguity where
2338
2398
// '(' expression ')' can either be an expression or a property_expr,
2339
2399
// which yields a reduce/reduce conflict. Hence, we split the rules
0 commit comments