forked from M-Labs/artiq
serwb: transmit zeroes when nothing to transmit (for prbs), improve rx idle detection
This commit is contained in:
parent
7296a76f18
commit
53e9e475d0
|
@ -185,11 +185,13 @@ class RXDatapath(Module):
|
||||||
]
|
]
|
||||||
|
|
||||||
# idle decoding
|
# idle decoding
|
||||||
idle_timer = WaitTimer(256)
|
idle_timer = WaitTimer(32)
|
||||||
self.submodules += idle_timer
|
self.submodules += idle_timer
|
||||||
self.comb += [
|
self.sync += [
|
||||||
idle_timer.wait.eq(1),
|
If(converter.source.stb,
|
||||||
idle.eq(idle_timer.done & ((converter.source.data == 0) | (converter.source.data == (2**40-1))))
|
idle_timer.wait.eq((converter.source.data == 0) | (converter.source.data == (2**40-1)))
|
||||||
|
),
|
||||||
|
idle.eq(idle_timer.done)
|
||||||
]
|
]
|
||||||
# comma decoding
|
# comma decoding
|
||||||
self.sync += \
|
self.sync += \
|
||||||
|
|
|
@ -313,7 +313,9 @@ class SERWBPHY(Module, AutoCSR):
|
||||||
# tx/rx dataflow
|
# tx/rx dataflow
|
||||||
self.comb += [
|
self.comb += [
|
||||||
If(self.init.ready,
|
If(self.init.ready,
|
||||||
|
If(sink.stb,
|
||||||
sink.connect(self.serdes.tx.sink),
|
sink.connect(self.serdes.tx.sink),
|
||||||
|
),
|
||||||
self.serdes.rx.source.connect(source)
|
self.serdes.rx.source.connect(source)
|
||||||
).Else(
|
).Else(
|
||||||
self.serdes.rx.source.ack.eq(1)
|
self.serdes.rx.source.ack.eq(1)
|
||||||
|
|
|
@ -362,7 +362,9 @@ class SERWBPHY(Module, AutoCSR):
|
||||||
# tx/rx dataflow
|
# tx/rx dataflow
|
||||||
self.comb += [
|
self.comb += [
|
||||||
If(self.init.ready,
|
If(self.init.ready,
|
||||||
|
If(sink.stb,
|
||||||
sink.connect(self.serdes.tx.sink),
|
sink.connect(self.serdes.tx.sink),
|
||||||
|
),
|
||||||
self.serdes.rx.source.connect(source)
|
self.serdes.rx.source.connect(source)
|
||||||
).Else(
|
).Else(
|
||||||
self.serdes.rx.source.ack.eq(1)
|
self.serdes.rx.source.ack.eq(1)
|
||||||
|
|
Loading…
Reference in New Issue