From e2a49ce368a7952285b62cfd0eb9d8837aaf3de5 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 7 Aug 2018 20:52:45 +0800 Subject: [PATCH] drtio: support external IBUFDS_GTE3 --- .../drtio/transceiver/gth_ultrascale.py | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/artiq/gateware/drtio/transceiver/gth_ultrascale.py b/artiq/gateware/drtio/transceiver/gth_ultrascale.py index 35969f233..30eed79fa 100644 --- a/artiq/gateware/drtio/transceiver/gth_ultrascale.py +++ b/artiq/gateware/drtio/transceiver/gth_ultrascale.py @@ -636,13 +636,17 @@ class GTH(Module, TransceiverInterface): # # # - refclk = Signal() - ibufds_ceb = Signal() - self.specials += Instance("IBUFDS_GTE3", - i_CEB=ibufds_ceb, - i_I=clock_pads.p, - i_IB=clock_pads.n, - o_O=refclk) + create_buf = hasattr(clock_pads, "p") + if create_buf: + refclk = Signal() + ibufds_ceb = Signal() + self.specials += Instance("IBUFDS_GTE3", + i_CEB=ibufds_ceb, + i_I=clock_pads.p, + i_IB=clock_pads.n, + o_O=refclk) + else: + refclk = clock_pads rtio_tx_clk = Signal() channel_interfaces = [] @@ -665,10 +669,11 @@ class GTH(Module, TransceiverInterface): self.submodules.tx_phase_alignment = GTHTXPhaseAlignement(self.gths) TransceiverInterface.__init__(self, channel_interfaces) - # GTH PLLs recover on their own from an interrupted clock input, - # but be paranoid about HMC7043 noise. - self.stable_clkin.storage.attr.add("no_retiming") - self.comb += ibufds_ceb.eq(~self.stable_clkin.storage) + if create_buf: + # GTH PLLs recover on their own from an interrupted clock input, + # but be paranoid about HMC7043 noise. + self.stable_clkin.storage.attr.add("no_retiming") + self.comb += ibufds_ceb.eq(~self.stable_clkin.storage) self.comb += [ self.cd_rtio.clk.eq(self.gths[master].cd_rtio_tx.clk),