projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9794e73
)
back.rtlil: don't emit a slice if all bits are used.
author
whitequark
<whitequark@whitequark.org>
Sun, 16 Dec 2018 16:05:38 +0000
(16:05 +0000)
committer
whitequark
<whitequark@whitequark.org>
Sun, 16 Dec 2018 16:05:38 +0000
(16:05 +0000)
nmigen/back/rtlil.py
patch
|
blob
|
history
diff --git
a/nmigen/back/rtlil.py
b/nmigen/back/rtlil.py
index 5641322031f5585807a021c658d79adb1dd26b71..05d4ac646e13bccbe0be8532d680f9875ca03953 100644
(file)
--- a/
nmigen/back/rtlil.py
+++ b/
nmigen/back/rtlil.py
@@
-273,7
+273,9
@@
class _ValueCompiler(xfrm.AbstractValueTransformer):
raise NotImplementedError # :nocov:
def on_Slice(self, value):
- if value.end == value.start + 1:
+ if value.start == 0 and value.end == len(value.value):
+ return self(value.value)
+ elif value.start + 1 == value.end:
return "{} [{}]".format(self(value.value), value.start)
else:
return "{} [{}:{}]".format(self(value.value), value.end - 1, value.start)