projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f31055a
)
back.rtlil: translate empty slices correctly.
author
whitequark
<whitequark@whitequark.org>
Wed, 2 Jan 2019 18:14:29 +0000
(18:14 +0000)
committer
whitequark
<whitequark@whitequark.org>
Wed, 2 Jan 2019 18:14:29 +0000
(18:14 +0000)
nmigen/back/rtlil.py
patch
|
blob
|
history
diff --git
a/nmigen/back/rtlil.py
b/nmigen/back/rtlil.py
index 85856f8e133641055ed8f03a8cbc681ef090fdcf..8982f23ad410dd5a9329e25bf59b06b528503671 100644
(file)
--- a/
nmigen/back/rtlil.py
+++ b/
nmigen/back/rtlil.py
@@
-319,7
+319,9
@@
class _ValueCompiler(xfrm.ValueVisitor):
return self(value.value)
sigspec = self._prepare_value_for_Slice(value.value)
- if value.start + 1 == value.end:
+ if value.start == value.end:
+ return "{}"
+ elif value.start + 1 == value.end:
return "{} [{}]".format(sigspec, value.start)
else:
return "{} [{}:{}]".format(sigspec, value.end - 1, value.start)