1
你好Verilog的专家,初始化优先用Verilog
在下面的Verilog代码,我可以100%是top.test.p
将系统初始化为200?
或者我会在变量初始化和初始语句之间进行竞争吗?换句话说,一些模拟器会给我top.test.p == 100
和其他top.test.p == 200
?任何初始或总是过程开始之前
由于
module test;
parameter real P = 1e3;
real P=p;
endmodule
module top;
test #(100) test();
initial
begin
// override the variable initialization (race condition????)
test.p = 200;
end
endmodule
你的意思是_parameter_ by parameter real P = 1e3'?我猜它必须是'p'而不是'P'(可能是错字),它也必须是可变的,而不是参数。参数不能在程序块中更改,它们只能在实例化或'defparam'时被覆盖。 – sharvil111