Distribute with exclude some values systemverilog

Hi,
I would like distribute my rand variable within a filtered range, Which mean I need to attach the “with” clause to the "dist"or “inside”. Is it supported ? If not, what’s the quality code to do so ?


rand_val dist {signed'(-fact):= 1,
               [-fact : fact]:/1 with(item < cond && item%2==0),
                fact:=1};

Cheers, Shaboon

In reply to ashaboon:
You simply write additional constraints, which take precedence over the distribution.

constraint c{
  rand_val dist {signed'(-fact):= 1,
               [-fact+1 : fact-1]:/1 ,
                fact:=1};
  rand_val < cond;
  rand_val %2==0;
}

In reply to dave_59:

Thanks… I have done like that, was looking if it could be done in another way :).
Thanks for being around Dave.