You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DomainRenamers don't seem to change the domain that Past looks at. Below is a minimal example that demonstrates the problem and the correct behavior.
The Toggle module flips its internal toggle every clock cycle, then uses Past to output it delayed by one cycle. Both toggles are DomainRenamed to the "fast" domain. Toggle t1 uses Past(domain=None) and generates an incorrect output because Past samples the toggle from the sync domain; the DomainRenamer didn't change it to "fast". Toggle t2, on the other hand, uses Past(domain="fast") to ensure the sample is taken from the correct clock domain and so generates the correct output.
I didn't investigate this in detail and I'll take you at your word that there is a bug; currently, clock/reset signals and domain renames are done via term rewriting, which is unfortunately as you're discovering now error-prone (and also quite slow).
It would probably be possible to add a workaround here but I would much rather prefer to use a different approach that systematically eliminates all similar issues, but would take more time to implement. Are you in a rush?
I'm not in a rush. I just avoided using Past in this situation instead. When you change the underlying approach and close the issue, this comment is me reminding myself to go back and re-add it.
DomainRenamers don't seem to change the domain that
Past
looks at. Below is a minimal example that demonstrates the problem and the correct behavior.The
Toggle
module flips its internal toggle every clock cycle, then usesPast
to output it delayed by one cycle. Both toggles are DomainRenamed to the "fast" domain. Togglet1
usesPast(domain=None)
and generates an incorrect output becausePast
samples the toggle from thesync
domain; the DomainRenamer didn't change it to "fast". Togglet2
, on the other hand, usesPast(domain="fast")
to ensure the sample is taken from the correct clock domain and so generates the correct output.GTKWave output is shown below. The top trace is the output of
t1
and the bottom is the output oft2
.The text was updated successfully, but these errors were encountered: