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

37 lines
605 B
Verilog

module main;
reg [3:0] cond;
reg [2:0] t, q;
always @* begin
case (cond&4'b1110)
'h0: t = 7;
'h2: t = 6;
'h4: t = 5;
'h6: t = 4;
'h8: t = 3;
'ha: t = 2;
'hc: t = 1;
'he: t = 0;
endcase // case(cond&4'b1110)
q = ~t;
end // always @ *
integer i;
initial begin
for (i = 0 ; i < 8 ; i = i + 1) begin
cond = i << 1;
#1 if (q !== ( 3'b111 & ~(7 - i))) begin
$display("FAILED -- i=%d, cond=%b, q=%b", i, cond, q);
$finish;
end
end
$display("PASSED");
end
endmodule // main