From 781a3aa76776532657d79ea195a1ac28f18b23d6 Mon Sep 17 00:00:00 2001 From: David Lattimore Date: Mon, 2 Nov 2020 17:19:47 +1100 Subject: [PATCH] vendor.lattice_ice40: zero-pad CLKHF_DIV in SB_HFOSC instance. Fixes #520. --- nmigen/vendor/lattice_ice40.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmigen/vendor/lattice_ice40.py b/nmigen/vendor/lattice_ice40.py index 14026fa..d5e4dd6 100644 --- a/nmigen/vendor/lattice_ice40.py +++ b/nmigen/vendor/lattice_ice40.py @@ -379,7 +379,7 @@ class LatticeICE40Platform(TemplatedPlatform): m.submodules += Instance("SB_HFOSC", i_CLKHFEN=1, i_CLKHFPU=1, - p_CLKHF_DIV="0b{0:b}".format(self.hfosc_div), + p_CLKHF_DIV="0b{0:02b}".format(self.hfosc_div), o_CLKHF=clk_i) delay = int(100e-6 * self.default_clk_frequency) # Internal low-speed clock: 10 KHz. -- 2.30.2