Say I have a module foo with a bus input A and a bus output B:
module foo ();
input [7:0] A;
output [7:0] B;
endmodule
And foo is instantiated inside top module, and I want something like below(likely to have syntax error):
module top ();
wire [2:0] bus1;
wire [2:0] bus2;
wire [2:0] bus3;
wire [2:0] bus4;
foo myfoo (
.A[7:5](bus1[2:0]),
.A[4:3](2'b00),
.A[2:0](bus2[2:0]),
.B[7:5](bus3[2:0]),
.B[4:3](),
.B[2:0](bus4[2:0])
);
endmodule
What is the syntax correct and most elegant way to do that?