class trans extends uvm_sequence_item;
rand int id;
constraint c001{
soft id == 0; //软约束
}
endclass
如果一条激励需要完全随机id,可在该激励中单独关闭软约束
class test extends uvm_test;
trans tr;
tr = new();
tr.randimize with{
disable soft id; //随机时关闭软约束
}
endclass
如何关闭trans中的软约束
最新推荐文章于 2025-01-03 16:58:02 发布