Skip to content

Conversation

@phsauter
Copy link
Collaborator

As it stands, the cdc_2phase_clearable module has a path going from the source clock domain into the destination clock domain directly, without a 2-flop synchronizer.
The path in question is in the reset/clear logic implemented in cdc_reset_ctrlr.
Specifically receiver_next_phase is clocked by the source domain (side A in cdc_reset_ctrlr) and then goes into the other side (side B) where it goes into i_state_transition_cdc_dst, a cdc_4phase_dst with the DECOUPLED parameter set to zero.
Setting this parameter to zero effectively bypasses the spill-register in there allowing the same asynchronous signal to leave and go into the destination clock domain, where it shows up as receiver_next_phase used to create the isolate and clear signals on the destination side.

I strongly doubt this is intended behavior and would like to fix this issue.

Further, this shows to me that especially the clock domain crossings need working testbenches that run in a CI to make sure they work as intended.
As part of this PR, I also started to fix the testbenches which in the case of cdc_2phase_clearable did not even test the module but presumably some old development version instead. This happened because the module is essentially copied in the testbench instead of actually testing the module itself.

adapted from cdc_2phase_tb
Previously this used some old (development?) version of
the DUT module.
Now it uses the same implementation as is currently used.

Todo: This should test the module, not a copy of the module.
The previous implementation creates a non-synchronized path
across the CDC, making it significantly more vulnerable
to metastability.

This does not seem to be necessary for DECOUPLED to work in
the cdc_2phase_clearable (cdc_reset_ctrlr).
The important thing seems to be when on the source side the
ready signal is asserted, not how the destination side
synchronizes data.
@phsauter phsauter added this to the v2.0 milestone Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant