soc/interconnect/packet: connect error/last_be only present on both sink and source
This commit is contained in:
parent
2946581e50
commit
31661e9e2d
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue