1 ------------------------------------------------------------------------------
4 -- /___/ \ / Vendor: Xilinx
5 -- \ \ \/ Version : 2.
7
6 -- \ \ Application : 7 Series FPGAs Transceivers Wizard
7 -- / / Filename : uhtr_trig_init.vhd
12 -- Description : This module instantiates the modules required for
13 -- reset and initialisation of the Transceiver
15 -- Module uHTR_trig_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 --------------------- RX Initialization and Reset Ports --------------------
112 GT0_RXUSERRDY_IN : in ;
113 -------------------------- RX Margin Analysis Ports ------------------------
114 GT0_EYESCANDATAERROR_OUT : out ;
115 ------------------------- Receive Ports - CDR Ports ------------------------
116 GT0_RXCDRLOCK_OUT : out ;
117 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
118 GT0_RXUSRCLK_IN : in ;
119 GT0_RXUSRCLK2_IN : in ;
120 ------------------ Receive Ports - FPGA RX interface Ports -----------------
121 GT0_RXDATA_OUT : out (31 downto 0);
122 ------------------- Receive Ports - Pattern Checker Ports ------------------
123 GT0_RXPRBSERR_OUT : out ;
124 GT0_RXPRBSSEL_IN : in (2 downto 0);
125 ------------------- Receive Ports - Pattern Checker ports ------------------
126 GT0_RXPRBSCNTRESET_IN : in ;
127 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
128 GT0_RXDISPERR_OUT : out (3 downto 0);
129 GT0_RXNOTINTABLE_OUT : out (3 downto 0);
130 --------------------------- Receive Ports - RX AFE -------------------------
132 ------------------------ Receive Ports - RX AFE Ports ----------------------
134 ------------- Receive Ports - RX Initialization and Reset Ports ------------
135 GT0_GTRXRESET_IN : in ;
136 GT0_RXPMARESET_IN : in ;
137 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
138 GT0_RXCHARISK_OUT : out (3 downto 0);
139 -------------- Receive Ports -RX Initialization and Reset Ports ------------
140 GT0_RXRESETDONE_OUT : out ;
141 --------------------- TX Initialization and Reset Ports --------------------
142 GT0_GTTXRESET_IN : in ;
143 GT0_TXUSERRDY_IN : in ;
144 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
145 GT0_TXUSRCLK_IN : in ;
146 GT0_TXUSRCLK2_IN : in ;
147 ------------------ Transmit Ports - TX Data Path interface -----------------
148 GT0_TXDATA_IN : in (31 downto 0);
149 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
150 GT0_GTXTXN_OUT : out ;
151 GT0_GTXTXP_OUT : out ;
152 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
153 GT0_TXOUTCLK_OUT : out ;
154 GT0_TXOUTCLKFABRIC_OUT : out ;
155 GT0_TXOUTCLKPCS_OUT : out ;
156 --------------------- Transmit Ports - TX Gearbox Ports --------------------
157 GT0_TXCHARISK_IN : in (3 downto 0);
158 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
159 GT0_TXRESETDONE_OUT : out ;
160 ------------------ Transmit Ports - pattern Generator Ports ----------------
161 GT0_TXPRBSSEL_IN : in (2 downto 0);
164 --____________________________COMMON PORTS________________________________
165 ---------------------- Common Block - Ref Clock Ports ---------------------
166 GT0_GTREFCLK0_COMMON_IN : in ;
167 ------------------------- Common Block - QPLL Ports ------------------------
168 GT0_QPLLLOCK_OUT : out ;
169 GT0_QPLLLOCKDETCLK_IN : in ;
170 GT0_QPLLRESET_IN : in
179 --**************************Component Declarations*****************************
185 -- Simulation attributes
186 WRAPPER_SIM_GTRESET_SPEEDUP : :=
"FALSE" -- Set to 1 to speed up sim reset
192 --_________________________________________________________________________
193 --_________________________________________________________________________
195 --____________________________CHANNEL PORTS________________________________
196 --------------------------------- CPLL Ports -------------------------------
197 GT0_CPLLFBCLKLOST_OUT :
out ;
198 GT0_CPLLLOCK_OUT :
out ;
199 GT0_CPLLLOCKDETCLK_IN :
in ;
200 GT0_CPLLREFCLKLOST_OUT :
out ;
201 GT0_CPLLRESET_IN :
in ;
202 -------------------------- Channel - Clocking Ports ------------------------
203 GT0_GTREFCLK0_IN :
in ;
204 ---------------------------- Channel - DRP Ports --------------------------
205 GT0_DRPADDR_IN :
in (
8 downto 0);
207 GT0_DRPDI_IN :
in (
15 downto 0);
208 GT0_DRPDO_OUT :
out (
15 downto 0);
210 GT0_DRPRDY_OUT :
out ;
212 --------------------- RX Initialization and Reset Ports --------------------
213 GT0_RXUSERRDY_IN :
in ;
214 -------------------------- RX Margin Analysis Ports ------------------------
215 GT0_EYESCANDATAERROR_OUT :
out ;
216 ------------------------- Receive Ports - CDR Ports ------------------------
217 GT0_RXCDRLOCK_OUT :
out ;
218 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
219 GT0_RXUSRCLK_IN :
in ;
220 GT0_RXUSRCLK2_IN :
in ;
221 ------------------ Receive Ports - FPGA RX interface Ports -----------------
222 GT0_RXDATA_OUT :
out (
31 downto 0);
223 ------------------- Receive Ports - Pattern Checker Ports ------------------
224 GT0_RXPRBSERR_OUT :
out ;
225 GT0_RXPRBSSEL_IN :
in (
2 downto 0);
226 ------------------- Receive Ports - Pattern Checker ports ------------------
227 GT0_RXPRBSCNTRESET_IN :
in ;
228 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
229 GT0_RXDISPERR_OUT :
out (
3 downto 0);
230 GT0_RXNOTINTABLE_OUT :
out (
3 downto 0);
231 --------------------------- Receive Ports - RX AFE -------------------------
233 ------------------------ Receive Ports - RX AFE Ports ----------------------
235 -------------------- Receive Ports - RX Equailizer Ports -------------------
236 GT0_RXLPMHFHOLD_IN :
in ;
237 GT0_RXLPMLFHOLD_IN :
in ;
238 --------------- Receive Ports - RX Fabric Output Control Ports -------------
239 GT0_RXOUTCLK_OUT :
out ;
240 ------------- Receive Ports - RX Initialization and Reset Ports ------------
241 GT0_GTRXRESET_IN :
in ;
242 GT0_RXPMARESET_IN :
in ;
243 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
244 GT0_RXCHARISK_OUT :
out (
3 downto 0);
245 -------------- Receive Ports -RX Initialization and Reset Ports ------------
246 GT0_RXRESETDONE_OUT :
out ;
247 --------------------- TX Initialization and Reset Ports --------------------
248 GT0_GTTXRESET_IN :
in ;
249 GT0_TXUSERRDY_IN :
in ;
250 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
251 GT0_TXUSRCLK_IN :
in ;
252 GT0_TXUSRCLK2_IN :
in ;
253 ------------------ Transmit Ports - TX Data Path interface -----------------
254 GT0_TXDATA_IN :
in (
31 downto 0);
255 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
256 GT0_GTXTXN_OUT :
out ;
257 GT0_GTXTXP_OUT :
out ;
258 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
259 GT0_TXOUTCLK_OUT :
out ;
260 GT0_TXOUTCLKFABRIC_OUT :
out ;
261 GT0_TXOUTCLKPCS_OUT :
out ;
262 --------------------- Transmit Ports - TX Gearbox Ports --------------------
263 GT0_TXCHARISK_IN :
in (
3 downto 0);
264 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
265 GT0_TXRESETDONE_OUT :
out ;
266 ------------------ Transmit Ports - pattern Generator Ports ----------------
267 GT0_TXPRBSSEL_IN :
in (
2 downto 0);
270 --____________________________COMMON PORTS________________________________
271 ---------------------- Common Block - Ref Clock Ports ---------------------
272 GT0_GTREFCLK0_COMMON_IN :
in ;
273 ------------------------- Common Block - QPLL Ports ------------------------
274 GT0_QPLLLOCK_OUT :
out ;
275 GT0_QPLLLOCKDETCLK_IN :
in ;
276 GT0_QPLLREFCLKLOST_OUT :
out ;
277 GT0_QPLLRESET_IN :
in
286 STABLE_CLOCK_PERIOD :
range 4 to 250 :=
8;
--Period of the stable clock driving this state-machine, unit is [ns]
287 RETRY_COUNTER_BITWIDTH :
range 2 to 8 :=
8;
288 TX_QPLL_USED : := False;
-- the TX and RX Reset FSMs must
289 RX_QPLL_USED : := False;
-- share these two generic values
290 PHASE_ALIGNMENT_MANUAL : := True
-- Decision if a manual phase-alignment is necessary or the automatic
291 -- is enough. For single-lane applications the automatic alignment is
294 Port ( STABLE_CLOCK :
in ;
--Stable Clock, either a stable clock from the PCB
295 --or reference-clock present at startup.
296 TXUSERCLK :
in ;
--TXUSERCLK as used in the design
297 SOFT_RESET :
in ;
--User Reset, can be pulled any
298 QPLLREFCLKLOST :
in ;
--QPLL Reference-clock for the GT is lost
299 CPLLREFCLKLOST :
in ;
--CPLL Reference-clock for the GT is lost
300 QPLLLOCK :
in ;
--Lock Detect from the QPLL of the GT
301 CPLLLOCK :
in ;
--Lock Detect from the CPLL of the GT
304 GTTXRESET :
out :='
0';
305 MMCM_RESET :
out :='
0';
306 QPLL_RESET :
out :='
0';
--Reset QPLL
307 CPLL_RESET :
out :='
0';
--Reset CPLL
308 TX_FSM_RESET_DONE :
out :='
0';
--Reset-sequence has sucessfully been finished.
309 TXUSERRDY :
out :='
0';
310 RUN_PHALIGNMENT :
out :='
0';
311 RESET_PHALIGNMENT :
out :='
0';
312 PHALIGNMENT_DONE :
in ;
314 RETRY_COUNTER :
out (RETRY_COUNTER_BITWIDTH
-1 downto 0):=(
others=>'
0')
-- Number of
315 -- Retries it took to get the transceiver up and running
321 EXAMPLE_SIMULATION : :=
0;
324 STABLE_CLOCK_PERIOD :
range 4 to 250 :=
8;
--Period of the stable clock driving this state-machine, unit is [ns]
325 RETRY_COUNTER_BITWIDTH :
range 2 to 8 :=
8;
326 TX_QPLL_USED : := False;
-- the TX and RX Reset FSMs must
327 RX_QPLL_USED : := False;
-- share these two generic values
328 PHASE_ALIGNMENT_MANUAL : := True
-- Decision if a manual phase-alignment is necessary or the automatic
329 -- is enough. For single-lane applications the automatic alignment is
332 Port ( STABLE_CLOCK :
in ;
--Stable Clock, either a stable clock from the PCB
333 --or reference-clock present at startup.
334 RXUSERCLK :
in ;
--RXUSERCLK as used in the design
335 SOFT_RESET :
in ;
--User Reset, can be pulled any
336 QPLLREFCLKLOST :
in ;
--QPLL Reference-clock for the GT is lost
337 CPLLREFCLKLOST :
in ;
--CPLL Reference-clock for the GT is lost
338 QPLLLOCK :
in ;
--Lock Detect from the QPLL of the GT
339 CPLLLOCK :
in ;
--Lock Detect from the CPLL of the GT
343 RECCLK_MONITOR_RESTART :
in ;
345 TXUSERRDY :
in ;
--TXUSERRDY from GT
346 DONT_RESET_ON_DATA_ERROR :
in ;
347 GTRXRESET :
out :='
0';
348 MMCM_RESET :
out :='
0';
349 QPLL_RESET :
out :='
0';
--Reset QPLL (only if RX uses QPLL)
350 CPLL_RESET :
out :='
0';
--Reset CPLL (only if RX uses CPLL)
351 RX_FSM_RESET_DONE :
out :='
0';
--Reset-sequence has sucessfully been finished.
352 RXUSERRDY :
out :='
0';
353 RUN_PHALIGNMENT :
out ;
354 PHALIGNMENT_DONE :
in ;
355 RESET_PHALIGNMENT :
out :='
0';
360 RETRY_COUNTER :
out (RETRY_COUNTER_BITWIDTH
-1 downto 0):=(
others=>'
0')
-- Number of
361 -- Retries it took to get the transceiver up and running
370 function get_cdrlock_time(is_sim :
in )
return is
371 variable lock_time: ;
376 lock_time :=
50000 / (
1.
6); --Typical CDR lock
is 50,000UI as per DS183
382 --***********************************Parameter Declarations********************
384 constant DLY : := 1 ns;
385 constant RX_CDRLOCK_TIME : := get_cdrlock_time(EXAMPLE_SIMULATION);
-- 200us
386 constant WAIT_TIME_CDRLOCK : := RX_CDRLOCK_TIME / STABLE_CLOCK_PERIOD;
-- 200 us time-out
388 -------------------------- GT Wrapper Wires ------------------------------
389 signal gt0_cpllreset_i : ;
390 signal gt0_cpllreset_t : ;
391 signal gt0_cpllrefclklost_i : ;
392 signal gt0_cplllock_i : ;
393 signal gt0_txresetdone_i : ;
394 signal gt0_rxresetdone_i : ;
395 signal gt0_gttxreset_i : ;
396 signal gt0_gttxreset_t : ;
397 signal gt0_gtrxreset_i : ;
398 signal gt0_gtrxreset_t : ;
399 signal gt0_rxdfelpmreset_i : ;
400 signal gt0_txuserrdy_i : ;
401 signal gt0_txuserrdy_t : ;
402 signal gt0_rxuserrdy_i : ;
403 signal gt0_rxuserrdy_t : ;
405 signal gt0_rxdfeagchold_i : ;
406 signal gt0_rxdfelfhold_i : ;
407 signal gt0_rxlpmlfhold_i : ;
408 signal gt0_rxlpmhfhold_i : ;
412 signal gt0_qpllreset_i : ;
413 signal gt0_qpllreset_t : ;
414 signal gt0_qpllrefclklost_i : ;
415 signal gt0_qplllock_i : ;
418 ------------------------------- Global Signals -----------------------------
419 signal tied_to_ground_i : ;
420 signal tied_to_vcc_i : ;
422 signal gt0_rxoutclk_i : ;
423 signal gt0_recclk_stable_i : ;
430 signal rx_cdrlock_counter : range 0 to WAIT_TIME_CDRLOCK:= 0 ;
431 signal rx_cdrlocked : ;
437 --**************************** Main Body of Code *******************************
439 -- Static signal Assigments
440 tied_to_ground_i <= '0';
441 tied_to_vcc_i <= '1';
443 ----------------------------- The GT Wrapper -----------------------------
445 -- Use the instantiation template in the example directory to add the GT wrapper to your design.
446 -- In this example, the wrapper is wired up for basic operation with a frame generator and frame
447 -- checker. The GTs will reset, then attempt to align and transmit data. If channel bonding is
448 -- enabled, bonding should occur after alignment.
454 WRAPPER_SIM_GTRESET_SPEEDUP => EXAMPLE_SIM_GTRESET_SPEEDUP
459 --_____________________________________________________________________
460 --_____________________________________________________________________
463 --------------------------------- CPLL Ports -------------------------------
464 GT0_CPLLFBCLKLOST_OUT => GT0_CPLLFBCLKLOST_OUT ,
465 GT0_CPLLLOCK_OUT => gt0_cplllock_i,
466 GT0_CPLLLOCKDETCLK_IN => GT0_CPLLLOCKDETCLK_IN ,
467 GT0_CPLLREFCLKLOST_OUT => gt0_cpllrefclklost_i ,
468 GT0_CPLLRESET_IN => gt0_cpllreset_i,
469 -------------------------- Channel - Clocking Ports ------------------------
470 GT0_GTREFCLK0_IN => GT0_GTREFCLK0_IN,
471 ---------------------------- Channel - DRP Ports --------------------------
472 GT0_DRPADDR_IN => GT0_DRPADDR_IN,
473 GT0_DRPCLK_IN => GT0_DRPCLK_IN,
474 GT0_DRPDI_IN => GT0_DRPDI_IN,
475 GT0_DRPDO_OUT => GT0_DRPDO_OUT,
476 GT0_DRPEN_IN => GT0_DRPEN_IN,
477 GT0_DRPRDY_OUT => GT0_DRPRDY_OUT,
478 GT0_DRPWE_IN => GT0_DRPWE_IN,
479 --------------------- RX Initialization and Reset Ports --------------------
480 GT0_RXUSERRDY_IN => gt0_rxuserrdy_i,
481 -------------------------- RX Margin Analysis Ports ------------------------
482 GT0_EYESCANDATAERROR_OUT => GT0_EYESCANDATAERROR_OUT,
483 ------------------------- Receive Ports - CDR Ports ------------------------
484 GT0_RXCDRLOCK_OUT => GT0_RXCDRLOCK_OUT,
485 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
486 GT0_RXUSRCLK_IN => GT0_RXUSRCLK_IN,
487 GT0_RXUSRCLK2_IN => GT0_RXUSRCLK2_IN,
488 ------------------ Receive Ports - FPGA RX interface Ports -----------------
489 GT0_RXDATA_OUT => GT0_RXDATA_OUT,
490 ------------------- Receive Ports - Pattern Checker Ports ------------------
491 GT0_RXPRBSERR_OUT => GT0_RXPRBSERR_OUT,
492 GT0_RXPRBSSEL_IN => GT0_RXPRBSSEL_IN,
493 ------------------- Receive Ports - Pattern Checker ports ------------------
494 GT0_RXPRBSCNTRESET_IN => GT0_RXPRBSCNTRESET_IN ,
495 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
496 GT0_RXDISPERR_OUT => GT0_RXDISPERR_OUT,
497 GT0_RXNOTINTABLE_OUT => GT0_RXNOTINTABLE_OUT ,
498 --------------------------- Receive Ports - RX AFE -------------------------
499 GT0_GTXRXP_IN => GT0_GTXRXP_IN,
500 ------------------------ Receive Ports - RX AFE Ports ----------------------
501 GT0_GTXRXN_IN => GT0_GTXRXN_IN,
502 -------------------- Receive Ports - RX Equailizer Ports -------------------
503 GT0_RXLPMHFHOLD_IN => gt0_rxlpmhfhold_i,
504 GT0_RXLPMLFHOLD_IN => gt0_rxlpmlfhold_i,
505 --------------- Receive Ports - RX Fabric Output Control Ports -------------
506 GT0_RXOUTCLK_OUT => gt0_rxoutclk_i,
507 ------------- Receive Ports - RX Initialization and Reset Ports ------------
508 GT0_GTRXRESET_IN => gt0_gtrxreset_i,
509 GT0_RXPMARESET_IN => GT0_RXPMARESET_IN,
510 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
511 GT0_RXCHARISK_OUT => GT0_RXCHARISK_OUT,
512 -------------- Receive Ports -RX Initialization and Reset Ports ------------
513 GT0_RXRESETDONE_OUT => gt0_rxresetdone_i,
514 --------------------- TX Initialization and Reset Ports --------------------
515 GT0_GTTXRESET_IN => gt0_gttxreset_i,
516 GT0_TXUSERRDY_IN => gt0_txuserrdy_i,
517 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
518 GT0_TXUSRCLK_IN => GT0_TXUSRCLK_IN,
519 GT0_TXUSRCLK2_IN => GT0_TXUSRCLK2_IN,
520 ------------------ Transmit Ports - TX Data Path interface -----------------
521 GT0_TXDATA_IN => GT0_TXDATA_IN,
522 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
523 GT0_GTXTXN_OUT => GT0_GTXTXN_OUT,
524 GT0_GTXTXP_OUT => GT0_GTXTXP_OUT,
525 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
526 GT0_TXOUTCLK_OUT => GT0_TXOUTCLK_OUT,
527 GT0_TXOUTCLKFABRIC_OUT => GT0_TXOUTCLKFABRIC_OUT ,
528 GT0_TXOUTCLKPCS_OUT => GT0_TXOUTCLKPCS_OUT ,
529 --------------------- Transmit Ports - TX Gearbox Ports --------------------
530 GT0_TXCHARISK_IN => GT0_TXCHARISK_IN,
531 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
532 GT0_TXRESETDONE_OUT => gt0_txresetdone_i,
533 ------------------ Transmit Ports - pattern Generator Ports ----------------
534 GT0_TXPRBSSEL_IN => GT0_TXPRBSSEL_IN,
539 --____________________________COMMON PORTS________________________________
540 ---------------------- Common Block - Ref Clock Ports ---------------------
541 GT0_GTREFCLK0_COMMON_IN => GT0_GTREFCLK0_COMMON_IN ,
542 ------------------------- Common Block - QPLL Ports ------------------------
543 GT0_QPLLLOCK_OUT => gt0_qplllock_i,
544 GT0_QPLLLOCKDETCLK_IN => GT0_QPLLLOCKDETCLK_IN ,
545 GT0_QPLLREFCLKLOST_OUT => gt0_qpllrefclklost_i ,
546 GT0_QPLLRESET_IN => gt0_qpllreset_i
551 gt0_rxdfelpmreset_i <= tied_to_ground_i;
556 GT0_CPLLLOCK_OUT <= gt0_cplllock_i;
557 GT0_TXRESETDONE_OUT <= gt0_txresetdone_i;
558 GT0_RXRESETDONE_OUT <= gt0_rxresetdone_i;
559 GT0_QPLLLOCK_OUT <= gt0_qplllock_i;
561 chipscope : if EXAMPLE_USE_CHIPSCOPE = 1 generate
562 gt0_cpllreset_i <= GT0_CPLLRESET_IN or gt0_cpllreset_t;
563 gt0_gttxreset_i <= GT0_GTTXRESET_IN or gt0_gttxreset_t;
564 gt0_gtrxreset_i <= GT0_GTRXRESET_IN or gt0_gtrxreset_t;
565 gt0_txuserrdy_i <= GT0_TXUSERRDY_IN or gt0_txuserrdy_t;
566 gt0_rxuserrdy_i <= GT0_RXUSERRDY_IN or gt0_rxuserrdy_t;
567 gt0_qpllreset_i <= GT0_QPLLRESET_IN or gt0_qpllreset_t;
568 end generate chipscope;
570 no_chipscope : if EXAMPLE_USE_CHIPSCOPE = 0 generate
571 gt0_cpllreset_i <= gt0_cpllreset_t;
572 gt0_gttxreset_i <= gt0_gttxreset_t;
573 gt0_gtrxreset_i <= gt0_gtrxreset_t;
574 gt0_txuserrdy_i <= gt0_txuserrdy_t;
575 gt0_rxuserrdy_i <= gt0_rxuserrdy_t;
576 gt0_qpllreset_i <= gt0_qpllreset_t;
577 end generate no_chipscope;
583 GT_TYPE =>
"GTX",
--GTX or GTH or GTP
584 STABLE_CLOCK_PERIOD => STABLE_CLOCK_PERIOD,
-- Period of the stable clock driving this state-machine, unit is [ns]
585 RETRY_COUNTER_BITWIDTH =>
8,
586 TX_QPLL_USED => FALSE ,
-- the TX and RX Reset FSMs must
587 RX_QPLL_USED => FALSE,
-- share these two generic values
588 PHASE_ALIGNMENT_MANUAL => FALSE
-- Decision if a manual phase-alignment is necessary or the automatic
589 -- is enough. For single-lane applications the automatic alignment is
593 STABLE_CLOCK => SYSCLK_IN,
594 TXUSERCLK => GT0_TXUSRCLK_IN,
595 SOFT_RESET => SOFT_RESET_IN,
596 QPLLREFCLKLOST => tied_to_ground_i,
597 CPLLREFCLKLOST => gt0_cpllrefclklost_i ,
598 QPLLLOCK => tied_to_vcc_i,
599 CPLLLOCK => gt0_cplllock_i,
600 TXRESETDONE => gt0_txresetdone_i,
601 MMCM_LOCK => tied_to_vcc_i,
602 GTTXRESET => gt0_gttxreset_t,
605 CPLL_RESET => gt0_cpllreset_t,
606 TX_FSM_RESET_DONE => GT0_TX_FSM_RESET_DONE_OUT ,
607 TXUSERRDY => gt0_txuserrdy_t,
608 RUN_PHALIGNMENT =>
open,
609 RESET_PHALIGNMENT =>
open,
610 PHALIGNMENT_DONE => tied_to_vcc_i,
611 RETRY_COUNTER =>
open
622 EXAMPLE_SIMULATION => EXAMPLE_SIMULATION,
623 GT_TYPE =>
"GTX",
--GTX or GTH or GTP
624 EQ_MODE =>
"LPM",
--Rx Equalization Mode - Set to DFE or LPM
625 STABLE_CLOCK_PERIOD => STABLE_CLOCK_PERIOD,
--Period of the stable clock driving this state-machine, unit is [ns]
626 RETRY_COUNTER_BITWIDTH =>
8,
627 TX_QPLL_USED => FALSE ,
-- the TX and RX Reset FSMs must
628 RX_QPLL_USED => FALSE,
-- share these two generic values
629 PHASE_ALIGNMENT_MANUAL => FALSE
-- Decision if a manual phase-alignment is necessary or the automatic
630 -- is enough. For single-lane applications the automatic alignment is
634 STABLE_CLOCK => SYSCLK_IN,
635 RXUSERCLK => GT0_RXUSRCLK_IN,
636 SOFT_RESET => SOFT_RESET_IN,
637 DONT_RESET_ON_DATA_ERROR => DONT_RESET_ON_DATA_ERROR_IN,
638 QPLLREFCLKLOST => tied_to_ground_i,
639 CPLLREFCLKLOST => gt0_cpllrefclklost_i ,
640 QPLLLOCK => tied_to_vcc_i,
641 CPLLLOCK => gt0_cplllock_i,
642 RXRESETDONE => gt0_rxresetdone_i,
643 MMCM_LOCK => tied_to_vcc_i,
644 RECCLK_STABLE => gt0_recclk_stable_i ,
645 RECCLK_MONITOR_RESTART => tied_to_ground_i,
646 DATA_VALID => GT0_DATA_VALID_IN,
647 TXUSERRDY => gt0_txuserrdy_i,
648 GTRXRESET => gt0_gtrxreset_t,
652 RX_FSM_RESET_DONE => GT0_RX_FSM_RESET_DONE_OUT ,
653 RXUSERRDY => gt0_rxuserrdy_t,
654 RUN_PHALIGNMENT =>
open,
655 RESET_PHALIGNMENT =>
open,
656 PHALIGNMENT_DONE => tied_to_vcc_i,
657 RXDFEAGCHOLD => gt0_rxdfeagchold_i ,
658 RXDFELFHOLD => gt0_rxdfelfhold_i,
659 RXLPMLFHOLD => gt0_rxlpmlfhold_i,
660 RXLPMHFHOLD => gt0_rxlpmhfhold_i,
661 RETRY_COUNTER =>
open
666 cdrlock_timeout:
process(SYSCLK_IN)
668 if rising_edge(SYSCLK_IN) then
669 if(gt0_gtrxreset_i = '1') then
671 rx_cdrlock_counter <= 0 after DLY;
672 elsif (rx_cdrlock_counter = WAIT_TIME_CDRLOCK) then
674 rx_cdrlock_counter <= rx_cdrlock_counter after DLY;
676 rx_cdrlock_counter <= rx_cdrlock_counter + 1 after DLY;
681 gt0_recclk_stable_i <= rx_cdrlocked;