compat.fhdl.bitcontainer: fix value_bits_sign().
authorwhitequark <whitequark@whitequark.org>
Tue, 21 Jul 2020 02:53:29 +0000 (02:53 +0000)
committerwhitequark <whitequark@whitequark.org>
Tue, 21 Jul 2020 02:53:29 +0000 (02:53 +0000)
This function was broken in commit 659b0e81; some downstream code
expects bits_sign to be e.g. indexable.

nmigen/compat/fhdl/bitcontainer.py

index 648b129df0c65c28aa2036a8ce1ee6a89fa8e818..4b91572e2494f99fa82d7562b63b35eae3cefc83 100644 (file)
@@ -18,4 +18,4 @@ def bits_for(n, require_sign_bit=False):
 
 @deprecated("instead of `value_bits_sign(v)`, use `v.shape()`")
 def value_bits_sign(v):
-    return ast.Value.cast(v).shape()
+    return tuple(ast.Value.cast(v).shape())