mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 01:13:47 +02:00
Test that enums are elaborated in declaration order and a enum declaration can reference a item of an enum that was declared before it. Signed-off-by: Lars-Peter Clausen <[email protected]>
26 lines
299 B
Verilog
26 lines
299 B
Verilog
// Verify that enums can reference items from enums declared before them
|
|
|
|
module test;
|
|
|
|
enum logic {
|
|
A = 1
|
|
} a;
|
|
|
|
enum logic {
|
|
B = A
|
|
} b;
|
|
|
|
enum logic {
|
|
C = B
|
|
} c;
|
|
|
|
initial begin
|
|
if (A == B && A == C) begin
|
|
$display("PASSED");
|
|
end else begin
|
|
$display("FAILED");
|
|
end
|
|
end
|
|
|
|
endmodule
|