Consider this file tb_sr_latch.v:
`include "sr_latch.v"
module tb_sr_latch;
reg [4:0] t_in;
wire out;
sr_latch M1(t_in[4], t_in[3], t_in[2], t_in[1], t_in[0], out);
initial begin
$dumpfile("tb_sr_latch.vcd");
$dumpvars(0);
t_in = 5'b00000;
repeat(32) begin
#1 t_in <= t_in + 5'b00001;
end
end
endmodule
there is a module instantiation which its name is M1, there can be other instantiation of this module to consider all possibilities and create all possible signals: for example for a module with 5 inputs it is possible to have 2^5 possibilities with (5! == 120) permutation ( because signals order matter) like:
sr_latch M1(t_in[4], t_in[3], t_in[2], t_in[1], t_in[0], out);
sr_latch M2(t_in[3], t_in[4], t_in[2], t_in[0], t_in[1], out);
sr_latch M3(t_in[2], t_in[3], t_in[0], t_in[4], t_in[1], out);
...
...
...
sr_latch M32(t_in[0], t_in[1], t_in[2], t_in[3], t_in[4], out);
Now my question is, is there any more pretty and automating way to do it?
generate for ... endgenerate
\$\endgroup\$