[sv-bc] RE: Query on Formal Syntax of property_case_item [SV 2012]

From: Steven Sharp <sharp@cadence.com>
Date: Tue Oct 07 2014 - 13:53:35 PDT
The 2009 BNF required a semicolon after a property_case_item, except if that item was itself a case..endcase.

I read Ed Cerny's description in the Mantis note about a backward incompatibility that probably applied to an earlier proposal.  This required a semicolon after endcase.  I assumed that the semicolon was made optional to try to get rid of this, and that the description of the backward incompatibility in the proposal itself was just saying that an optional semicolon was now allowed after the endcase, and that losing the required semicolon after other items was unintentional.  Reading it more carefully, it does say that a semicolon is optional "regardless [of] the kind of top-level property operator".

This may go beyond consistency with the procedural syntax.  It may lead to ambiguity in the grammar, or at least difficulty in parsing it for both tools and humans.

Omitting the semicolon between the ending property_expr of one property_case_item and the expression_or_dist at the start of the next property_case_item appears to allow two adjacent expressions with no delimiters.  A property_expr can be a sequence_expr, which can be an expression_or_dist.  Both adjacent expression_or_dist can be expressions.

Two adjacent expressions with no delimiters appears to be a grammar ambiguity, because there are expression operators that can be either unary or binary, such as |.  If you have "a | b | c" as two adjacent expressions, the separation could either be "a | b ; |c", or "a; |b | c".


-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of John Havlicek
Sent: Tuesday, October 07, 2014 8:57 AM
To: sv-ac@eda.org; sv-bc@eda.org
Subject: [sv-bc] RE: Query on Formal Syntax of property_case_item [SV 2012]

The backward incompatibility note of the proposal for Mantis 3525 does say that there is now an optional ";" after property_expr in property_case_item.  That is just to say that I don't think this syntactic phenomenon was unconsidered and unintentional, even if undesirable.

Originally, the sequence and property constructs followed an expression-like syntax, and this made for challenges in bringing in statement-like constructs such as "case" and "if-else".  In the past, I argued that we need "case" and "if-else" in assertions, but it would be bad if the semicolon rules forced inconsistencies with the way "case" and "if-else" look in procedural code.

There was ugliness.

But the committee opted for relaxed rules that allow the assertion code to follow a style that is similar to procedural code, e.g. by allowing semicolon after a Boolean property statement in a case item and by not requiring semicolon after endcase of a case statement standing as property statement in a case item.  The relaxed rules also allow code that has a style unlike procedural code, as in the examples motivating Mantis 5038.

I will be happy to have a better overall solution, and I think it will be great if SV-BC can help.  My hope is that alignment of assertion syntax with procedural code stays in the discussion.

J.H. 

From: owner-sv-ac@eda.org [mailto:owner-sv-ac@eda.org] On Behalf Of Bresticker, Shalom
Sent: Tuesday, October 07, 2014 1:34 AM
To: sv-ac@eda.org
Subject: [sv-ac] FW: Query on Formal Syntax of property_case_item [SV 2012]



From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Steven Sharp
Sent: Tuesday, October 07, 2014 09:16
To: Datta, Kausik; sv-bc@eda.org
Subject: [sv-bc] RE: Query on Formal Syntax of property_case_item [SV 2012]

This appears to be an unintentional side-effect of the changes for Mantis 3525.  I have filed a new Mantis 5038.

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Datta, Kausik
Sent: Monday, October 06, 2014 9:30 AM
To: sv-bc@eda.org
Subject: [sv-bc] Query on Formal Syntax of property_case_item [SV 2012]

Hi,

In SV 2012 LRM the semicolon [;] in property_case_item is optional, this means writing two expressions without any symbol in between is valid in SV.

For example  the following syntax is a valid one as per LRM

case (expr1) expr2 : expr3 expr4 : expr5 endcase where there is no delimiter in between expr3 and expr4.

Is this an intended syntax? But all examples in this area in LRM has [;] after property_expr.

Formal Syntax:
property_expr ::= case ( expression_or_dist ) property_case_item { property_case_item } endcase

property_case_item::=
expression_or_dist { , expression_or_dist } : property_expr [ ; ]
| default [ : ] property_expr [ ; ]

Thanks
Kausik Datta


--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. 

--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. 
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. 

--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Oct 7 13:54:33 2014

This archive was generated by hypermail 2.1.8 : Tue Oct 07 2014 - 13:54:41 PDT