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

29 lines
498 B
Verilog

module main;
reg flag;
reg [3:0] a, b;
wire [4:0] Q = flag? a : b;
initial begin
flag = 1;
a = 4'b1010;
b = 4'b0101;
#1 $display("%b = %b? %b : %b", Q, flag, a, b);
if (Q !== 5'b01010) begin
$display("FAILED -- Q=%b, flag=%b, a=%b", Q, flag, a);
$finish;
end
flag = 0;
#1 if (Q !== 5'b00101) begin
$display("FAILED -- Q=%b, flag=%b, b=%b", Q, flag, b);
$finish;
end
$display("PASSED");
end
endmodule // main