Files
iverilog/ivtest/ivltests/enum_compatibility1.v
T
Lars-Peter Clausen 83da384df3 Add regression test for enum compatibility across module boundaries
Check that the compatibility of signals of enum data type across module
boundaries.

If the enum data type is declared at a higher level scope or imported from
a package the signals are compatible between different module instances. If
the enum data type is declared within the module itself though the signals
are not compatible.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2022-03-19 17:17:21 +01:00

26 lines
381 B
Verilog

// Check that enum types declared in a higher level scope are compatible between
// different instances of a module.
typedef enum integer {
A
} T;
module M;
T e;
endmodule
module test;
M m1();
M m2();
initial begin
m1.e = A;
m2.e = m1.e;
if (m2.e === A) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule