back.rtlil: fix Array regression in 32446831.
authorwhitequark <cz@m-labs.hk>
Mon, 1 Jul 2019 01:53:56 +0000 (01:53 +0000)
committerwhitequark <cz@m-labs.hk>
Mon, 1 Jul 2019 01:53:56 +0000 (01:53 +0000)
Fixes #117.

nmigen/back/rtlil.py

index 1fce29e27e7b0d315a0ea3a5ed5dca1f495ad124..602d1c30da73e31cd401f122a7c4b6f75a0968b0 100644 (file)
@@ -658,7 +658,7 @@ class _StatementCompiler(xfrm.StatementVisitor):
                 tests = ["{:0{}b}".format(v, bits) for v in legalize.branches]
                 tests[-1] = "-" * bits
                 for branch, test in zip(legalize.branches, tests):
-                    with self.case(switch, test):
+                    with self.case(switch, (test,)):
                         branch_value = ast.Const(branch, (bits, sign))
                         with self.state.expand_to(legalize.value, branch_value):
                             super().on_statement(stmt)