From 31661e9e2dd3a83495836130c7a664e5340e4154 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 15 Nov 2019 14:57:31 +0100 Subject: [PATCH] soc/interconnect/packet: connect error/last_be only present on both sink and source --- litex/soc/interconnect/packet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/litex/soc/interconnect/packet.py b/litex/soc/interconnect/packet.py index a9a98130d..28663d3a2 100644 --- a/litex/soc/interconnect/packet.py +++ b/litex/soc/interconnect/packet.py @@ -262,11 +262,11 @@ class Packetizer(Module): ) # Error ------------------------------------------------------------------------------------ - if hasattr(sink, "error"): + if hasattr(sink, "error") and hasattr(source, "error"): self.comb += source.error.eq(sink.error) # Last BE ---------------------------------------------------------------------------------- - if hasattr(sink, "last_be"): + if hasattr(sink, "last_be") and hasattr(source, "last_be"): rotate_by = header.length%bytes_per_clk x = [sink.last_be[(i + rotate_by)%bytes_per_clk] for i in range(bytes_per_clk)] self.comb += source.last_be.eq(Cat(*x)) @@ -375,11 +375,11 @@ class Depacketizer(Module): ) # Error ------------------------------------------------------------------------------------ - if hasattr(sink, "error"): + if hasattr(sink, "error") and hasattr(source, "error"): self.comb += source.error.eq(sink.error) # Last BE ---------------------------------------------------------------------------------- - if hasattr(sink, "last_be"): + if hasattr(sink, "last_be") and hasattr(source, "last_be"): x = [sink.last_be[(i - (bytes_per_clk - header_leftover))%bytes_per_clk] for i in range(bytes_per_clk)] self.comb += source.last_be.eq(Cat(*x))