前言
随机约束,在IC 验证中重要地位就不用多说了。今天复习一下,UVM 验证平台中的constraint 随机约束的使用。
一、约束规则
1.1 《规则》:>, <, >=, <= , ==
我们可以用> < >= <=
等符号来对变量进行简单的约束, 注意的是当要把某个变量设为定值时, 需要使用==
符号。
rand bit [3:0] min, typ, max;
rand bit [3:0] fixed;
constraint my_range_c { 3 < min;
typ < max;
typ > min;
max < 14; }
constraint fixed_c { fixed == 5; }
1.2《规则》:inside
(1) 也可以使用inside
关键字