How to generate an array of unique random values
In short: To generate an array of unique random values in SystemVerilog, mark the array rand and add one unique constraint: constraint c { unique {arr}; }. The solver then fills every element with a different value. You can also list extra values inside the braces to keep those out of the set, which is…
