Subject: [sv-ec] FW: Question: Duplicate values in set membership
From: David W. Smith (david.smith@synopsys.com)
Date: Mon Jun 16 2003 - 14:17:12 PDT
Ray Ryan sent the following question to the reflector (bounced due to not
being a member).
Please respond to him as appropriate.
Regards
David
============================================================================
==================
In looking at the Set Membership (12.4.3) for Random Constraints I have a
couple questions.
1) Are the following constraints equivalent?
rand x,y;
constraint c1 {x inside {1:2,2,2,2:3}; }
constraint c2 {(x==1)||(x==2)||(x==2)||(x==2)||(x==2)||(x==3); }
constraint c3 {(x==1)||(x==2)||(x==3); }
constraint c4 (x inside {1:3}; }
I would expect that there is no constraint semantic associated
with a value being repeated in a membership set. That is, the
probability of x==2 is the same for each of the above constraints.
Is this right?
Section 12.4.3 contains the text,
"Absent any other constraints, all values (either single values
or value ranges), have an equal probability of being chosen by
the inside operator."
To me, it is not clear what it means for a single value or value
range to have equal probability.
As I understand it, there are value constraints and distribution
constraints. Value constraints define the set of legal values and
legal combinations of values for random variables. Distribution
constraints control the probability of occurance for legal value
combinations. The 'dist' and 'solve-before' constraints are
distribution constraints, the others (including 'inside') are value
constraints. Is this right?
2) Are the following legal constraints (I expect they are)?
rand x,y,z;
constraint c1 { 2 inside { x, y, z }; }
constraint c2 { 3 inside { x:y }; }
constraint c3 { z inside { x:y }; }
The LRM quote above also seems unclear when applied to these
constraints - i.e. In c1, do x,y,x have equal probability of
being chosen by the inside operator?
Thanks,
Ray
Ray Ryan
Staff Engineer
Mentor Graphics
(408)487-7240
ray_ryan@mentorg.com
This archive was generated by hypermail 2b28 : Mon Jun 16 2003 - 14:17:46 PDT