Files
iverilog/ivtest/ivltests/pr809.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

34 lines
689 B
Verilog

module main;
wire [1:0] a2, b2;
wire [2:0] a3, b3;
target #(.WA(2), .WB(2)) u1 (a2, b2);
target #(.WA(3), .WB(3)) u2 (a3, b3);
initial begin
$display("u1.WA=%d, $bits(u1.A)=%d", u1.WA, $bits(u1.A));
$display("u1.WB=%d, $bits(u1.A)=%d", u1.WB, $bits(u1.B));
if ($bits(u1.A) != 2) begin
$display("FAILED -- $bits(u1.A) = %d", $bits(u1.A));
$finish;
end
if ($bits(u2.A) != 3) begin
$display("FAILED -- $bits(u2.A) = %d", $bits(u2.A));
$finish;
end
$display("PASSED");
end
endmodule // main
module target
#(parameter WA = 4, WB = 4)
(input [WA-1:0] A, output [WB-1:0] B);
assign B = A;
endmodule // target