From: Florent Kermarrec Date: Fri, 15 Nov 2019 13:57:31 +0000 (+0100) Subject: soc/interconnect/packet: connect error/last_be only present on both sink and source X-Git-Tag: 24jan2021_ls180~857 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31661e9e2dd3a83495836130c7a664e5340e4154;p=litex.git soc/interconnect/packet: connect error/last_be only present on both sink and source --- diff --git a/litex/soc/interconnect/packet.py b/litex/soc/interconnect/packet.py index a9a98130..28663d3a 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))