我有需要以这种方式限制的多个字段:
struct my_struct {
a : uint;
b : uint;
c : uint;
d : uint;
keep 3*a + 4*b + 5*c + 6*d == 206 and a + b + c + d == 50;
my_method() @clk_event is {
while (TRUE) {
if (ctr == 0) {
gen a;
gen b;
gen c;
gen d;
};
if (ctr == 50) {
ctr = 0;
} else {
ctr += 1;
};
wait cycle;
};
};
};
a
我基本上想为、b
、c
和d
定期生成一组新值。上面的代码不起作用,因为它们的值在我的模拟中没有改变。知道怎么做吗?