1 ------------------------------------------------------------------------------
4 -- /___/ \ / Vendor: Xilinx
5 -- \ \ \/ Version : 2.
7
6 -- \ \ Application : 7 Series FPGAs Transceivers Wizard
7 -- / / Filename : uhtr_trigpd_init.vhd
12 -- Description : This module instantiates the modules required for
13 -- reset and initialisation of the Transceiver
15 -- Module uHTR_trigPD_init
16 -- Generated by Xilinx 7 Series FPGAs Transceivers Wizard
19 -- (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved.
21 -- This file contains confidential and proprietary information
22 -- of Xilinx, Inc. and is protected under U.S. and
23 -- international copyright and other intellectual property
27 -- This disclaimer is not a license and does not grant any
28 -- rights to the materials distributed herewith. Except as
29 -- otherwise provided in a valid license issued to you by
30 -- Xilinx, and to the maximum extent permitted by applicable
31 -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS"
AND
32 -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
33 -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
34 -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
35 -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
36 -- (2) Xilinx shall
not be liable (whether
in contract
or tort,
37 -- including negligence, or under any other theory of
38 -- liability) for any loss or damage of any kind or nature
39 -- related to, arising under or in connection with these
40 -- materials, including for any direct, or any indirect,
41 -- special, incidental, or consequential loss or damage
42 -- (including loss of data, profits, goodwill, or any type of
43 -- loss or damage suffered as a result of any action brought
44 -- by a third party) even if such damage or loss was
45 -- reasonably foreseeable or Xilinx had been advised of the
46 -- possibility of the same.
48 -- CRITICAL APPLICATIONS
49 -- Xilinx products are not designed or intended to be fail-
50 -- safe, or for use in any application requiring fail-safe
51 -- performance, such as life-support or safety devices or
52 -- systems, Class III medical devices, nuclear facilities,
53 -- applications related to the deployment of airbags, or any
54 -- other applications that could lead to death, personal
55 -- injury, or severe property or environmental damage
56 -- (individually and collectively, "Critical
57 -- Applications"). Customer assumes the sole risk and
58 -- liability of any use of Xilinx products in Critical
59 -- Applications, subject only to applicable laws and
60 -- regulations governing limitations on product liability.
62 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
63 -- PART OF THIS FILE AT ALL TIMES.
67 use ieee.std_logic_1164.
all;
68 use ieee.numeric_std.
all;
69 use ieee.std_logic_unsigned.
all;
71 use UNISIM.VCOMPONENTS.
ALL;
73 --***********************************Entity Declaration************************
78 EXAMPLE_SIM_GTRESET_SPEEDUP : := "TRUE";
-- simulation setting for GT SecureIP model
79 EXAMPLE_SIMULATION : := 0;
-- Set to 1 for simulation
80 STABLE_CLOCK_PERIOD : := 20;
--Period of the stable clock driving this state-machine, unit is [ns]
81 EXAMPLE_USE_CHIPSCOPE : := 0 -- Set to 1 to use Chipscope
to drive resets
88 DONT_RESET_ON_DATA_ERROR_IN : in ;
89 GT0_TX_FSM_RESET_DONE_OUT : out ;
90 GT0_RX_FSM_RESET_DONE_OUT : out ;
91 GT0_DATA_VALID_IN : in ;
93 --_________________________________________________________________________
95 --____________________________CHANNEL PORTS________________________________
96 --------------------------------- CPLL Ports -------------------------------
97 GT0_CPLLFBCLKLOST_OUT : out ;
98 GT0_CPLLLOCK_OUT : out ;
99 GT0_CPLLLOCKDETCLK_IN : in ;
100 GT0_CPLLRESET_IN : in ;
101 -------------------------- Channel - Clocking Ports ------------------------
102 GT0_GTREFCLK0_IN : in ;
103 ---------------------------- Channel - DRP Ports --------------------------
104 GT0_DRPADDR_IN : in (8 downto 0);
106 GT0_DRPDI_IN : in (15 downto 0);
107 GT0_DRPDO_OUT : out (15 downto 0);
109 GT0_DRPRDY_OUT : out ;
111 ------------------------------ Power-Down Ports ----------------------------
112 GT0_RXPD_IN : in (1 downto 0);
113 GT0_TXPD_IN : in (1 downto 0);
114 --------------------- RX Initialization and Reset Ports --------------------
115 GT0_RXUSERRDY_IN : in ;
116 -------------------------- RX Margin Analysis Ports ------------------------
117 GT0_EYESCANDATAERROR_OUT : out ;
118 ------------------------- Receive Ports - CDR Ports ------------------------
119 GT0_RXCDRLOCK_OUT : out ;
120 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
121 GT0_RXUSRCLK_IN : in ;
122 GT0_RXUSRCLK2_IN : in ;
123 ------------------ Receive Ports - FPGA RX interface Ports -----------------
124 GT0_RXDATA_OUT : out (31 downto 0);
125 ------------------- Receive Ports - Pattern Checker Ports ------------------
126 GT0_RXPRBSERR_OUT : out ;
127 GT0_RXPRBSSEL_IN : in (2 downto 0);
128 ------------------- Receive Ports - Pattern Checker ports ------------------
129 GT0_RXPRBSCNTRESET_IN : in ;
130 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
131 GT0_RXDISPERR_OUT : out (3 downto 0);
132 GT0_RXNOTINTABLE_OUT : out (3 downto 0);
133 --------------------------- Receive Ports - RX AFE -------------------------
135 ------------------------ Receive Ports - RX AFE Ports ----------------------
137 ------------- Receive Ports - RX Initialization and Reset Ports ------------
138 GT0_GTRXRESET_IN : in ;
139 GT0_RXPMARESET_IN : in ;
140 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
141 GT0_RXCHARISK_OUT : out (3 downto 0);
142 -------------- Receive Ports -RX Initialization and Reset Ports ------------
143 GT0_RXRESETDONE_OUT : out ;
144 --------------------- TX Initialization and Reset Ports --------------------
145 GT0_GTTXRESET_IN : in ;
146 GT0_TXUSERRDY_IN : in ;
147 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
148 GT0_TXUSRCLK_IN : in ;
149 GT0_TXUSRCLK2_IN : in ;
150 ------------------ Transmit Ports - TX Data Path interface -----------------
151 GT0_TXDATA_IN : in (31 downto 0);
152 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
153 GT0_GTXTXN_OUT : out ;
154 GT0_GTXTXP_OUT : out ;
155 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
156 GT0_TXOUTCLK_OUT : out ;
157 GT0_TXOUTCLKFABRIC_OUT : out ;
158 GT0_TXOUTCLKPCS_OUT : out ;
159 --------------------- Transmit Ports - TX Gearbox Ports --------------------
160 GT0_TXCHARISK_IN : in (3 downto 0);
161 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
162 GT0_TXRESETDONE_OUT : out ;
163 ------------------ Transmit Ports - pattern Generator Ports ----------------
164 GT0_TXPRBSSEL_IN : in (2 downto 0);
167 --____________________________COMMON PORTS________________________________
168 ---------------------- Common Block - Ref Clock Ports ---------------------
169 GT0_GTREFCLK0_COMMON_IN : in ;
170 ------------------------- Common Block - QPLL Ports ------------------------
171 GT0_QPLLLOCK_OUT : out ;
172 GT0_QPLLLOCKDETCLK_IN : in ;
173 GT0_QPLLRESET_IN : in
178 end uHTR_trigPD_init;
182 --**************************Component Declarations*****************************
188 -- Simulation attributes
189 WRAPPER_SIM_GTRESET_SPEEDUP : :=
"FALSE" -- Set to 1 to speed up sim reset
195 --_________________________________________________________________________
196 --_________________________________________________________________________
198 --____________________________CHANNEL PORTS________________________________
199 --------------------------------- CPLL Ports -------------------------------
200 GT0_CPLLFBCLKLOST_OUT :
out ;
201 GT0_CPLLLOCK_OUT :
out ;
202 GT0_CPLLLOCKDETCLK_IN :
in ;
203 GT0_CPLLREFCLKLOST_OUT :
out ;
204 GT0_CPLLRESET_IN :
in ;
205 -------------------------- Channel - Clocking Ports ------------------------
206 GT0_GTREFCLK0_IN :
in ;
207 ---------------------------- Channel - DRP Ports --------------------------
208 GT0_DRPADDR_IN :
in (
8 downto 0);
210 GT0_DRPDI_IN :
in (
15 downto 0);
211 GT0_DRPDO_OUT :
out (
15 downto 0);
213 GT0_DRPRDY_OUT :
out ;
215 ------------------------------ Power-Down Ports ----------------------------
216 GT0_RXPD_IN :
in (
1 downto 0);
217 GT0_TXPD_IN :
in (
1 downto 0);
218 --------------------- RX Initialization and Reset Ports --------------------
219 GT0_RXUSERRDY_IN :
in ;
220 -------------------------- RX Margin Analysis Ports ------------------------
221 GT0_EYESCANDATAERROR_OUT :
out ;
222 ------------------------- Receive Ports - CDR Ports ------------------------
223 GT0_RXCDRLOCK_OUT :
out ;
224 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
225 GT0_RXUSRCLK_IN :
in ;
226 GT0_RXUSRCLK2_IN :
in ;
227 ------------------ Receive Ports - FPGA RX interface Ports -----------------
228 GT0_RXDATA_OUT :
out (
31 downto 0);
229 ------------------- Receive Ports - Pattern Checker Ports ------------------
230 GT0_RXPRBSERR_OUT :
out ;
231 GT0_RXPRBSSEL_IN :
in (
2 downto 0);
232 ------------------- Receive Ports - Pattern Checker ports ------------------
233 GT0_RXPRBSCNTRESET_IN :
in ;
234 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
235 GT0_RXDISPERR_OUT :
out (
3 downto 0);
236 GT0_RXNOTINTABLE_OUT :
out (
3 downto 0);
237 --------------------------- Receive Ports - RX AFE -------------------------
239 ------------------------ Receive Ports - RX AFE Ports ----------------------
241 -------------------- Receive Ports - RX Equailizer Ports -------------------
242 GT0_RXLPMHFHOLD_IN :
in ;
243 GT0_RXLPMLFHOLD_IN :
in ;
244 --------------- Receive Ports - RX Fabric Output Control Ports -------------
245 GT0_RXOUTCLK_OUT :
out ;
246 ------------- Receive Ports - RX Initialization and Reset Ports ------------
247 GT0_GTRXRESET_IN :
in ;
248 GT0_RXPMARESET_IN :
in ;
249 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
250 GT0_RXCHARISK_OUT :
out (
3 downto 0);
251 -------------- Receive Ports -RX Initialization and Reset Ports ------------
252 GT0_RXRESETDONE_OUT :
out ;
253 --------------------- TX Initialization and Reset Ports --------------------
254 GT0_GTTXRESET_IN :
in ;
255 GT0_TXUSERRDY_IN :
in ;
256 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
257 GT0_TXUSRCLK_IN :
in ;
258 GT0_TXUSRCLK2_IN :
in ;
259 ------------------ Transmit Ports - TX Data Path interface -----------------
260 GT0_TXDATA_IN :
in (
31 downto 0);
261 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
262 GT0_GTXTXN_OUT :
out ;
263 GT0_GTXTXP_OUT :
out ;
264 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
265 GT0_TXOUTCLK_OUT :
out ;
266 GT0_TXOUTCLKFABRIC_OUT :
out ;
267 GT0_TXOUTCLKPCS_OUT :
out ;
268 --------------------- Transmit Ports - TX Gearbox Ports --------------------
269 GT0_TXCHARISK_IN :
in (
3 downto 0);
270 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
271 GT0_TXRESETDONE_OUT :
out ;
272 ------------------ Transmit Ports - pattern Generator Ports ----------------
273 GT0_TXPRBSSEL_IN :
in (
2 downto 0);
276 --____________________________COMMON PORTS________________________________
277 ---------------------- Common Block - Ref Clock Ports ---------------------
278 GT0_GTREFCLK0_COMMON_IN :
in ;
279 ------------------------- Common Block - QPLL Ports ------------------------
280 GT0_QPLLLOCK_OUT :
out ;
281 GT0_QPLLLOCKDETCLK_IN :
in ;
282 GT0_QPLLREFCLKLOST_OUT :
out ;
283 GT0_QPLLRESET_IN :
in
292 STABLE_CLOCK_PERIOD :
range 4 to 250 :=
8;
--Period of the stable clock driving this state-machine, unit is [ns]
293 RETRY_COUNTER_BITWIDTH :
range 2 to 8 :=
8;
294 TX_QPLL_USED : := False;
-- the TX and RX Reset FSMs must
295 RX_QPLL_USED : := False;
-- share these two generic values
296 PHASE_ALIGNMENT_MANUAL : := True
-- Decision if a manual phase-alignment is necessary or the automatic
297 -- is enough. For single-lane applications the automatic alignment is
300 Port ( STABLE_CLOCK :
in ;
--Stable Clock, either a stable clock from the PCB
301 --or reference-clock present at startup.
302 TXUSERCLK :
in ;
--TXUSERCLK as used in the design
303 SOFT_RESET :
in ;
--User Reset, can be pulled any
304 QPLLREFCLKLOST :
in ;
--QPLL Reference-clock for the GT is lost
305 CPLLREFCLKLOST :
in ;
--CPLL Reference-clock for the GT is lost
306 QPLLLOCK :
in ;
--Lock Detect from the QPLL of the GT
307 CPLLLOCK :
in ;
--Lock Detect from the CPLL of the GT
310 GTTXRESET :
out :='
0';
311 MMCM_RESET :
out :='
0';
312 QPLL_RESET :
out :='
0';
--Reset QPLL
313 CPLL_RESET :
out :='
0';
--Reset CPLL
314 TX_FSM_RESET_DONE :
out :='
0';
--Reset-sequence has sucessfully been finished.
315 TXUSERRDY :
out :='
0';
316 RUN_PHALIGNMENT :
out :='
0';
317 RESET_PHALIGNMENT :
out :='
0';
318 PHALIGNMENT_DONE :
in ;
320 RETRY_COUNTER :
out (RETRY_COUNTER_BITWIDTH
-1 downto 0):=(
others=>'
0')
-- Number of
321 -- Retries it took to get the transceiver up and running
327 EXAMPLE_SIMULATION : :=
0;
330 STABLE_CLOCK_PERIOD :
range 4 to 250 :=
8;
--Period of the stable clock driving this state-machine, unit is [ns]
331 RETRY_COUNTER_BITWIDTH :
range 2 to 8 :=
8;
332 TX_QPLL_USED : := False;
-- the TX and RX Reset FSMs must
333 RX_QPLL_USED : := False;
-- share these two generic values
334 PHASE_ALIGNMENT_MANUAL : := True
-- Decision if a manual phase-alignment is necessary or the automatic
335 -- is enough. For single-lane applications the automatic alignment is
338 Port ( STABLE_CLOCK :
in ;
--Stable Clock, either a stable clock from the PCB
339 --or reference-clock present at startup.
340 RXUSERCLK :
in ;
--RXUSERCLK as used in the design
341 SOFT_RESET :
in ;
--User Reset, can be pulled any
342 QPLLREFCLKLOST :
in ;
--QPLL Reference-clock for the GT is lost
343 CPLLREFCLKLOST :
in ;
--CPLL Reference-clock for the GT is lost
344 QPLLLOCK :
in ;
--Lock Detect from the QPLL of the GT
345 CPLLLOCK :
in ;
--Lock Detect from the CPLL of the GT
349 RECCLK_MONITOR_RESTART :
in ;
351 TXUSERRDY :
in ;
--TXUSERRDY from GT
352 DONT_RESET_ON_DATA_ERROR :
in ;
353 GTRXRESET :
out :='
0';
354 MMCM_RESET :
out :='
0';
355 QPLL_RESET :
out :='
0';
--Reset QPLL (only if RX uses QPLL)
356 CPLL_RESET :
out :='
0';
--Reset CPLL (only if RX uses CPLL)
357 RX_FSM_RESET_DONE :
out :='
0';
--Reset-sequence has sucessfully been finished.
358 RXUSERRDY :
out :='
0';
359 RUN_PHALIGNMENT :
out ;
360 PHALIGNMENT_DONE :
in ;
361 RESET_PHALIGNMENT :
out :='
0';
366 RETRY_COUNTER :
out (RETRY_COUNTER_BITWIDTH
-1 downto 0):=(
others=>'
0')
-- Number of
367 -- Retries it took to get the transceiver up and running
376 function get_cdrlock_time(is_sim :
in )
return is
377 variable lock_time: ;
382 lock_time :=
50000 / (
1.
6); --Typical CDR lock
is 50,000UI as per DS183
388 --***********************************Parameter Declarations********************
390 constant DLY : := 1 ns;
391 constant RX_CDRLOCK_TIME : := get_cdrlock_time(EXAMPLE_SIMULATION);
-- 200us
392 constant WAIT_TIME_CDRLOCK : := RX_CDRLOCK_TIME / STABLE_CLOCK_PERIOD;
-- 200 us time-out
394 -------------------------- GT Wrapper Wires ------------------------------
395 signal gt0_cpllreset_i : ;
396 signal gt0_cpllreset_t : ;
397 signal gt0_cpllrefclklost_i : ;
398 signal gt0_cplllock_i : ;
399 signal gt0_txresetdone_i : ;
400 signal gt0_rxresetdone_i : ;
401 signal gt0_gttxreset_i : ;
402 signal gt0_gttxreset_t : ;
403 signal gt0_gtrxreset_i : ;
404 signal gt0_gtrxreset_t : ;
405 signal gt0_rxdfelpmreset_i : ;
406 signal gt0_txuserrdy_i : ;
407 signal gt0_txuserrdy_t : ;
408 signal gt0_rxuserrdy_i : ;
409 signal gt0_rxuserrdy_t : ;
411 signal gt0_rxdfeagchold_i : ;
412 signal gt0_rxdfelfhold_i : ;
413 signal gt0_rxlpmlfhold_i : ;
414 signal gt0_rxlpmhfhold_i : ;
418 signal gt0_qpllreset_i : ;
419 signal gt0_qpllreset_t : ;
420 signal gt0_qpllrefclklost_i : ;
421 signal gt0_qplllock_i : ;
424 ------------------------------- Global Signals -----------------------------
425 signal tied_to_ground_i : ;
426 signal tied_to_vcc_i : ;
428 signal gt0_rxoutclk_i : ;
429 signal gt0_recclk_stable_i : ;
436 signal rx_cdrlock_counter : range 0 to WAIT_TIME_CDRLOCK:= 0 ;
437 signal rx_cdrlocked : ;
443 --**************************** Main Body of Code *******************************
445 -- Static signal Assigments
446 tied_to_ground_i <= '0';
447 tied_to_vcc_i <= '1';
449 ----------------------------- The GT Wrapper -----------------------------
451 -- Use the instantiation template in the example directory to add the GT wrapper to your design.
452 -- In this example, the wrapper is wired up for basic operation with a frame generator and frame
453 -- checker. The GTs will reset, then attempt to align and transmit data. If channel bonding is
454 -- enabled, bonding should occur after alignment.
460 WRAPPER_SIM_GTRESET_SPEEDUP => EXAMPLE_SIM_GTRESET_SPEEDUP
465 --_____________________________________________________________________
466 --_____________________________________________________________________
469 --------------------------------- CPLL Ports -------------------------------
470 GT0_CPLLFBCLKLOST_OUT => GT0_CPLLFBCLKLOST_OUT ,
471 GT0_CPLLLOCK_OUT => gt0_cplllock_i,
472 GT0_CPLLLOCKDETCLK_IN => GT0_CPLLLOCKDETCLK_IN ,
473 GT0_CPLLREFCLKLOST_OUT => gt0_cpllrefclklost_i ,
474 GT0_CPLLRESET_IN => gt0_cpllreset_i,
475 -------------------------- Channel - Clocking Ports ------------------------
476 GT0_GTREFCLK0_IN => GT0_GTREFCLK0_IN,
477 ---------------------------- Channel - DRP Ports --------------------------
478 GT0_DRPADDR_IN => GT0_DRPADDR_IN,
479 GT0_DRPCLK_IN => GT0_DRPCLK_IN,
480 GT0_DRPDI_IN => GT0_DRPDI_IN,
481 GT0_DRPDO_OUT => GT0_DRPDO_OUT,
482 GT0_DRPEN_IN => GT0_DRPEN_IN,
483 GT0_DRPRDY_OUT => GT0_DRPRDY_OUT,
484 GT0_DRPWE_IN => GT0_DRPWE_IN,
485 ------------------------------ Power-Down Ports ----------------------------
486 GT0_RXPD_IN => GT0_RXPD_IN,
487 GT0_TXPD_IN => GT0_TXPD_IN,
488 --------------------- RX Initialization and Reset Ports --------------------
489 GT0_RXUSERRDY_IN => gt0_rxuserrdy_i,
490 -------------------------- RX Margin Analysis Ports ------------------------
491 GT0_EYESCANDATAERROR_OUT => GT0_EYESCANDATAERROR_OUT,
492 ------------------------- Receive Ports - CDR Ports ------------------------
493 GT0_RXCDRLOCK_OUT => GT0_RXCDRLOCK_OUT,
494 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
495 GT0_RXUSRCLK_IN => GT0_RXUSRCLK_IN,
496 GT0_RXUSRCLK2_IN => GT0_RXUSRCLK2_IN,
497 ------------------ Receive Ports - FPGA RX interface Ports -----------------
498 GT0_RXDATA_OUT => GT0_RXDATA_OUT,
499 ------------------- Receive Ports - Pattern Checker Ports ------------------
500 GT0_RXPRBSERR_OUT => GT0_RXPRBSERR_OUT,
501 GT0_RXPRBSSEL_IN => GT0_RXPRBSSEL_IN,
502 ------------------- Receive Ports - Pattern Checker ports ------------------
503 GT0_RXPRBSCNTRESET_IN => GT0_RXPRBSCNTRESET_IN ,
504 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
505 GT0_RXDISPERR_OUT => GT0_RXDISPERR_OUT,
506 GT0_RXNOTINTABLE_OUT => GT0_RXNOTINTABLE_OUT ,
507 --------------------------- Receive Ports - RX AFE -------------------------
508 GT0_GTXRXP_IN => GT0_GTXRXP_IN,
509 ------------------------ Receive Ports - RX AFE Ports ----------------------
510 GT0_GTXRXN_IN => GT0_GTXRXN_IN,
511 -------------------- Receive Ports - RX Equailizer Ports -------------------
512 GT0_RXLPMHFHOLD_IN => gt0_rxlpmhfhold_i,
513 GT0_RXLPMLFHOLD_IN => gt0_rxlpmlfhold_i,
514 --------------- Receive Ports - RX Fabric Output Control Ports -------------
515 GT0_RXOUTCLK_OUT => gt0_rxoutclk_i,
516 ------------- Receive Ports - RX Initialization and Reset Ports ------------
517 GT0_GTRXRESET_IN => gt0_gtrxreset_i,
518 GT0_RXPMARESET_IN => GT0_RXPMARESET_IN,
519 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
520 GT0_RXCHARISK_OUT => GT0_RXCHARISK_OUT,
521 -------------- Receive Ports -RX Initialization and Reset Ports ------------
522 GT0_RXRESETDONE_OUT => gt0_rxresetdone_i,
523 --------------------- TX Initialization and Reset Ports --------------------
524 GT0_GTTXRESET_IN => gt0_gttxreset_i,
525 GT0_TXUSERRDY_IN => gt0_txuserrdy_i,
526 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
527 GT0_TXUSRCLK_IN => GT0_TXUSRCLK_IN,
528 GT0_TXUSRCLK2_IN => GT0_TXUSRCLK2_IN,
529 ------------------ Transmit Ports - TX Data Path interface -----------------
530 GT0_TXDATA_IN => GT0_TXDATA_IN,
531 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
532 GT0_GTXTXN_OUT => GT0_GTXTXN_OUT,
533 GT0_GTXTXP_OUT => GT0_GTXTXP_OUT,
534 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
535 GT0_TXOUTCLK_OUT => GT0_TXOUTCLK_OUT,
536 GT0_TXOUTCLKFABRIC_OUT => GT0_TXOUTCLKFABRIC_OUT ,
537 GT0_TXOUTCLKPCS_OUT => GT0_TXOUTCLKPCS_OUT ,
538 --------------------- Transmit Ports - TX Gearbox Ports --------------------
539 GT0_TXCHARISK_IN => GT0_TXCHARISK_IN,
540 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
541 GT0_TXRESETDONE_OUT => gt0_txresetdone_i,
542 ------------------ Transmit Ports - pattern Generator Ports ----------------
543 GT0_TXPRBSSEL_IN => GT0_TXPRBSSEL_IN,
548 --____________________________COMMON PORTS________________________________
549 ---------------------- Common Block - Ref Clock Ports ---------------------
550 GT0_GTREFCLK0_COMMON_IN => GT0_GTREFCLK0_COMMON_IN ,
551 ------------------------- Common Block - QPLL Ports ------------------------
552 GT0_QPLLLOCK_OUT => gt0_qplllock_i,
553 GT0_QPLLLOCKDETCLK_IN => GT0_QPLLLOCKDETCLK_IN ,
554 GT0_QPLLREFCLKLOST_OUT => gt0_qpllrefclklost_i ,
555 GT0_QPLLRESET_IN => gt0_qpllreset_i
560 gt0_rxdfelpmreset_i <= tied_to_ground_i;
565 GT0_CPLLLOCK_OUT <= gt0_cplllock_i;
566 GT0_TXRESETDONE_OUT <= gt0_txresetdone_i;
567 GT0_RXRESETDONE_OUT <= gt0_rxresetdone_i;
568 GT0_QPLLLOCK_OUT <= gt0_qplllock_i;
570 chipscope : if EXAMPLE_USE_CHIPSCOPE = 1 generate
571 gt0_cpllreset_i <= GT0_CPLLRESET_IN or gt0_cpllreset_t;
572 gt0_gttxreset_i <= GT0_GTTXRESET_IN or gt0_gttxreset_t;
573 gt0_gtrxreset_i <= GT0_GTRXRESET_IN or gt0_gtrxreset_t;
574 gt0_txuserrdy_i <= GT0_TXUSERRDY_IN or gt0_txuserrdy_t;
575 gt0_rxuserrdy_i <= GT0_RXUSERRDY_IN or gt0_rxuserrdy_t;
576 gt0_qpllreset_i <= GT0_QPLLRESET_IN or gt0_qpllreset_t;
577 end generate chipscope;
579 no_chipscope : if EXAMPLE_USE_CHIPSCOPE = 0 generate
580 gt0_cpllreset_i <= gt0_cpllreset_t;
581 gt0_gttxreset_i <= gt0_gttxreset_t;
582 gt0_gtrxreset_i <= gt0_gtrxreset_t;
583 gt0_txuserrdy_i <= gt0_txuserrdy_t;
584 gt0_rxuserrdy_i <= gt0_rxuserrdy_t;
585 gt0_qpllreset_i <= gt0_qpllreset_t;
586 end generate no_chipscope;
592 GT_TYPE =>
"GTX",
--GTX or GTH or GTP
593 STABLE_CLOCK_PERIOD => STABLE_CLOCK_PERIOD,
-- Period of the stable clock driving this state-machine, unit is [ns]
594 RETRY_COUNTER_BITWIDTH =>
8,
595 TX_QPLL_USED => FALSE ,
-- the TX and RX Reset FSMs must
596 RX_QPLL_USED => FALSE,
-- share these two generic values
597 PHASE_ALIGNMENT_MANUAL => FALSE
-- Decision if a manual phase-alignment is necessary or the automatic
598 -- is enough. For single-lane applications the automatic alignment is
602 STABLE_CLOCK => SYSCLK_IN,
603 TXUSERCLK => GT0_TXUSRCLK_IN,
604 SOFT_RESET => SOFT_RESET_IN,
605 QPLLREFCLKLOST => tied_to_ground_i,
606 CPLLREFCLKLOST => gt0_cpllrefclklost_i ,
607 QPLLLOCK => tied_to_vcc_i,
608 CPLLLOCK => gt0_cplllock_i,
609 TXRESETDONE => gt0_txresetdone_i,
610 MMCM_LOCK => tied_to_vcc_i,
611 GTTXRESET => gt0_gttxreset_t,
614 CPLL_RESET => gt0_cpllreset_t,
615 TX_FSM_RESET_DONE => GT0_TX_FSM_RESET_DONE_OUT ,
616 TXUSERRDY => gt0_txuserrdy_t,
617 RUN_PHALIGNMENT =>
open,
618 RESET_PHALIGNMENT =>
open,
619 PHALIGNMENT_DONE => tied_to_vcc_i,
620 RETRY_COUNTER =>
open
631 EXAMPLE_SIMULATION => EXAMPLE_SIMULATION,
632 GT_TYPE =>
"GTX",
--GTX or GTH or GTP
633 EQ_MODE =>
"LPM",
--Rx Equalization Mode - Set to DFE or LPM
634 STABLE_CLOCK_PERIOD => STABLE_CLOCK_PERIOD,
--Period of the stable clock driving this state-machine, unit is [ns]
635 RETRY_COUNTER_BITWIDTH =>
8,
636 TX_QPLL_USED => FALSE ,
-- the TX and RX Reset FSMs must
637 RX_QPLL_USED => FALSE,
-- share these two generic values
638 PHASE_ALIGNMENT_MANUAL => FALSE
-- Decision if a manual phase-alignment is necessary or the automatic
639 -- is enough. For single-lane applications the automatic alignment is
643 STABLE_CLOCK => SYSCLK_IN,
644 RXUSERCLK => GT0_RXUSRCLK_IN,
645 SOFT_RESET => SOFT_RESET_IN,
646 DONT_RESET_ON_DATA_ERROR => DONT_RESET_ON_DATA_ERROR_IN,
647 QPLLREFCLKLOST => tied_to_ground_i,
648 CPLLREFCLKLOST => gt0_cpllrefclklost_i ,
649 QPLLLOCK => tied_to_vcc_i,
650 CPLLLOCK => gt0_cplllock_i,
651 RXRESETDONE => gt0_rxresetdone_i,
652 MMCM_LOCK => tied_to_vcc_i,
653 RECCLK_STABLE => gt0_recclk_stable_i ,
654 RECCLK_MONITOR_RESTART => tied_to_ground_i,
655 DATA_VALID => GT0_DATA_VALID_IN,
656 TXUSERRDY => gt0_txuserrdy_i,
657 GTRXRESET => gt0_gtrxreset_t,
661 RX_FSM_RESET_DONE => GT0_RX_FSM_RESET_DONE_OUT ,
662 RXUSERRDY => gt0_rxuserrdy_t,
663 RUN_PHALIGNMENT =>
open,
664 RESET_PHALIGNMENT =>
open,
665 PHALIGNMENT_DONE => tied_to_vcc_i,
666 RXDFEAGCHOLD => gt0_rxdfeagchold_i ,
667 RXDFELFHOLD => gt0_rxdfelfhold_i,
668 RXLPMLFHOLD => gt0_rxlpmlfhold_i,
669 RXLPMHFHOLD => gt0_rxlpmhfhold_i,
670 RETRY_COUNTER =>
open
675 cdrlock_timeout:
process(SYSCLK_IN)
677 if rising_edge(SYSCLK_IN) then
678 if(gt0_gtrxreset_i = '1') then
680 rx_cdrlock_counter <= 0 after DLY;
681 elsif (rx_cdrlock_counter = WAIT_TIME_CDRLOCK) then
683 rx_cdrlock_counter <= rx_cdrlock_counter after DLY;
685 rx_cdrlock_counter <= rx_cdrlock_counter + 1 after DLY;
690 gt0_recclk_stable_i <= rx_cdrlocked;