fix Arty A7-100t PLL with quick demo
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 20 Mar 2022 13:18:21 +0000 (13:18 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 20 Mar 2022 13:18:21 +0000 (13:18 +0000)
src/arty_a7.py [new file with mode: 0644]
src/arty_crg.py

diff --git a/src/arty_a7.py b/src/arty_a7.py
new file mode 100644 (file)
index 0000000..3361cec
--- /dev/null
@@ -0,0 +1,15 @@
+from nmigen import Elaboratable, Module
+from nmigen_boards.test.blinky import Blinky
+from nmigen_boards.arty_a7 import ArtyA7_100Platform
+from arty_crg import ArtyA7CRG
+
+class BlinkyClocked(Elaboratable):
+    def elaborate(self, platform):
+        m = Module()
+        m.submodules.crg = ArtyA7CRG(25e6)
+        m.submodules.blinky = Blinky()
+        return m
+
+if __name__ == "__main__":
+    ArtyA7_100Platform(toolchain="yosys_nextpnr").build(BlinkyClocked(),
+                        do_program=True)
index e1a7c65a46944bd512ce9ce04f3d4e581e3a9b5b..ef57b0b47711f1c11d63fa093523b6dd874e32d7 100644 (file)
@@ -363,16 +363,9 @@ class ArtyA7CRG(Elaboratable):
         #m.domains += cd_eth
         m.domains += dramsync
 
-        clk100_ibuf = Signal()
-        clk100_buf  = Signal()
-        m.submodules += [
-            Instance("IBUF", i_I=clk100, o_O=clk100_ibuf),
-            Instance("BUFG", i_I=clk100_ibuf, o_O=clk100_buf)
-        ]
-
-        m.submodules.pll = pll = S7PLL(clk100_buf, speedgrade=-1)
+        m.submodules.pll = pll = S7PLL(clk100, speedgrade=-1)
         reset = platform.request(platform.default_rst).i
-        m.d.comb += pll.reset.eq(~reset)
+        m.d.comb += pll.reset.eq(reset)
         pll.set_clkin_freq(100e6)
 
         pll.create_clkout(sync, self.sys_clk_freq)