From 5e4dd913fc2b38cc832e54125b385095cc62de7a Mon Sep 17 00:00:00 2001 From: Michael Betz Date: Tue, 19 Apr 2022 00:57:43 +0200 Subject: [PATCH] packet.py: fix typo in Packetizer * in some cases, the delayed sink data was updated even though sink was not valid, leading to corrupted source data * this broke etherbone reads with DW=64 --- liteeth/packet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liteeth/packet.py b/liteeth/packet.py index 851550c..17dbd0c 100644 --- a/liteeth/packet.py +++ b/liteeth/packet.py @@ -97,7 +97,7 @@ class Packetizer(Module): ) if not aligned: header_offset_multiplier = 1 if header_words == 1 else 2 - self.sync += If(source.ready, sink_d.eq(sink)) + self.sync += If(source.valid & source.ready, sink_d.eq(sink)) fsm.act("UNALIGNED-DATA-COPY", source.valid.eq(sink.valid | sink_d.last), source_last_a.eq(sink.last | sink_d.last),