RE: [sv-ec] dist operator should be removed from precedense table

From: Tipp, Brandon P <brandon.p.tipp@intel.com>
Date: Thu Nov 15 2012 - 07:23:23 PST
The dist *operator* needs to have a defined precedence against other operators.
Based on the precedence table this:
randomize() with {b || a dist {0:=9, 1:=1};};
is the same as this:
randomize() with {b || ( a dist {0:=9, 1:=1});};
which should be illegal (per the rule that a dist expression cannot appear in other expressions)
If it isn't, then there is either something wrong with your simulator or there the precedence table needs to be updated to reflect that dist has a lower precedence than ||.

I agree that the statement "dist expressions cannot appear in other expressions" is redundant with the BNFs.  Much of the language in the LRM is redundant with the BNFs.  In the general case, larger expressions can be composed of smaller expressions and this statement clarifies a limitation for that general assumption, so I don't feel that this redundancy is egregious.  Furthermore, the original e-mail seems to assume that a dist can only exist inside of a constraint. That is not the case; search the spec for "expression_or_dist" and you will find numerous other contexts where a dist is legal and generally treated equivalently to an "inside" expression.  However, the statement "dist expressions cannot appear in other expressions" clarifies that even in those contexts, you cannot compose a larger expression from a dist expression.

Just my thoughts on the subject.

-Brandon



-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Neil Korpusik
Sent: Friday, November 02, 2012 6:10 PM
To: sv-ec@eda.org; danielm@aldec.com
Subject: [sv-ec] dist operator should be removed from precedense table

Forwarding bounced email from danielm@aldec.com

-------- Original Message --------
Date: Thu, 25 Oct 2012 01:33:29 -0700
From: Daniel Mlynek <danielm@aldec.com>


I do not understand why dist operator is in precedence table. From reading LRM I come to conlusion that this cannot be used with other operators in expressions anyway.
For constraints LRM says that :

"*dist *expressions cannot appear in other expressions"

this is redunand imho as even from reading BNF you can see that it can be us ed only with if..else, foreach, -> You cannot write :
randomize() with {*b ||*  (a dist{0:=9, 1:=1};)};

Same for  assertions you cannot have
a1:assume property ( @(posedge clk) a dist {0:=40, 1:=60} *||b*) ;

Having dist in precedence table one may think that below code is illegal:
randomize() with {*b ||*  a dist{0:=9, 1:=1};}; while it is the same as:
randomize() with {*(b ||*  a) dist{0:=9, 1:=1};};

summarizing i think that:
- dist should be removed from precedence table
- statement "*dist *expressions cannot appear in other expressions""
should be removed

DANiel



--
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 Thu Nov 15 07:23:57 2012

This archive was generated by hypermail 2.1.8 : Thu Nov 15 2012 - 07:24:11 PST