From f0b094205540c960a3b418049604b99a46841524 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 30 May 2013 18:44:37 +0200 Subject: [PATCH] bitreverse: fhdl/tools -> genlib/misc --- migen/fhdl/tools.py | 5 ----- migen/genlib/misc.py | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/migen/fhdl/tools.py b/migen/fhdl/tools.py index 2d739077f..fd55034d8 100644 --- a/migen/fhdl/tools.py +++ b/migen/fhdl/tools.py @@ -5,11 +5,6 @@ from migen.fhdl.structure import _Slice, _Assign from migen.fhdl.visit import NodeVisitor, NodeTransformer from migen.fhdl.size import value_bits_sign -def bitreverse(s): - length, signed = value_bits_sign(s) - l = [s[i] for i in reversed(range(length))] - return Cat(*l) - def flat_iteration(l): for element in l: if isinstance(element, collections.Iterable): diff --git a/migen/genlib/misc.py b/migen/genlib/misc.py index 97d0be0e0..0e20cab96 100644 --- a/migen/genlib/misc.py +++ b/migen/genlib/misc.py @@ -1,6 +1,11 @@ from migen.fhdl.std import * from migen.fhdl.structure import _Operator +def bitreverse(s): + length, signed = value_bits_sign(s) + l = [s[i] for i in reversed(range(length))] + return Cat(*l) + def optree(op, operands, lb=None, ub=None, default=None): if lb is None: lb = 0