forked from M-Labs/artiq
1
0
Fork 0

serwb: transmit zeroes when nothing to transmit (for prbs), improve rx idle detection

This commit is contained in:
Florent Kermarrec 2018-06-08 16:10:31 +02:00
parent 7296a76f18
commit 53e9e475d0
3 changed files with 12 additions and 6 deletions

View File

@ -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 += \

View File

@ -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,
sink.connect(self.serdes.tx.sink), If(sink.stb,
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)

View File

@ -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,
sink.connect(self.serdes.tx.sink), If(sink.stb,
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)