Recently I faced an issue with edge detector using bit/logic type in SystemVerilog. It seems that the behavior is incorrect. I had to change the variables type back to old Verilog wire/reg to make it works.
Could anyone please help me to explain why do we have this type issue?
I’m assuming you mean you are seeing functional differences between these two declarations:
bit detect = dd & !d; // issue
wire detect = dd & !d; // ok
This is because the first is a variable declaration with an initialization that executes before time 0. The second is a net declaration with a continuous assignment.
If you want the same behavior, you need to write the variable declaration and continuous assignment separately.