Daniel,
Not necessarily - this is only my opinion.
What is definitely forbidden is:
1) 4-state constrains. For example, an explicit X or Z (i.e., a > 3'b1X0) or a state variable that is X.
2) Constraints whose solution require assigning am X to a random variable.
The example you show may simply have no solution is a 2-state space - not necessarily forbidden. The reason for the subtle difference is that the reason for the limitation is precisely so that the solver can deal with 2-state problems - and solving a problem in which a subexpression may evaluate to X would force the solver to operate in the 4-state space, if only to identify the problem, which is not in the spirit of the limitation. As Ray noted, many of these issues can be bypassed creative factoring of the problem.
Arturo
-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Neil Korpusik
Sent: Thursday, November 17, 2011 6:24 PM
To: SV_EC List
Subject: Re: [sv-ec] handling x's in expressions in constrants
<forwarding bounced email from Daniel Mlynek>
Date: Thu, 17 Nov 2011 08:03:50 +0100
From: Daniel Mlynek <danielm@aldec.com>
To: "Ryan, Ray" <Ray_Ryan@mentor.com>
CC: Daniel Mlynek <danielm@aldec.com.pl>, "sv-ec@eda.org" <sv-ec@eda.org>
Subject: Re: [sv-ec] handling x's in expressions in constrants
This is my doubt LRM do not precise when x's are forbidden. Both my questions in fact have common root.
In yours interpretation x's occuring on contraints subexpression level are ok - I assume that x's on contraints expression level would be illegal ie:
constraint c1{(a/b==1) }; //b ==0 not rand
DANiel
On 11/17/2011 5:54 AM, Ryan, Ray wrote:
>
> Daniel,
>
> It has been pointed out to me that in the second example I was
> overlooking the "|| (b == 0)".
>
> With 'b' having a constant value of 0, the constraint effectively becomes:
>
> ( (a/0) == 1) || TRUE
>
> This constraint can be reduced to 'TRUE' leaving 'a' unconstrained.
>
> Regards,
>
> Ray
>
> *From:*owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] *On Behalf Of
> *Ryan, Ray
> *Sent:* Wednesday, November 16, 2011 9:04 AM
> *To:* Daniel Mlynek; sv-ec@eda.org
> *Subject:* RE: [sv-ec] handling x's in expressions in constrants
>
> Daniel,
>
> In my opinion,
>
> the constraint:
>
> ( (a/b) == 1) || (b==0)
>
> Is equivalent to:
>
> If (b != 0) { (a/b) == 1; }
>
> The solver should allow solutions with b == 0.
>
> In the second case, you have effectively have the constraint:
>
> (a / 0) == 1;
>
> There isn't explicitly an 'x' -- rather for any value of 'a' the
> result of "a / 0" is 'x'. Since 'x' is not allowed, this implies that
> there is no legal value for 'a'. Thus the randomize result is 0.
>
> Regards,
>
> Ray Ryan
>
> *From:*owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] *On Behalf Of
> *Daniel Mlynek
> *Sent:* Wednesday, November 16, 2011 4:35 AM
> *To:* sv-ec@eda.org
> *Subject:* [sv-ec] handling x's in expressions in constrants
>
> I've doubts on how x's should be handled by solver. LRM say only that
> x's are illegal in constraints but give no more detail on complex expr
> behaviour
>
> Please see examples - my questions are in comments
>
> class C;
> rand reg[1:0] a,b;
> constraint c1{(a/b==1) || (b==0);};
> function void post_randomize;
> $display("%d %d",a,b);
> endfunction
> endclass
>
> module top;
> C c =new;
> initial begin
> repeat (15)//should solver allow b==0 to be randomized or should
> not (bcos of x result in 2nd part of expr - a/b==1)??
> assert(c.randomize) else $display("failure");
> c.b=0;
> repeat (15) //should fail immediately bcos of x's or only x's on
> top level expr should results in runtime failure???
> assert(c.randomize(a)) else $display("failure");
> end
> endmodule
>
>
>
> 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 17 18:37:58 2011
This archive was generated by hypermail 2.1.8 : Thu Nov 17 2011 - 18:38:00 PST