forked from M-Labs/artiq
1
0
Fork 0

drtio: add support for 125MHz clock on GTX_1000BASE_BX10

This commit is contained in:
Sebastien Bourdeauducq 2016-10-29 17:30:29 +08:00
parent 95def81c03
commit 7c05dccf65
1 changed files with 18 additions and 7 deletions

View File

@ -10,7 +10,10 @@ from artiq.gateware.drtio.transceiver.gtx_7series_init import *
class GTX_1000BASE_BX10(Module): class GTX_1000BASE_BX10(Module):
rtio_clk_freq = 62.5e6 rtio_clk_freq = 62.5e6
def __init__(self, clock_pads, tx_pads, rx_pads, sys_clk_freq): # The transceiver clock on clock_pads must be 62.5MHz
# when clock_div2=False, and 125MHz when clock_div2=True.
def __init__(self, clock_pads, tx_pads, rx_pads, sys_clk_freq,
clock_div2=False):
self.submodules.encoder = ClockDomainsRenamer("rtio")( self.submodules.encoder = ClockDomainsRenamer("rtio")(
Encoder(2, True)) Encoder(2, True))
self.decoders = [ClockDomainsRenamer("rtio_rx")( self.decoders = [ClockDomainsRenamer("rtio_rx")(
@ -23,6 +26,14 @@ class GTX_1000BASE_BX10(Module):
# # # # # #
refclk = Signal() refclk = Signal()
if clock_div2:
self.specials += Instance("IBUFDS_GTE2",
i_CEB=0,
i_I=clock_pads.p,
i_IB=clock_pads.n,
o_ODIV2=refclk
)
else:
self.specials += Instance("IBUFDS_GTE2", self.specials += Instance("IBUFDS_GTE2",
i_CEB=0, i_CEB=0,
i_I=clock_pads.p, i_I=clock_pads.p,