|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
ex:
test.v
module test(
a,b
);
parameter AA = 1;
input a;
output b;
assign b = AA==1'b1 ? a : 0;
endmodule
tb.v
module tb();
parameter PAR_A = 0;
//int width;
//scanf(width);
//if(width == 10)PAR_A=0;
//else if(width == 20)PAR_A=1;
test #(.AA(PAR_A)) (
.a(1'b1),
.b()
);
endmodule
根据width的值,我希望有时PAR_A = 1, 有时PAR_A=0。
该如何做?
环境支持systemverilog,但是tb.v不能改为tb.sv |
|