From: Darrell Harmon Date: Thu, 22 Aug 2019 04:13:05 +0000 (-0600) Subject: back.rtlil: add support for real (float) parameters on Instances. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=416fce226e945ca4c0b7f6f817fd38228271196f;p=nmigen.git back.rtlil: add support for real (float) parameters on Instances. Required for Xilinx MMCME2_BASE, etc. --- diff --git a/nmigen/back/rtlil.py b/nmigen/back/rtlil.py index 875212d..3409d4c 100644 --- a/nmigen/back/rtlil.py +++ b/nmigen/back/rtlil.py @@ -123,6 +123,9 @@ class _ModuleBuilder(_Namer, _BufferedBuilder, _AttrBuilder): elif isinstance(value, int): self._append(" parameter \\{} {:d}\n", param, value) + elif isinstance(value, float): + self._append(" parameter real \\{} \"{:f}\"\n", + param, value) elif isinstance(value, ast.Const): self._append(" parameter \\{} {}'{:b}\n", param, len(value), value.value)