Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
constraint con{
delay dist {0:/10};
}
The above wording could lead to constraint difficult to solve, do not use the above wording.
2. summation of written and restraint (preventing and overflow)
bd_len_q.sum with(int'(item)) == 20
3. The array elements will not be repeated
class A;
rand bit [31:0] arr[];
constraint arr_size { arr.size() inside {[10:15]}; }
constraint arr_uniq { unique {arr}; }
endclass