back.rtlil: fix DeprecationWarning. NFC.
authorJean-François Nguyen <jf@lambdaconcept.com>
Sat, 12 Oct 2019 21:44:39 +0000 (23:44 +0200)
committerwhitequark <whitequark@whitequark.org>
Sat, 12 Oct 2019 21:50:40 +0000 (21:50 +0000)
nmigen/back/rtlil.py

index 78628a70a5185a4b0ecf26f47d645c6db8a4de54..07207f4df10e715a1cb62c3b3a50ee6db580a183 100644 (file)
@@ -729,14 +729,14 @@ class _StatementCompiler(xfrm.StatementVisitor):
         except LegalizeValue as legalize:
             with self._case.switch(self.rhs_compiler(legalize.value),
                                    src=src(legalize.src_loc)) as switch:
-                width, signed = legalize.value.shape()
-                tests = ["{:0{}b}".format(v, width) for v in legalize.branches]
+                shape = legalize.value.shape()
+                tests = ["{:0{}b}".format(v, shape.width) for v in legalize.branches]
                 if tests:
-                    tests[-1] = "-" * width
+                    tests[-1] = "-" * shape.width
                 for branch, test in zip(legalize.branches, tests):
                     with self.case(switch, (test,)):
                         self._wrap_assign = False
-                        branch_value = ast.Const(branch, (width, signed))
+                        branch_value = ast.Const(branch, shape)
                         with self.state.expand_to(legalize.value, branch_value):
                             self.on_statement(stmt)
             self._wrap_assign = True