mardi 16 juin 2020

system verilog randc behavior when constraint condition changes

I read that the permutation sequence of randc variable changes when the constraint on the variable changes. But considering the below example, where the constraint is not re-defined but the condition (y) changes - is there a chance that the permutation sequence of randc variable is recomputed ?

randc bit [5:0] x;
rand bit y;                                                                                                                                                         

constraint  c_x {
    (y)  -> {x inside {[10:13]}};
    (!y) -> {x inside {[20:23]}};
}

I tested it and even though 'y' changes for every randomize() call - the permutation seq of x is not changing. Just wanted to understand this finer detail of randc.




Aucun commentaire:

Enregistrer un commentaire