Jump to content

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?

Link to comment
Share on other sites

  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...