dvisampler/clocking: insert DCM_CLKGEN before PLL
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 14 Apr 2013 14:53:19 +0000 (16:53 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 14 Apr 2013 14:53:19 +0000 (16:53 +0200)
milkymist/dvisampler/clocking.py

index 16363a6656a4184f1dc43fae8ba64887c4619995..dcc2443e7c051b3b3c026653bfe17091c2224a94 100644 (file)
@@ -18,6 +18,19 @@ class Clocking(Module, AutoCSR):
 
                ###
 
+               clk_dejitter = Signal()
+               dcm_locked = Signal()
+               self.specials += Instance("DCM_CLKGEN",
+                       Instance.Parameter("CLKIN_PERIOD", 26.7),
+                       Instance.Parameter("CLKFX_DIVIDE", 2),
+                       Instance.Parameter("CLKFX_MULTIPLY", 2),
+                       Instance.Parameter("CLKFX_MD_MAX", 1.0),
+                       Instance.Input("CLKIN", pads.clk),
+                       Instance.Input("RST", self._r_pll_reset.storage),
+                       Instance.Output("CLKFX", clk_dejitter),
+                       Instance.Output("LOCKED", dcm_locked)
+               )
+
                clkfbout = Signal()
                pll_locked = Signal()
                pll_clk0 = Signal()
@@ -41,8 +54,8 @@ class Clocking(Module, AutoCSR):
                        Instance.Output("CLKOUT3", pll_clk3),
                        Instance.Output("LOCKED", pll_locked),
                        Instance.Input("CLKFBIN", clkfbout),
-                       Instance.Input("CLKIN", pads.clk),
-                       Instance.Input("RST", self._r_pll_reset.storage)
+                       Instance.Input("CLKIN", clk_dejitter),
+                       Instance.Input("RST", ~dcm_locked)
                )
 
                locked_async = Signal()