Altera_Forum
Honored Contributor
15 years agoVerilog HDL question
I've seen HDL code that merges the input (or output) and the wire (or reg) declaration in a single instruction.
That is instead of : module dummy(A,B) input A; output [3:0] B; wire A; reg [3:0] B; ... endmodule some code uses the following, that is more compact and seems also to be less error prone: module dummy(A,B) input wire A; output reg [3:0] B; ... endmodule My questions are: 1) Is this syntactically correct? 2) Is this only available in Verilog 2001 standard? 3) Do you suggest this coding style? Are there drawbacks (compatibility issues, portability issues, readability issues)? Thx