mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-28 16:53:45 +02:00
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.
24 lines
471 B
Verilog
24 lines
471 B
Verilog
`timescale 10ns/1ps
|
|
|
|
module main;
|
|
logic [1:0] counter = 2'b00;
|
|
logic clk = 1'b0;
|
|
|
|
initial forever #1 clk <= ~clk;
|
|
|
|
always @(posedge clk) begin
|
|
counter <= counter + 2'd1;
|
|
|
|
unique case (counter)
|
|
2'd0: $display("case 0");
|
|
2'd1: $display("case 1");
|
|
2'd3: $display("case 3");
|
|
endcase // priority case (counter)
|
|
|
|
if (counter == 2'd3) begin
|
|
$display("PASSED");
|
|
$finish(0);
|
|
end
|
|
end
|
|
endmodule
|