back.rtlil: print real parameters with maximum precision.
authorwhitequark <cz@m-labs.hk>
Thu, 22 Aug 2019 04:42:30 +0000 (04:42 +0000)
committerwhitequark <cz@m-labs.hk>
Thu, 22 Aug 2019 04:42:30 +0000 (04:42 +0000)
nmigen/back/rtlil.py

index 3409d4cca8b04cfe6eb8932228f5cff8426dc5dc..73b05f33a3d73fd74cb523601d29cf64798191a3 100644 (file)
@@ -124,7 +124,7 @@ class _ModuleBuilder(_Namer, _BufferedBuilder, _AttrBuilder):
                 self._append("    parameter \\{} {:d}\n",
                              param, value)
             elif isinstance(value, float):
-                self._append("    parameter real \\{} \"{:f}\"\n",
+                self._append("    parameter real \\{} \"{!r}\"\n",
                              param, value)
             elif isinstance(value, ast.Const):
                 self._append("    parameter \\{} {}'{:b}\n",