Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dvisampler/clocking: insert DCM_CLKGEN before PLL

  • Loading branch information...
commit 8914969760583e3803b4028ad193b48b353b2898 1 parent f833bc9
Sébastien Bourdeauducq authored

Showing 1 changed file with 15 additions and 2 deletions. Show diff stats Hide diff stats

  1. 17  milkymist/dvisampler/clocking.py
17  milkymist/dvisampler/clocking.py
@@ -18,6 +18,19 @@ def __init__(self, pads):
18 18
 
19 19
 		###
20 20
 
  21
+		clk_dejitter = Signal()
  22
+		dcm_locked = Signal()
  23
+		self.specials += Instance("DCM_CLKGEN",
  24
+			Instance.Parameter("CLKIN_PERIOD", 26.7),
  25
+			Instance.Parameter("CLKFX_DIVIDE", 2),
  26
+			Instance.Parameter("CLKFX_MULTIPLY", 2),
  27
+			Instance.Parameter("CLKFX_MD_MAX", 1.0),
  28
+			Instance.Input("CLKIN", pads.clk),
  29
+			Instance.Input("RST", self._r_pll_reset.storage),
  30
+			Instance.Output("CLKFX", clk_dejitter),
  31
+			Instance.Output("LOCKED", dcm_locked)
  32
+		)
  33
+
21 34
 		clkfbout = Signal()
22 35
 		pll_locked = Signal()
23 36
 		pll_clk0 = Signal()
@@ -41,8 +54,8 @@ def __init__(self, pads):
41 54
 			Instance.Output("CLKOUT3", pll_clk3),
42 55
 			Instance.Output("LOCKED", pll_locked),
43 56
 			Instance.Input("CLKFBIN", clkfbout),
44  
-			Instance.Input("CLKIN", pads.clk),
45  
-			Instance.Input("RST", self._r_pll_reset.storage)
  57
+			Instance.Input("CLKIN", clk_dejitter),
  58
+			Instance.Input("RST", ~dcm_locked)
46 59
 		)
47 60
 
48 61
 		locked_async = Signal()

0 notes on commit 8914969

Please sign in to comment.
Something went wrong with that request. Please try again.