From eff7882721fc337713e5a754bb22709c1e98c16b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 4 Jul 2013 19:18:24 +0200 Subject: [PATCH] dvisampler: support differential input --- milkymist/dvisampler/__init__.py | 18 +++++++++++++----- milkymist/dvisampler/clocking.py | 12 +++++++++++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/milkymist/dvisampler/__init__.py b/milkymist/dvisampler/__init__.py index 5b74f53a..a752f1a3 100644 --- a/milkymist/dvisampler/__init__.py +++ b/milkymist/dvisampler/__init__.py @@ -19,11 +19,19 @@ class DVISampler(Module, AutoCSR): for datan in range(3): name = "data" + str(datan) invert = False - try: - s = getattr(pads, name) - except AttributeError: - s = getattr(pads, name + "_n") - invert = True + if hasattr(pads, name + "_p"): + s = Signal() + self.specials += Instance("IBUFDS", + Instance.Input("I", getattr(pads, name + "_p")), + Instance.Input("IB", getattr(pads, name + "_n")), + Instance.Output("O", s) + ) + else: + try: + s = getattr(pads, name) + except AttributeError: + s = getattr(pads, name + "_n") + invert = True cap = DataCapture(8, invert) setattr(self.submodules, name + "_cap", cap) diff --git a/milkymist/dvisampler/clocking.py b/milkymist/dvisampler/clocking.py index 07d4d490..bf6f01e8 100644 --- a/milkymist/dvisampler/clocking.py +++ b/milkymist/dvisampler/clocking.py @@ -16,6 +16,16 @@ class Clocking(Module, AutoCSR): ### + if hasattr(pads, "clk_p"): + clkin = Signal() + self.specials += Instance("IBUFDS", + Instance.Input("I", pads.clk_p), + Instance.Input("IB", pads.clk_n), + Instance.Output("O", clkin) + ) + else: + clkin = pads.clk + clkfbout = Signal() pll_locked = Signal() pll_clk0 = Signal() @@ -39,7 +49,7 @@ 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("CLKIN", clkin), Instance.Input("RST", self._r_pll_reset.storage) ) -- 2.30.2