[sv-bc] FW: [sv-ec] Issues in Pattern Matching

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Mon Dec 18 2006 - 22:41:18 PST
-----Original Message http://www.eda-stds.org/sv-ec/hm/3917.html -----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Moumita Das
Sent: Monday, December 18, 2006 9:56 PM
To: SV_EC List
Subject: [sv-ec] Issues in Pattern Matching

Hi,

In SV LRM 1800-2005 IEEE Standarad for System Verilog we found a rule-

conditional_statement ::= if ( cond_predicate ) statement_or_null [ else
statement_or_null ]

cond_predicate ::= expression_or_cond_pattern { &&&
expression_or_cond_pattern }

expression_or_cond_pattern ::= expression | cond_pattern

cond_pattern ::= expression matches pattern

So as per BNF  we can use "&&&" operator in condition of if statement
but LRM does not restrict the usage.

And the same thing is also true for conditional expression-

conditional_expression ::= cond_predicate ? { attribute_instance }
expression : expression


but for case statment this "&&&" is used only for pattern matching where
1st expresssion must be a pattern and only one expression can be used 
after "&&&".

So my question is following testcases are vaild or not -

1) if(a!=0 &&& b!=0)
2) assign y = a > b &&& b > c  ? c : d

If there are valid cases then what will be the semantic difference 
between "&&" and "&&&".


Also LRM is not clear on the associativity of "matches" and "&&&".
So following case
assign y = a > b matches b ? c : d

will be resolved as:
assign y = (a > b) matches b ? c : d
or
assign y = a > ( b matches b? c : d)

Thanks,
Moumita
Received on Mon Dec 18 22:41:28 2006

This archive was generated by hypermail 2.1.8 : Mon Dec 18 2006 - 22:42:36 PST