From: Sebastien Bourdeauducq Date: Thu, 17 Sep 2015 09:22:03 +0000 (+0800) Subject: fhdl/bitcontainer: remove fiter X-Git-Tag: 24jan2021_ls180~2099^2~3^2~81 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bcf62997f6ae85e09dead315c1805b1648f77255;p=litex.git fhdl/bitcontainer: remove fiter --- diff --git a/migen/fhdl/bitcontainer.py b/migen/fhdl/bitcontainer.py index 7745e992..216c0bfb 100644 --- a/migen/fhdl/bitcontainer.py +++ b/migen/fhdl/bitcontainer.py @@ -1,7 +1,7 @@ from migen.fhdl import structure as f -__all__ = ["log2_int", "bits_for", "flen", "fiter"] +__all__ = ["log2_int", "bits_for", "flen"] def log2_int(n, need_pow2=True): @@ -123,29 +123,3 @@ def flen(v): """ return value_bits_sign(v)[0] - -def fiter(v): - """Bit iterator - - Parameters - ---------- - v : int, bool or Value - - Returns - ------- - iter - Iterator over the bits in `v` - - Examples - -------- - >>> list(fiter(f.Signal(2))) #doctest: +ELLIPSIS - [, ] - >>> list(fiter(4)) - [0, 0, 1] - """ - if isinstance(v, (bool, int)): - return ((v >> i) & 1 for i in range(bits_for(v))) - elif isinstance(v, f.Value): - return (v[i] for i in range(flen(v))) - else: - raise TypeError("Can not bit-iterate {} {}".format(type(v), v))