projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
05bfabf
)
back.rtlil: infer bit width for instance parameters.
author
whitequark
<cz@m-labs.hk>
Wed, 27 Nov 2019 17:58:42 +0000
(17:58 +0000)
committer
whitequark
<cz@m-labs.hk>
Wed, 27 Nov 2019 17:58:42 +0000
(17:58 +0000)
Otherwise, Yosys assumes it is always 32, which is often
inappropriate.
nmigen/back/rtlil.py
patch
|
blob
|
history
diff --git
a/nmigen/back/rtlil.py
b/nmigen/back/rtlil.py
index 7806ace3ed47cc195fed8936149c452c50679075..9869c61d77c15c3d78a8a094056072247612f42b 100644
(file)
--- a/
nmigen/back/rtlil.py
+++ b/
nmigen/back/rtlil.py
@@
-128,8
+128,8
@@
class _ModuleBuilder(_Namer, _BufferedBuilder, _AttrBuilder):
self._append(" parameter \\{} \"{}\"\n",
param, value.translate(self._escape_map))
elif isinstance(value, int):
- self._append(" parameter \\{} {
:d
}\n",
- param, value)
+ self._append(" parameter \\{} {
}'{:b
}\n",
+ param,
bits_for(value),
value)
elif isinstance(value, float):
self._append(" parameter real \\{} \"{!r}\"\n",
param, value)