projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2f5e50
)
back.rtlil: don't crash legalizing values with no branches.
author
whitequark
<cz@m-labs.hk>
Sun, 6 Oct 2019 08:52:49 +0000
(08:52 +0000)
committer
whitequark
<cz@m-labs.hk>
Sun, 6 Oct 2019 08:52:49 +0000
(08:52 +0000)
Fixes #239.
nmigen/back/rtlil.py
patch
|
blob
|
history
diff --git
a/nmigen/back/rtlil.py
b/nmigen/back/rtlil.py
index e96236680b3446fd278afe2a56996c2f9259490b..7dbe085dc26461116839b67cf7b094f45cf6b0eb 100644
(file)
--- a/
nmigen/back/rtlil.py
+++ b/
nmigen/back/rtlil.py
@@
-731,7
+731,8
@@
class _StatementCompiler(xfrm.StatementVisitor):
src=src(legalize.src_loc)) as switch:
width, signed = legalize.value.shape()
tests = ["{:0{}b}".format(v, width) for v in legalize.branches]
- tests[-1] = "-" * width
+ if tests:
+ tests[-1] = "-" * width
for branch, test in zip(legalize.branches, tests):
with self.case(switch, (test,)):
self._wrap_assign = False