back.rtlil: fix legalization of Part() with stride.
authorwhitequark <whitequark@whitequark.org>
Mon, 13 Apr 2020 14:43:43 +0000 (14:43 +0000)
committerwhitequark <whitequark@whitequark.org>
Mon, 13 Apr 2020 14:43:43 +0000 (14:43 +0000)
Also known as word_select().

nmigen/back/rtlil.py

index fb600034c8f5645552ba99b6ddcdb5422619068b..c074a97f5042fd8c9a04c393192d7efc7077d2ef 100644 (file)
@@ -644,7 +644,7 @@ class _LHSValueCompiler(_ValueCompiler):
             # system resources.
             max_branches = len(value.value) // value.stride + 1
             raise LegalizeValue(value.offset,
-                                range((1 << len(value.offset)) // value.stride)[:max_branches],
+                                range(1 << len(value.offset))[:max_branches],
                                 value.src_loc)
 
     def on_Repl(self, value):