drtio: support external IBUFDS_GTE3

This commit is contained in:
Sebastien Bourdeauducq 2018-08-07 20:52:45 +08:00
parent 8b8e1844f0
commit e2a49ce368
1 changed files with 16 additions and 11 deletions

View File

@ -636,13 +636,17 @@ class GTH(Module, TransceiverInterface):
# # # # # #
refclk = Signal() create_buf = hasattr(clock_pads, "p")
ibufds_ceb = Signal() if create_buf:
self.specials += Instance("IBUFDS_GTE3", refclk = Signal()
i_CEB=ibufds_ceb, ibufds_ceb = Signal()
i_I=clock_pads.p, self.specials += Instance("IBUFDS_GTE3",
i_IB=clock_pads.n, i_CEB=ibufds_ceb,
o_O=refclk) i_I=clock_pads.p,
i_IB=clock_pads.n,
o_O=refclk)
else:
refclk = clock_pads
rtio_tx_clk = Signal() rtio_tx_clk = Signal()
channel_interfaces = [] channel_interfaces = []
@ -665,10 +669,11 @@ class GTH(Module, TransceiverInterface):
self.submodules.tx_phase_alignment = GTHTXPhaseAlignement(self.gths) self.submodules.tx_phase_alignment = GTHTXPhaseAlignement(self.gths)
TransceiverInterface.__init__(self, channel_interfaces) TransceiverInterface.__init__(self, channel_interfaces)
# GTH PLLs recover on their own from an interrupted clock input, if create_buf:
# but be paranoid about HMC7043 noise. # GTH PLLs recover on their own from an interrupted clock input,
self.stable_clkin.storage.attr.add("no_retiming") # but be paranoid about HMC7043 noise.
self.comb += ibufds_ceb.eq(~self.stable_clkin.storage) self.stable_clkin.storage.attr.add("no_retiming")
self.comb += ibufds_ceb.eq(~self.stable_clkin.storage)
self.comb += [ self.comb += [
self.cd_rtio.clk.eq(self.gths[master].cd_rtio_tx.clk), self.cd_rtio.clk.eq(self.gths[master].cd_rtio_tx.clk),