projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ce5ff3
)
migen/genlib: avoid use of floating point in reverse_bytes
author
Florent Kermarrec
<florent@enjoy-digital.fr>
Mon, 27 Apr 2015 19:04:18 +0000
(21:04 +0200)
committer
Florent Kermarrec
<florent@enjoy-digital.fr>
Mon, 27 Apr 2015 19:04:18 +0000
(21:04 +0200)
migen/genlib/misc.py
patch
|
blob
|
history
diff --git
a/migen/genlib/misc.py
b/migen/genlib/misc.py
index f13b93c3efa429c34e1457687a50500f7bba7ae9..b9e73a9aee64ed89eef48283346714e5c2f80ed4 100644
(file)
--- a/
migen/genlib/misc.py
+++ b/
migen/genlib/misc.py
@@
-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))])