@@ -11,9 +11,8 @@ class GTX_20X(Module):
11
11
# The transceiver clock on clock_pads must be at the RTIO clock
12
12
# frequency when clock_div2=False, and 2x that frequency when
13
13
# clock_div2=True.
14
- def __init__ (self , platform ,
15
- clock_pads , tx_pads , rx_pads ,
16
- sys_clk_freq , clock_div2 = False ):
14
+ def __init__ (self , clock_pads , tx_pads , rx_pads , sys_clk_freq ,
15
+ clock_div2 = False ):
17
16
self .submodules .encoder = ClockDomainsRenamer ("rtio" )(
18
17
Encoder (2 , True ))
19
18
self .decoders = [ClockDomainsRenamer ("rtio_rx" )(
@@ -22,6 +21,11 @@ def __init__(self, platform,
22
21
23
22
self .rx_ready = Signal ()
24
23
24
+ # transceiver direct clock outputs
25
+ # useful to specify clock constraints in a way palatable to Vivado
26
+ self .txoutclk = Signal ()
27
+ self .rxoutclk = Signal ()
28
+
25
29
# # #
26
30
27
31
refclk = Signal ()
@@ -50,9 +54,7 @@ def __init__(self, platform,
50
54
self .comb += tx_init .cplllock .eq (cplllock ), \
51
55
rx_init .cplllock .eq (cplllock )
52
56
53
- txoutclk = Signal ()
54
57
txdata = Signal (20 )
55
- rxoutclk = Signal ()
56
58
rxdata = Signal (20 )
57
59
self .specials += \
58
60
Instance ("GTXE2_CHANNEL" ,
@@ -88,7 +90,7 @@ def __init__(self, platform,
88
90
# TX clock
89
91
p_TXBUF_EN = "FALSE" ,
90
92
p_TX_XCLK_SEL = "TXUSR" ,
91
- o_TXOUTCLK = txoutclk ,
93
+ o_TXOUTCLK = self . txoutclk ,
92
94
i_TXSYSCLKSEL = 0b00 ,
93
95
i_TXOUTCLKSEL = 0b11 ,
94
96
@@ -134,7 +136,7 @@ def __init__(self, platform,
134
136
i_RXDDIEN = 1 ,
135
137
i_RXSYSCLKSEL = 0b00 ,
136
138
i_RXOUTCLKSEL = 0b010 ,
137
- o_RXOUTCLK = rxoutclk ,
139
+ o_RXOUTCLK = self . rxoutclk ,
138
140
i_RXUSRCLK = ClockSignal ("rtio_rx" ),
139
141
i_RXUSRCLK2 = ClockSignal ("rtio_rx" ),
140
142
p_RXCDR_CFG = 0x03000023FF10100020 ,
@@ -165,20 +167,17 @@ def __init__(self, platform,
165
167
self .sync += tx_reset_deglitched .eq (~ tx_init .done )
166
168
self .clock_domains .cd_rtio = ClockDomain ()
167
169
self .specials += [
168
- Instance ("BUFG" , i_I = txoutclk , o_O = self .cd_rtio .clk ),
170
+ Instance ("BUFG" , i_I = self . txoutclk , o_O = self .cd_rtio .clk ),
169
171
AsyncResetSynchronizer (self .cd_rtio , tx_reset_deglitched )
170
172
]
171
173
rx_reset_deglitched = Signal ()
172
174
rx_reset_deglitched .attr .add ("no_retiming" )
173
175
self .sync .rtio += rx_reset_deglitched .eq (~ rx_init .done )
174
176
self .clock_domains .cd_rtio_rx = ClockDomain ()
175
177
self .specials += [
176
- Instance ("BUFG" , i_I = rxoutclk , o_O = self .cd_rtio_rx .clk ),
178
+ Instance ("BUFG" , i_I = self . rxoutclk , o_O = self .cd_rtio_rx .clk ),
177
179
AsyncResetSynchronizer (self .cd_rtio_rx , rx_reset_deglitched )
178
180
]
179
- platform .add_period_constraint (txoutclk , 1e9 / self .rtio_clk_freq )
180
- platform .add_period_constraint (rxoutclk , 1e9 / self .rtio_clk_freq )
181
- platform .add_false_path_constraints (txoutclk , rxoutclk )
182
181
183
182
self .comb += [
184
183
txdata .eq (Cat (self .encoder .output [0 ], self .encoder .output [1 ])),
0 commit comments