我对 SystemVerilog 的“default_nettype 指令”有疑问。
默认情况下,下面的代码是可以的。
module m1 (
input logic i1,
output logic o1
);
logic l1;
assign l1 = i1;
assign o1 = l1;
endmodule
Run Code Online (Sandbox Code Playgroud)
但是,当我将默认网络类型更改为none
:
`default_nettype none
Run Code Online (Sandbox Code Playgroud)
只有 i1 会导致错误:
ERROR: [VRFC 10-1103] net type must be explicitly specified for i1 when default_nettype is none ...
Run Code Online (Sandbox Code Playgroud)
我的问题是为什么只会input logic i1
导致错误并需要明确的wire
,但output logic o1
不会logic l1
。