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

31 lines
442 B
Verilog

// Check that enum types implicitly imported from a package are compatible
// between different instances of a module.
package P;
typedef enum integer {
A
} T;
endpackage
module M;
import P::*;
T e;
endmodule
module test;
import P::*;
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