frontend/stream: Set sink.ready when udp_port or ip_address are invalid.

This commit is contained in:
Florent Kermarrec 2022-01-14 18:02:53 +01:00
parent 8faba46517
commit 6a6bc28869
1 changed files with 4 additions and 2 deletions

View File

@ -82,14 +82,16 @@ class LiteEthUDP2StreamRX(Module):
# Data-Path / Buffering (Optional). # Data-Path / Buffering (Optional).
if fifo_depth is None: if fifo_depth is None:
self.comb += [ self.comb += [
sink.connect(source, keep={"last", "ready", "data"}), sink.connect(source, keep={"last", "data"}),
source.valid.eq(sink.valid & valid), source.valid.eq(sink.valid & valid),
sink.ready.eq(source.ready | ~valid)
] ]
else: else:
self.submodules.fifo = fifo = stream.SyncFIFO([("data", 8)], fifo_depth) self.submodules.fifo = fifo = stream.SyncFIFO([("data", 8)], fifo_depth)
self.comb += [ self.comb += [
sink.connect(fifo.sink, keep={"last", "ready", "data"}), sink.connect(fifo.sink, keep={"last", "data"}),
fifo.sink.valid.eq(sink.valid & valid), fifo.sink.valid.eq(sink.valid & valid),
sink.ready.eq(fifo.sink.ready | ~valid),
fifo.source.connect(source) fifo.source.connect(source)
] ]