|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
请问怎么给二维数组写求和约束?我这样写报错sum with cannot be resolved
module demo;
class test;
rand int rate[4][40];
int a,b;
constraint rate_cfg {
foreach(rate[i,j]) {
rate[i][j] dist {10:=1,25:=1,40:=1,50:=2,100:=1,200:=1,400:=1};
rate[i][0] == 50;
rate[i][39] == 50;
rate[i][2] > 0;
rate[i][2] < 39;
rate[i][j] > 0;
rate[i][j] <= 50;
a == rate[i][2].sum with(item.index);
b == rate[i][j].sum with(int'(item.index));
a+b <= 4000;
}
}
endclass
endmodule
|
|