Jump to content
Sign in to follow this  
Mark Christiaens

Semicolon to end an action_body_item?

Recommended Posts

I've noticed this in the PSS grammar:

action_declaration ::= [ abstract ] action action_identifier [ action_super_spec ] { { action_body_item } }[ ; ]
...
action_body_item ::=
 activity_declaration
 | overrides_declaration
 | constraint_declaration
 | action_field_declaration
 | symbol_declaration
 | covergroup_declaration
 | exec_block_stmt
 | static_const_field_declaration
 | action_scheduling_constraint
 | attr_group
 | compile_assert_stmt
 | inline_covergroup
 | action_body_compile_if
...
constraint_declaration ::=
 [ dynamic ] constraint identifier { { constraint_body_item } }
 | constraint { { constraint_body_item } }
 | constraint single_stmt_constraint

But example 3 goes like this:

enum config_modes_e {UNKNOWN, MODE_A=10, MODE_B=20, MODE_C=35,MODE_D=40};
component uart_c {
 action configure {
 rand config_modes_e mode;
 constraint { mode != UNKNOWN; };
 }
};

The line

constraint { mode != UNKNOWN; };
                               ^
                               |
                               |Illegal semicolon?

is a constraint_declaration used as an action_body_item inside an action_declaration.  The grammar says that the constraint_declaration should not be terminated by a semicolon.

Which is correct: the example or the grammar?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×