common: use reverse_bytes from litex.gen
This commit is contained in:
parent
40b99ecc05
commit
602ddec664
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue