mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 03:03:08 +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.
42 lines
785 B
Verilog
42 lines
785 B
Verilog
/*
|
|
* This program tests that enumeration values work and are
|
|
* implicitly translated to integer values.
|
|
*/
|
|
module main;
|
|
|
|
enum { RED, ORANGE, YELLOW, GREEN, BLUE, VIOLET,
|
|
BLACK = 10, WHITE = 'd11
|
|
} color1;
|
|
|
|
int var1;
|
|
|
|
initial begin
|
|
color1 = RED;
|
|
var1 = RED;
|
|
$display("color1 = %0d, var1 = %0d", color1, var1);
|
|
if (color1 !== 0) begin
|
|
$display("FAILED");
|
|
$finish;
|
|
end
|
|
if (var1 !== 0) begin
|
|
$display("FAILED");
|
|
$finish;
|
|
end
|
|
|
|
color1 = GREEN;
|
|
var1 = GREEN;
|
|
$display("color1 = %0d, var1 = %0d", color1, var1);
|
|
if (color1 !== 3) begin
|
|
$display("FAILED");
|
|
$finish;
|
|
end
|
|
if (var1 !== 3) begin
|
|
$display("FAILED");
|
|
$finish;
|
|
end
|
|
|
|
$display("PASSED");
|
|
end
|
|
|
|
endmodule // main
|