From aefde85031bee5fad869fcdeab5d0f6876475b8d Mon Sep 17 00:00:00 2001 From: Darrell Harmon Date: Wed, 21 Aug 2019 22:13:05 -0600 Subject: [PATCH] back.rtlil: add support for real (float) parameters on Instances. Required for Xilinx MMCME2_BASE, etc. --- nmigen/back/rtlil.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.30.2