Hello All,
I want to write a constraint on a variable "CHOOSE" that depends one a variable "AVAILABLE" with following rules : -
1) AVAILABLE IS OF 16 BITS
If AVAILABLE ='hFFFF means CHOOSE can be --> {0,15} (as each AVAILABLE[0] to AVAILABLE[15] is set )
if AVAILABLE ='hFFF3 means CHOOSE can be --> any value {0,15} except 2,3
So it follows that CHOOSE can be value corresponding to the bit positions set in AVAILABLE. Ias there anyway to write it in constraint.
I have another way of doing it through do while loop as shown below.
if(AVAILABLE>0)
begin
do
CHOOSE =$urandom_range(0,15);
while(!AVAILABLE[CHOOSE]); ///will select random value whose bits are set
end
But I want to put it in constraint.Is there any way of doing the same thing in construct.
Thanks In advance.