From 602ddec664b266e51616b70845e3588e55f1322f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 30 Oct 2018 11:13:09 +0100 Subject: [PATCH] common: use reverse_bytes from litex.gen --- liteeth/common.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/liteeth/common.py b/liteeth/common.py index d54130a..1c67fe0 100644 --- a/liteeth/common.py +++ b/liteeth/common.py @@ -2,6 +2,8 @@ from math import ceil from migen import * +from litex.gen import * + from litex.soc.interconnect import stream from litex.soc.interconnect.stream import EndpointDescription from litex.soc.interconnect.csr import * @@ -9,14 +11,6 @@ from litex.soc.interconnect.csr import * from litex.soc.interconnect.stream_packet import Header, HeaderField -def reverse_bytes(signal): - n = (len(signal)+7)//8 - r = [] - for i in reversed(range(n)): - r.append(signal[i*8:min((i+1)*8, len(signal))]) - return Cat(*r) - - class Port: def connect(self, port): r = [self.source.connect(port.sink),