bitreverse: fhdl/tools -> genlib/misc

This commit is contained in:
Sebastien Bourdeauducq 2013-05-30 18:44:37 +02:00
parent bac62a32a9
commit f0b0942055
2 changed files with 5 additions and 5 deletions

View File

@ -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):

View File

@ -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