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

31 lines
540 B
Verilog

module main;
parameter COND = 1;
parameter SEL = 0;
parameter VAL0 = 0;
parameter VAL1 = 1;
parameter VAL2 = 2;
wire [3:0] foo;
if (COND) begin
case (SEL)
0: assign foo = VAL0;
1: assign foo = VAL1;
2: assign foo = VAL2;
endcase // case (SEL)
end else begin
assign foo = 'bx;
end
initial begin
#1 $display("foo = %b", foo);
if (foo !== VAL0) begin
$display("FAILED");
$finish;
end
$display("PASSED");
$finish;
end
endmodule // main