For system verilog, I use "typedef enum {WAIT, WATCH, ASSERT} STATE;" in both module and testbench. The compiling is passed but when starting simulation, here comes the error:
** Error: (vsim-3906) F:/modelsim_projects/4/test_cd.v(23): Connection type 'test_cd_v_unit.enum int ' is incompatible with 'fsm_cd_v_unit.enum int ' for port (state): Enum types must match.
In both module and testbench, I use "STATE state, n_state; " for the definition of input and output. I think nothing is wrong but how can I make the simulation working?
Thanks! I defined STATE in a .vh file and included this file in both module an testbench, but Modelsim still created 2 unit packages. How can I fix this problem?