From 60fd362d57348fe424410e7e95323fac867ce0e5 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 7 May 2018 23:54:35 +0200 Subject: [PATCH] serwb: fix rx_comma detection --- artiq/gateware/serwb/kusphy.py | 8 ++++++-- artiq/gateware/serwb/s7phy.py | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/artiq/gateware/serwb/kusphy.py b/artiq/gateware/serwb/kusphy.py index 8abcb08d3..e0a0bd58b 100644 --- a/artiq/gateware/serwb/kusphy.py +++ b/artiq/gateware/serwb/kusphy.py @@ -205,8 +205,12 @@ class KUSSerdes(Module): decoders[3].input.eq(rx_bitslip.o[30:40]), self.rx_k.eq(Cat(*[decoders[i].k for i in range(4)])), self.rx_d.eq(Cat(*[decoders[i].d for i in range(4)])), - self.rx_comma.eq((decoders[0].k == 1) & (decoders[0].d == K(28,5))) - ] + self.rx_comma.eq( + (decoders[0].k == 1) & (decoders[0].d == K(28,5)) & + (decoders[1].k == 0) & (decoders[1].d == 0) & + (decoders[2].k == 0) & (decoders[2].d == 0) & + (decoders[3].k == 0) & (decoders[3].d == 0)) + ] idle_timer = WaitTimer(32) self.submodules += idle_timer diff --git a/artiq/gateware/serwb/s7phy.py b/artiq/gateware/serwb/s7phy.py index df4930572..967991aea 100644 --- a/artiq/gateware/serwb/s7phy.py +++ b/artiq/gateware/serwb/s7phy.py @@ -216,8 +216,12 @@ class S7Serdes(Module): decoders[3].input.eq(rx_bitslip.o[30:40]), self.rx_k.eq(Cat(*[decoders[i].k for i in range(4)])), self.rx_d.eq(Cat(*[decoders[i].d for i in range(4)])), - self.rx_comma.eq((decoders[0].k == 1) & (decoders[0].d == K(28,5))) - ] + self.rx_comma.eq( + (decoders[0].k == 1) & (decoders[0].d == K(28,5)) & + (decoders[1].k == 0) & (decoders[1].d == 0) & + (decoders[2].k == 0) & (decoders[2].d == 0) & + (decoders[3].k == 0) & (decoders[3].d == 0)) + ] idle_timer = WaitTimer(32) self.submodules += idle_timer