2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-18 16:06:30 +08:00

wrpll.ddmtd: fix first edge deglitcher

The blind counter should be held in reset whenever the input is high,
not just when there is a rising edge (otherwise the counter runs down
during the main pulse and can then re-trigger on jitter from the falling edge)
This commit is contained in:
hartytp 2020-10-06 15:42:37 +01:00 committed by Sebastien Bourdeauducq
parent f3cd0fc675
commit 85bb641917

View File

@ -83,7 +83,7 @@ class DDMTDDeglitcherFirstEdge(Module):
blind_counter = Signal(max=blind_period)
self.sync.helper += [
If(blind_counter != 0, blind_counter.eq(blind_counter - 1)),
If(rising, blind_counter.eq(blind_period - 1)),
If(input_signal_r, blind_counter.eq(blind_period - 1)),
self.detect.eq(rising & (blind_counter == 0))
]