1 extra bit on mask shift size needed, to allow ">" to work
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 19 Aug 2020 04:44:20 +0000 (05:44 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 19 Aug 2020 04:44:20 +0000 (05:44 +0100)
src/nmutil/mask.py

index a75d7e34a1675b37d9f1e97174074a932c4a7209..223752297e0d48ffeffc23f3c6ca02280270c13e 100644 (file)
@@ -5,7 +5,7 @@ from nmigen.utils import log2_int
 class Mask(Elaboratable):
     def __init__(self, sz):
         self.sz = sz
-        self.shift = Signal(log2_int(sz, False))
+        self.shift = Signal(log2_int(sz, False)+1)
         self.mask = Signal(sz)
 
     def elaborate(self, platform):