SV constraint parser

Is there any System Verilog parser available that can parse through SV constraints file and after resolving the dependencies of rand variables calculate the probability of a variable to take a certain value?

In reply to ruchitachaddha:

Hi ,

I would really like to know why this requirement has arised !!

In reply to DigvijayS:

This is needed for Coverage analysis. I have multiple variables with several layers of dependencies. Even after running some thousands of seeds, there are certain Coverage scenarios that I don’t hit. So if I can figure out the probability of different variables that make up that scenario, I can calculate the probability of happening of that scenario(Cover group). So then I know I have to run 10,000 seeds instead of just 1000 seeds to hit a CoverGroup.

In reply to ruchitachaddha:

1).To resolve variable dependencies “solve… before…” construct can be used.

i.e. constraint solve_order { solve var1 before var2 ;}

2).For identifying probability of randomly generated values,“Weighted Distribution” can be used in constraints.

i.e. constraint weighted_dist { Var1 dist {val1 := 1, [val2:val7] :/ 3, [val8:val15] :/ 4}; }

In reply to DigvijayS:

Probably dint explain my question probably.
I have written all my constraints and given them probability based on weighted distribution etc. But there is not just 1 constraint per variable. There are multiple constraints on one variable. After resolving all those constraints what is the probability of variable taking a certain value?

using your eg:
constraint1 weighted_dist { Var1 dist {val1 := 1, [val2:val7] :/ 3, [val8:val15] :/ 4}; }
constraint2 weighted_dist { Var2 dist {val1 := 1, [val2:val7] :/ 3, [val8:val15] :/ 4}; }

constraint3 (Var2==val1) → Var1 dist {val1 := 0, [val2:val7] := 5, [val8:val15] := 5};

After resolving above 3 constraints, what is the probability of Var1 to be == Val2 ??
You could do it manually, but i wanted to know if there is a parser that could do that for us?

In reply to ruchitachaddha:

Hi Ruchita,

Thanks for clarifying my understanding.Now I got your point.
Hope somebody can provide solution for this :)