I was writing a test bench for a ps2 host transmitter and signals are sent from the device to the board. I registered the inputs, but I got some weird behavior in the simulation. If the signals come in at the same time as the host tries to register them, then it fails. Instead of registering the value before the edge it takes the value after.
I know that if I were to put this design on a board it would have metastability issues because of the asynchronous input, but I assumed that wouldn’t happen in a simulation. Is there any simple solution to this or detail I’ve overlooked? All I can think of is making the the two’s periods have a large least common multiple, so I won’t run into this issue while simulating.