Skip to content

Commit

Permalink
back.rtlil: infer bit width for instance parameters.
Browse files Browse the repository at this point in the history
Otherwise, Yosys assumes it is always 32, which is often
inappropriate.
  • Loading branch information
whitequark committed Nov 27, 2019
1 parent 56bb42a commit f8428ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nmigen/back/rtlil.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def cell(self, kind, name=None, params={}, ports={}, attrs={}, src=""):
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)
Expand Down

0 comments on commit f8428ff

Please sign in to comment.