vendor.lattice_ice40: zero-pad CLKHF_DIV in SB_HFOSC instance.
authorDavid Lattimore <dvdlttmr@gmail.com>
Mon, 2 Nov 2020 06:19:47 +0000 (17:19 +1100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 31 Dec 2021 15:18:53 +0000 (15:18 +0000)
Fixes #520.

nmigen/vendor/lattice_ice40.py

index 14026fa268c12f487f9aaa5b24161ffb23cd5918..d5e4dd65e06cdc4bb6b816305d0c3cf22ccc69be 100644 (file)
@@ -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.