From 8914969760583e3803b4028ad193b48b353b2898 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 14 Apr 2013 16:53:19 +0200 Subject: [PATCH] dvisampler/clocking: insert DCM_CLKGEN before PLL --- milkymist/dvisampler/clocking.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/milkymist/dvisampler/clocking.py b/milkymist/dvisampler/clocking.py index 16363a665..dcc2443e7 100644 --- a/milkymist/dvisampler/clocking.py +++ b/milkymist/dvisampler/clocking.py @@ -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()