[SV] encountered problems Constraint

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.
This link: https://blog.csdn.net/lbt_dvshare/article/details/101680062
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

 

Guess you like

Origin blog.csdn.net/lbt_dvshare/article/details/101680062