Subject: RE: [sv-ec] Can an ordering constraint cause the solver to fail ?
From: Mehdi Mohtashemi (Mehdi.Mohtashemi@synopsys.com)
Date: Wed Dec 03 2003 - 13:01:17 PST
Ray,
I think what maybe confusing is the usage of the words, 'solved', 'solution
space',
and 'chosen'. It may make sense to rewrite some of the wordings.
Take the example you had indicated:
class B
rand bit[7:0] x, y;
constraint c1 { 2*y == x; }
constraint ord { solve x before y; }
endclass
Conceptually, the x,y pairs would have all 'solutions' in their 'solution
space',
with each one having 1/128 probability to be 'chosen'.
In this case the solver then 'choses' x, in the solution space before y.
[If we had solve y before x, y would be 'chosen', etc...]
I did a little experiment with Vera equivalent code to the above, with
different variations of the 'solve .. before ..'. One sample result looks
like the following:
With solve x before y
Result: x: 80, y: 40
With solve y before x
Result: x: 96, y: 48
With NO solve statement
Result: x: 96, y: 48
- Mehdi
[The Vera code is very similar to the SV code segment, i am including it
for your reference.
// Vera code
class B {
rand bit [7:0] x, y;
constraint C { 2*y == x; }
constraint E { solve x before y; }
}
program test
{
B b1 = new;
void = b1.randomize();
printf("With solve y before x\n");
printf("Result: x: %0d, y: %0d \n",b1.x, b1.y);
}
// end
This archive was generated by hypermail 2b28 : Wed Dec 03 2003 - 13:02:11 PST