projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
221f108
)
back.rtlil: explicitly pad constants with zeroes.
author
whitequark
<whitequark@whitequark.org>
Fri, 21 Dec 2018 01:51:18 +0000
(
01:51
+0000)
committer
whitequark
<whitequark@whitequark.org>
Fri, 21 Dec 2018 01:51:18 +0000
(
01:51
+0000)
I'm not sure what exactly RTLIL does when a constant isn't as long
as its bit width, and there's no reason to keep the ambiguity.
nmigen/back/rtlil.py
patch
|
blob
|
history
diff --git
a/nmigen/back/rtlil.py
b/nmigen/back/rtlil.py
index 433dd2060bc9b399551f5ed102d71a13f196e145..0b61268481be820024c6fee54eedcc0e670dd5a1 100644
(file)
--- a/
nmigen/back/rtlil.py
+++ b/
nmigen/back/rtlil.py
@@
-353,7
+353,7
@@
class _RHSValueCompiler(_ValueCompiler):
if isinstance(value.value, str):
return "{}'{}".format(value.nbits, value.value)
else:
- return "{}'{:
b}".format(value.nbits, value.value
)
+ return "{}'{:
0{}b}".format(value.nbits, value.value, value.nbits
)
def on_Signal(self, value):
wire_curr, wire_next = self.s.resolve(value)