mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
migen/genlib: avoid use of floating point in reverse_bytes
This commit is contained in:
parent
3ce5ff3722
commit
0da9311d70
1 changed files with 1 additions and 3 deletions
|
@ -1,5 +1,3 @@
|
|||
import math
|
||||
|
||||
from migen.fhdl.std import *
|
||||
from migen.fhdl.structure import _Operator
|
||||
|
||||
|
@ -67,7 +65,7 @@ def chooser(signal, shift, output, n=None, reverse=False):
|
|||
|
||||
|
||||
def reverse_bytes(signal):
|
||||
n = math.ceil(flen(signal)/8)
|
||||
n = (flen(signal)+7)//8
|
||||
r = []
|
||||
for i in reversed(range(n)):
|
||||
r.append(signal[i*8:min((i+1)*8, flen(signal))])
|
||||
|
|
Loading…
Reference in a new issue