Files
iverilog/ivtest/ivltests/pr1740476b.v
T
Stephen Williams cea237b407 Add ivtest to the iverilog source tree
By adding ivtest to the iverilog source tree, it is easier to keep
the regression test synchronized with the source that is being tested.
This should be especially helpful for PRs that add a new feature, and
have a matching ivtest PR with the regression test for that feature.
2022-01-15 10:18:50 -08:00

35 lines
659 B
Verilog

module main;
wire [3:0] src [15:0];
wire [3:0] dst [15:0];
genvar i;
for (i = 0 ; i < 16; i = i+1) begin:bb
buffer u (.out(dst[i]), .in(src[i]));
end
for (i = 0 ; i < 16 ; i = i+1) begin:drv
assign src[i] = i;
end
integer idx;
initial begin
#1 ;
for (idx = 0 ; idx < 16 ; idx = idx+1) begin
if (dst[idx] !== idx) begin
$display("FAILED -- src[%0d]==%b, dst[%0d]==%b",
idx, src[idx], idx, dst[idx]);
$finish;
end
end
$display("PASSED");
end
endmodule // main
module buffer (input wire [3:0] in, output wire [3:0] out);
assign out = in;
endmodule // buffer