As far as I know (correct me if I'm wrong), if we declare a variable in Verilog without explicitly giving it a type - it defaults to a "wire".
Is this rule the same with System Verilog ? Or the default is something else ( "logic" for example ) ?
As far as I know (correct me if I'm wrong), if we declare a variable in Verilog without explicitly giving it a type - it defaults to a "wire".
Is this rule the same with System Verilog ? Or the default is something else ( "logic" for example ) ?
Verilog has `default_nettype option. this can be added to the top of any files you write. Verilog's default net type is wire and any undeclared variables will be of that type. This made a lot more sense when structural designs were popular. I've only seen `default_nettype none used, so I don't know if you can set `default_nettype logic. Doing so should convert any typos into 1 bit logic.
Verilog has an anti-feature that an undeclared name is treated as a wire. Before Verilog2001, this would always be 1 bit. After 2001, the width could be inferred. The intent seems to have been making it easier to connect module instances in a highly structural design.
Because typos get treated as wires, some developers declare `default_nettype none. A side effect of this is that ports now need "input wire" vs just "input".