From 0da9311d70627e4f46319d9631881d50ed44fe5a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 27 Apr 2015 21:04:18 +0200 Subject: [PATCH] migen/genlib: avoid use of floating point in reverse_bytes --- migen/genlib/misc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/migen/genlib/misc.py b/migen/genlib/misc.py index f13b93c3..b9e73a9a 100644 --- 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))]) -- 2.30.2