Re: [sv-ec] Question on DIST constraints


Subject: Re: [sv-ec] Question on DIST constraints
From: Arturo Salz (Arturo.Salz@synopsys.com)
Date: Thu Jul 03 2003 - 17:11:53 PDT


Ryan,

1) In a distribution, both the value and weight can be random
    variables. This means that all your examples below are legal
    (c4 has a minor typo: /= should be :/ or /=).
    One way to think about distributions is that the dist operator
    can be translated into an equivalent set of equations that use
    implication. For example,the constraint (in its general form):
        x dist { v1 := w1, v2 := w2 };
    could be written as the following set of constraints:
        range = w1 + w2;
        j >= 0 && j < range
        (j < w1) => (x == v1);
        (j >= w1) => (x == v2);
    where range and j are auxiliary variables.

    Since implication is "bi-directional", solving the alternate set of
    constraints also yields a bidirectional dist operator. A more difficult
    question is how does having random weight variables modify the
    solution space, and I haven't the foggiest idea (and I suspect any
    user that does this will not know either). I believe that different
    implementations that exploit the ordering are also possible.

2) Values and ranges in a distribution can overlap. The constraints
    you list are both legal and equivalent:
        constraint c1 { x dist { 0:=100, [0:9]:/100, [0:3]:/100 }; }
    is indeed equivalent to:
         constraint c2 { x dist { 0:=135, [1:3]:=35, [4:9]:=25 }; }

    Arturo

----- Original Message -----
From: "Ryan, Ray" <Ray_Ryan@mentorg.com>
To: "'sv-ec@server.eda.org'" <sv-ec@eda.org>
Sent: Thursday, July 03, 2003 10:07 AM
Subject: [sv-ec] Question on DIST constraints

Arturo,

Thanks for your answers to my other questions
regarding constaints and randomization.

In looking at the distribution constraints for random
variables (12.4.4 Distribution):

1) In a distribution constraint, can a value expression include
   a random variable? Can a weight expresion include a random
   variable? (It would expect that a weight expression should
   not include an active random variable.)

   That is, are the following constraints legal?

     rand integer x,y,z;

     constraint c1 { x dist { y:=9, z:=1 }; }
     constraint c2 { x dist { 0:=y, [1:10]:/z, [11:15]:=1 }; }
     constraint c3 { x dist { y:=z, 0:=1 }; }
     constraint c4 { x dist { [y:z]/=100, 0:=1 }; }
     constraint c5 { x dist { y:=x, z:=z }; }

   If it is legal for a weight to include an active random variable,
   what is the semantic for these constraints? What is the order of
   solving for x,y,z?

   Are these constraints 'bidirectional' (like the 'inside' constraint)?

2) Can the values and ranges in a distribution constraint overlap?
   Are the following legal?

      rand integer x,y,z;

      constraint c1 { x dist { 0:=100, [0:9]:/100, [0:3]:/100 }; }

   Is this equivalent to:
     constraint c2 { x dist { 0:=(100+10+25), [1:3]:=(10+25), [4:9]:=25 }; }

Thanks,
Ray



This archive was generated by hypermail 2b28 : Thu Jul 03 2003 - 17:09:15 PDT