1 ------------------------------------------------------------------------------
4 -- /___/ \ / Vendor: Xilinx
5 -- \ \ \/ Version : 2.
7
6 -- \ \ Application : 7 Series FPGAs Transceivers Wizard
7 -- / / Filename : daqlink_7s_init.vhd
12 -- Description : This module instantiates the modules required for
13 -- reset and initialisation of the Transceiver
15 -- Module DAQLINK_7S_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 : := 16;
--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
82 -- REFCLK frequency, select one among 100,
125,
200 and 250 If your REFCLK frequency
is not in the list, please contact wusx@bu.edu
90 DONT_RESET_ON_DATA_ERROR_IN : in ;
91 GT0_TX_FSM_RESET_DONE_OUT : out ;
92 GT0_RX_FSM_RESET_DONE_OUT : out ;
93 GT0_DATA_VALID_IN : in ;
95 --_________________________________________________________________________
97 --____________________________CHANNEL PORTS________________________________
98 --------------------------------- CPLL Ports -------------------------------
99 GT0_CPLLFBCLKLOST_OUT : out ;
100 GT0_CPLLLOCK_OUT : out ;
101 GT0_CPLLLOCKDETCLK_IN : in ;
102 GT0_CPLLRESET_IN : in ;
103 -------------------------- Channel - Clocking Ports ------------------------
104 GT0_GTREFCLK0_IN : in ;
105 ---------------------------- Channel - DRP Ports --------------------------
106 GT0_DRPADDR_IN : in (8 downto 0);
108 GT0_DRPDI_IN : in (15 downto 0);
109 GT0_DRPDO_OUT : out (15 downto 0);
111 GT0_DRPRDY_OUT : out ;
113 ------------------------------- Loopback Ports -----------------------------
114 GT0_LOOPBACK_IN : in (2 downto 0);
115 --------------------- RX Initialization and Reset Ports --------------------
116 GT0_RXUSERRDY_IN : in ;
117 -------------------------- RX Margin Analysis Ports ------------------------
118 GT0_EYESCANDATAERROR_OUT : out ;
119 ------------------------- Receive Ports - CDR Ports ------------------------
120 GT0_RXCDRLOCK_OUT : out ;
121 ------------------- Receive Ports - Clock Correction Ports -----------------
122 GT0_RXCLKCORCNT_OUT : out (1 downto 0);
123 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
124 GT0_RXUSRCLK_IN : in ;
125 GT0_RXUSRCLK2_IN : in ;
126 ------------------ Receive Ports - FPGA RX interface Ports -----------------
127 GT0_RXDATA_OUT : out (15 downto 0);
128 ------------------- Receive Ports - Pattern Checker Ports ------------------
129 GT0_RXPRBSERR_OUT : out ;
130 GT0_RXPRBSSEL_IN : in (2 downto 0);
131 ------------------- Receive Ports - Pattern Checker ports ------------------
132 GT0_RXPRBSCNTRESET_IN : in ;
133 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
134 GT0_RXDISPERR_OUT : out (1 downto 0);
135 GT0_RXNOTINTABLE_OUT : out (1 downto 0);
136 --------------------------- Receive Ports - RX AFE -------------------------
138 ------------------------ Receive Ports - RX AFE Ports ----------------------
140 -------------- Receive Ports - RX Byte and Word Alignment Ports ------------
141 GT0_RXMCOMMAALIGNEN_IN : in ;
142 GT0_RXPCOMMAALIGNEN_IN : in ;
143 ------------- Receive Ports - RX Initialization and Reset Ports ------------
144 GT0_GTRXRESET_IN : in ;
145 GT0_RXPMARESET_IN : in ;
146 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
147 GT0_RXCHARISCOMMA_OUT : out (1 downto 0);
148 GT0_RXCHARISK_OUT : out (1 downto 0);
149 -------------- Receive Ports -RX Initialization and Reset Ports ------------
150 GT0_RXRESETDONE_OUT : out ;
151 --------------------- TX Initialization and Reset Ports --------------------
152 GT0_GTTXRESET_IN : in ;
153 GT0_TXUSERRDY_IN : in ;
154 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
155 GT0_TXUSRCLK_IN : in ;
156 GT0_TXUSRCLK2_IN : in ;
157 --------------- Transmit Ports - TX Configurable Driver Ports --------------
158 GT0_TXDIFFCTRL_IN : in (3 downto 0);
159 ------------------ Transmit Ports - TX Data Path interface -----------------
160 GT0_TXDATA_IN : in (15 downto 0);
161 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
162 GT0_GTXTXN_OUT : out ;
163 GT0_GTXTXP_OUT : out ;
164 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
165 GT0_TXOUTCLK_OUT : out ;
166 GT0_TXOUTCLKFABRIC_OUT : out ;
167 GT0_TXOUTCLKPCS_OUT : out ;
168 --------------------- Transmit Ports - TX Gearbox Ports --------------------
169 GT0_TXCHARISK_IN : in (1 downto 0);
170 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
171 GT0_TXRESETDONE_OUT : out ;
172 ------------------ Transmit Ports - pattern Generator Ports ----------------
173 GT0_TXPRBSSEL_IN : in (2 downto 0);
176 --____________________________COMMON PORTS________________________________
177 ---------------------- Common Block - Ref Clock Ports ---------------------
178 GT0_GTREFCLK0_COMMON_IN : in ;
179 ------------------------- Common Block - QPLL Ports ------------------------
180 GT0_QPLLLOCK_OUT : out ;
181 GT0_QPLLLOCKDETCLK_IN : in ;
182 GT0_QPLLRESET_IN : in
191 --**************************Component Declarations*****************************
197 -- Simulation attributes
198 WRAPPER_SIM_GTRESET_SPEEDUP : :=
"FALSE";
-- Set to 1 to speed up sim reset
199 -- REFCLK frequency, select one among 100,
125,
200 and 250 If your REFCLK frequency
is not in the list, please contact wusx@bu.edu
206 --_________________________________________________________________________
207 --_________________________________________________________________________
209 --____________________________CHANNEL PORTS________________________________
210 --------------------------------- CPLL Ports -------------------------------
211 GT0_CPLLFBCLKLOST_OUT :
out ;
212 GT0_CPLLLOCK_OUT :
out ;
213 GT0_CPLLLOCKDETCLK_IN :
in ;
214 GT0_CPLLREFCLKLOST_OUT :
out ;
215 GT0_CPLLRESET_IN :
in ;
216 -------------------------- Channel - Clocking Ports ------------------------
217 GT0_GTREFCLK0_IN :
in ;
218 ---------------------------- Channel - DRP Ports --------------------------
219 GT0_DRPADDR_IN :
in (
8 downto 0);
221 GT0_DRPDI_IN :
in (
15 downto 0);
222 GT0_DRPDO_OUT :
out (
15 downto 0);
224 GT0_DRPRDY_OUT :
out ;
226 ------------------------------- Loopback Ports -----------------------------
227 GT0_LOOPBACK_IN :
in (
2 downto 0);
228 --------------------- RX Initialization and Reset Ports --------------------
229 GT0_RXUSERRDY_IN :
in ;
230 -------------------------- RX Margin Analysis Ports ------------------------
231 GT0_EYESCANDATAERROR_OUT :
out ;
232 ------------------------- Receive Ports - CDR Ports ------------------------
233 GT0_RXCDRLOCK_OUT :
out ;
234 ------------------- Receive Ports - Clock Correction Ports -----------------
235 GT0_RXCLKCORCNT_OUT :
out (
1 downto 0);
236 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
237 GT0_RXUSRCLK_IN :
in ;
238 GT0_RXUSRCLK2_IN :
in ;
239 ------------------ Receive Ports - FPGA RX interface Ports -----------------
240 GT0_RXDATA_OUT :
out (
15 downto 0);
241 ------------------- Receive Ports - Pattern Checker Ports ------------------
242 GT0_RXPRBSERR_OUT :
out ;
243 GT0_RXPRBSSEL_IN :
in (
2 downto 0);
244 ------------------- Receive Ports - Pattern Checker ports ------------------
245 GT0_RXPRBSCNTRESET_IN :
in ;
246 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
247 GT0_RXDISPERR_OUT :
out (
1 downto 0);
248 GT0_RXNOTINTABLE_OUT :
out (
1 downto 0);
249 --------------------------- Receive Ports - RX AFE -------------------------
251 ------------------------ Receive Ports - RX AFE Ports ----------------------
253 -------------- Receive Ports - RX Byte and Word Alignment Ports ------------
254 GT0_RXMCOMMAALIGNEN_IN :
in ;
255 GT0_RXPCOMMAALIGNEN_IN :
in ;
256 -------------------- Receive Ports - RX Equailizer Ports -------------------
257 GT0_RXLPMHFHOLD_IN :
in ;
258 GT0_RXLPMLFHOLD_IN :
in ;
259 --------------- Receive Ports - RX Fabric Output Control Ports -------------
260 GT0_RXOUTCLK_OUT :
out ;
261 ------------- Receive Ports - RX Initialization and Reset Ports ------------
262 GT0_GTRXRESET_IN :
in ;
263 GT0_RXPMARESET_IN :
in ;
264 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
265 GT0_RXCHARISCOMMA_OUT :
out (
1 downto 0);
266 GT0_RXCHARISK_OUT :
out (
1 downto 0);
267 -------------- Receive Ports -RX Initialization and Reset Ports ------------
268 GT0_RXRESETDONE_OUT :
out ;
269 --------------------- TX Initialization and Reset Ports --------------------
270 GT0_GTTXRESET_IN :
in ;
271 GT0_TXUSERRDY_IN :
in ;
272 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
273 GT0_TXUSRCLK_IN :
in ;
274 GT0_TXUSRCLK2_IN :
in ;
275 --------------- Transmit Ports - TX Configurable Driver Ports --------------
276 GT0_TXDIFFCTRL_IN :
in (
3 downto 0);
277 ------------------ Transmit Ports - TX Data Path interface -----------------
278 GT0_TXDATA_IN :
in (
15 downto 0);
279 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
280 GT0_GTXTXN_OUT :
out ;
281 GT0_GTXTXP_OUT :
out ;
282 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
283 GT0_TXOUTCLK_OUT :
out ;
284 GT0_TXOUTCLKFABRIC_OUT :
out ;
285 GT0_TXOUTCLKPCS_OUT :
out ;
286 --------------------- Transmit Ports - TX Gearbox Ports --------------------
287 GT0_TXCHARISK_IN :
in (
1 downto 0);
288 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
289 GT0_TXRESETDONE_OUT :
out ;
290 ------------------ Transmit Ports - pattern Generator Ports ----------------
291 GT0_TXPRBSSEL_IN :
in (
2 downto 0);
294 --____________________________COMMON PORTS________________________________
295 ---------------------- Common Block - Ref Clock Ports ---------------------
296 GT0_GTREFCLK0_COMMON_IN :
in ;
297 ------------------------- Common Block - QPLL Ports ------------------------
298 GT0_QPLLLOCK_OUT :
out ;
299 GT0_QPLLLOCKDETCLK_IN :
in ;
300 GT0_QPLLREFCLKLOST_OUT :
out ;
301 GT0_QPLLRESET_IN :
in
310 STABLE_CLOCK_PERIOD :
range 4 to 250 :=
8;
--Period of the stable clock driving this state-machine, unit is [ns]
311 RETRY_COUNTER_BITWIDTH :
range 2 to 8 :=
8;
312 TX_QPLL_USED : := False;
-- the TX and RX Reset FSMs must
313 RX_QPLL_USED : := False;
-- share these two generic values
314 PHASE_ALIGNMENT_MANUAL : := True
-- Decision if a manual phase-alignment is necessary or the automatic
315 -- is enough. For single-lane applications the automatic alignment is
318 Port ( STABLE_CLOCK :
in ;
--Stable Clock, either a stable clock from the PCB
319 --or reference-clock present at startup.
320 TXUSERCLK :
in ;
--TXUSERCLK as used in the design
321 SOFT_RESET :
in ;
--User Reset, can be pulled any
322 QPLLREFCLKLOST :
in ;
--QPLL Reference-clock for the GT is lost
323 CPLLREFCLKLOST :
in ;
--CPLL Reference-clock for the GT is lost
324 QPLLLOCK :
in ;
--Lock Detect from the QPLL of the GT
325 CPLLLOCK :
in ;
--Lock Detect from the CPLL of the GT
328 GTTXRESET :
out :='
0';
329 MMCM_RESET :
out :='
0';
330 QPLL_RESET :
out :='
0';
--Reset QPLL
331 CPLL_RESET :
out :='
0';
--Reset CPLL
332 TX_FSM_RESET_DONE :
out :='
0';
--Reset-sequence has sucessfully been finished.
333 TXUSERRDY :
out :='
0';
334 RUN_PHALIGNMENT :
out :='
0';
335 RESET_PHALIGNMENT :
out :='
0';
336 PHALIGNMENT_DONE :
in ;
338 RETRY_COUNTER :
out (RETRY_COUNTER_BITWIDTH
-1 downto 0):=(
others=>'
0')
-- Number of
339 -- Retries it took to get the transceiver up and running
345 EXAMPLE_SIMULATION : :=
0;
348 STABLE_CLOCK_PERIOD :
range 4 to 250 :=
8;
--Period of the stable clock driving this state-machine, unit is [ns]
349 RETRY_COUNTER_BITWIDTH :
range 2 to 8 :=
8;
350 TX_QPLL_USED : := False;
-- the TX and RX Reset FSMs must
351 RX_QPLL_USED : := False;
-- share these two generic values
352 PHASE_ALIGNMENT_MANUAL : := True
-- Decision if a manual phase-alignment is necessary or the automatic
353 -- is enough. For single-lane applications the automatic alignment is
356 Port ( STABLE_CLOCK :
in ;
--Stable Clock, either a stable clock from the PCB
357 --or reference-clock present at startup.
358 RXUSERCLK :
in ;
--RXUSERCLK as used in the design
359 SOFT_RESET :
in ;
--User Reset, can be pulled any
360 QPLLREFCLKLOST :
in ;
--QPLL Reference-clock for the GT is lost
361 CPLLREFCLKLOST :
in ;
--CPLL Reference-clock for the GT is lost
362 QPLLLOCK :
in ;
--Lock Detect from the QPLL of the GT
363 CPLLLOCK :
in ;
--Lock Detect from the CPLL of the GT
367 RECCLK_MONITOR_RESTART :
in ;
369 TXUSERRDY :
in ;
--TXUSERRDY from GT
370 DONT_RESET_ON_DATA_ERROR :
in ;
371 GTRXRESET :
out :='
0';
372 MMCM_RESET :
out :='
0';
373 QPLL_RESET :
out :='
0';
--Reset QPLL (only if RX uses QPLL)
374 CPLL_RESET :
out :='
0';
--Reset CPLL (only if RX uses CPLL)
375 RX_FSM_RESET_DONE :
out :='
0';
--Reset-sequence has sucessfully been finished.
376 RXUSERRDY :
out :='
0';
377 RUN_PHALIGNMENT :
out ;
378 PHALIGNMENT_DONE :
in ;
379 RESET_PHALIGNMENT :
out :='
0';
384 RETRY_COUNTER :
out (RETRY_COUNTER_BITWIDTH
-1 downto 0):=(
others=>'
0')
-- Number of
385 -- Retries it took to get the transceiver up and running
394 function get_cdrlock_time(is_sim :
in )
return is
395 variable lock_time: ;
400 lock_time :=
50000 / (
5); --Typical CDR lock
is 50,000UI as per DS183
406 --***********************************Parameter Declarations********************
408 constant DLY : := 1 ns;
409 constant RX_CDRLOCK_TIME : := get_cdrlock_time(EXAMPLE_SIMULATION);
-- 200us
410 constant WAIT_TIME_CDRLOCK : := RX_CDRLOCK_TIME / STABLE_CLOCK_PERIOD;
-- 200 us time-out
412 -------------------------- GT Wrapper Wires ------------------------------
413 signal gt0_cpllreset_i : ;
414 signal gt0_cpllreset_t : ;
415 signal gt0_cpllrefclklost_i : ;
416 signal gt0_cplllock_i : ;
417 signal gt0_txresetdone_i : ;
418 signal gt0_rxresetdone_i : ;
419 signal gt0_gttxreset_i : ;
420 signal gt0_gttxreset_t : ;
421 signal gt0_gtrxreset_i : ;
422 signal gt0_gtrxreset_t : ;
423 signal gt0_rxdfelpmreset_i : ;
424 signal gt0_txuserrdy_i : ;
425 signal gt0_txuserrdy_t : ;
426 signal gt0_rxuserrdy_i : ;
427 signal gt0_rxuserrdy_t : ;
429 signal gt0_rxdfeagchold_i : ;
430 signal gt0_rxdfelfhold_i : ;
431 signal gt0_rxlpmlfhold_i : ;
432 signal gt0_rxlpmhfhold_i : ;
436 signal gt0_qpllreset_i : ;
437 signal gt0_qpllreset_t : ;
438 signal gt0_qpllrefclklost_i : ;
439 signal gt0_qplllock_i : ;
442 ------------------------------- Global Signals -----------------------------
443 signal tied_to_ground_i : ;
444 signal tied_to_vcc_i : ;
446 signal gt0_rxoutclk_i : ;
447 signal gt0_recclk_stable_i : ;
454 signal rx_cdrlock_counter : range 0 to WAIT_TIME_CDRLOCK:= 0 ;
455 signal rx_cdrlocked : ;
461 --**************************** Main Body of Code *******************************
463 -- Static signal Assigments
464 tied_to_ground_i <= '0';
465 tied_to_vcc_i <= '1';
467 ----------------------------- The GT Wrapper -----------------------------
469 -- Use the instantiation template in the example directory to add the GT wrapper to your design.
470 -- In this example, the wrapper is wired up for basic operation with a frame generator and frame
471 -- checker. The GTs will reset, then attempt to align and transmit data. If channel bonding is
472 -- enabled, bonding should occur after alignment.
478 WRAPPER_SIM_GTRESET_SPEEDUP => EXAMPLE_SIM_GTRESET_SPEEDUP,
484 --_____________________________________________________________________
485 --_____________________________________________________________________
488 --------------------------------- CPLL Ports -------------------------------
489 GT0_CPLLFBCLKLOST_OUT => GT0_CPLLFBCLKLOST_OUT ,
490 GT0_CPLLLOCK_OUT => gt0_cplllock_i,
491 GT0_CPLLLOCKDETCLK_IN => GT0_CPLLLOCKDETCLK_IN ,
492 GT0_CPLLREFCLKLOST_OUT => gt0_cpllrefclklost_i ,
493 GT0_CPLLRESET_IN => gt0_cpllreset_i,
494 -------------------------- Channel - Clocking Ports ------------------------
495 GT0_GTREFCLK0_IN => GT0_GTREFCLK0_IN,
496 ---------------------------- Channel - DRP Ports --------------------------
497 GT0_DRPADDR_IN => GT0_DRPADDR_IN,
498 GT0_DRPCLK_IN => GT0_DRPCLK_IN,
499 GT0_DRPDI_IN => GT0_DRPDI_IN,
500 GT0_DRPDO_OUT => GT0_DRPDO_OUT,
501 GT0_DRPEN_IN => GT0_DRPEN_IN,
502 GT0_DRPRDY_OUT => GT0_DRPRDY_OUT,
503 GT0_DRPWE_IN => GT0_DRPWE_IN,
504 ------------------------------- Loopback Ports -----------------------------
505 GT0_LOOPBACK_IN => GT0_LOOPBACK_IN,
506 --------------------- RX Initialization and Reset Ports --------------------
507 GT0_RXUSERRDY_IN => gt0_rxuserrdy_i,
508 -------------------------- RX Margin Analysis Ports ------------------------
509 GT0_EYESCANDATAERROR_OUT => GT0_EYESCANDATAERROR_OUT,
510 ------------------------- Receive Ports - CDR Ports ------------------------
511 GT0_RXCDRLOCK_OUT => GT0_RXCDRLOCK_OUT,
512 ------------------- Receive Ports - Clock Correction Ports -----------------
513 GT0_RXCLKCORCNT_OUT => GT0_RXCLKCORCNT_OUT ,
514 ------------------ Receive Ports - FPGA RX Interface Ports -----------------
515 GT0_RXUSRCLK_IN => GT0_RXUSRCLK_IN,
516 GT0_RXUSRCLK2_IN => GT0_RXUSRCLK2_IN,
517 ------------------ Receive Ports - FPGA RX interface Ports -----------------
518 GT0_RXDATA_OUT => GT0_RXDATA_OUT,
519 ------------------- Receive Ports - Pattern Checker Ports ------------------
520 GT0_RXPRBSERR_OUT => GT0_RXPRBSERR_OUT,
521 GT0_RXPRBSSEL_IN => GT0_RXPRBSSEL_IN,
522 ------------------- Receive Ports - Pattern Checker ports ------------------
523 GT0_RXPRBSCNTRESET_IN => GT0_RXPRBSCNTRESET_IN ,
524 ------------------ Receive Ports - RX 8B/10B Decoder Ports -----------------
525 GT0_RXDISPERR_OUT => GT0_RXDISPERR_OUT,
526 GT0_RXNOTINTABLE_OUT => GT0_RXNOTINTABLE_OUT ,
527 --------------------------- Receive Ports - RX AFE -------------------------
528 GT0_GTXRXP_IN => GT0_GTXRXP_IN,
529 ------------------------ Receive Ports - RX AFE Ports ----------------------
530 GT0_GTXRXN_IN => GT0_GTXRXN_IN,
531 -------------- Receive Ports - RX Byte and Word Alignment Ports ------------
532 GT0_RXMCOMMAALIGNEN_IN => GT0_RXMCOMMAALIGNEN_IN ,
533 GT0_RXPCOMMAALIGNEN_IN => GT0_RXPCOMMAALIGNEN_IN ,
534 -------------------- Receive Ports - RX Equailizer Ports -------------------
535 GT0_RXLPMHFHOLD_IN => gt0_rxlpmhfhold_i,
536 GT0_RXLPMLFHOLD_IN => gt0_rxlpmlfhold_i,
537 --------------- Receive Ports - RX Fabric Output Control Ports -------------
538 GT0_RXOUTCLK_OUT => gt0_rxoutclk_i,
539 ------------- Receive Ports - RX Initialization and Reset Ports ------------
540 GT0_GTRXRESET_IN => gt0_gtrxreset_i,
541 GT0_RXPMARESET_IN => GT0_RXPMARESET_IN,
542 ------------------- Receive Ports - RX8B/10B Decoder Ports -----------------
543 GT0_RXCHARISCOMMA_OUT => GT0_RXCHARISCOMMA_OUT ,
544 GT0_RXCHARISK_OUT => GT0_RXCHARISK_OUT,
545 -------------- Receive Ports -RX Initialization and Reset Ports ------------
546 GT0_RXRESETDONE_OUT => gt0_rxresetdone_i,
547 --------------------- TX Initialization and Reset Ports --------------------
548 GT0_GTTXRESET_IN => gt0_gttxreset_i,
549 GT0_TXUSERRDY_IN => gt0_txuserrdy_i,
550 ------------------ Transmit Ports - FPGA TX Interface Ports ----------------
551 GT0_TXUSRCLK_IN => GT0_TXUSRCLK_IN,
552 GT0_TXUSRCLK2_IN => GT0_TXUSRCLK2_IN,
553 --------------- Transmit Ports - TX Configurable Driver Ports --------------
554 GT0_TXDIFFCTRL_IN => GT0_TXDIFFCTRL_IN,
555 ------------------ Transmit Ports - TX Data Path interface -----------------
556 GT0_TXDATA_IN => GT0_TXDATA_IN,
557 ---------------- Transmit Ports - TX Driver and OOB signaling --------------
558 GT0_GTXTXN_OUT => GT0_GTXTXN_OUT,
559 GT0_GTXTXP_OUT => GT0_GTXTXP_OUT,
560 ----------- Transmit Ports - TX Fabric Clock Output Control Ports ----------
561 GT0_TXOUTCLK_OUT => GT0_TXOUTCLK_OUT,
562 GT0_TXOUTCLKFABRIC_OUT => GT0_TXOUTCLKFABRIC_OUT ,
563 GT0_TXOUTCLKPCS_OUT => GT0_TXOUTCLKPCS_OUT ,
564 --------------------- Transmit Ports - TX Gearbox Ports --------------------
565 GT0_TXCHARISK_IN => GT0_TXCHARISK_IN,
566 ------------- Transmit Ports - TX Initialization and Reset Ports -----------
567 GT0_TXRESETDONE_OUT => gt0_txresetdone_i,
568 ------------------ Transmit Ports - pattern Generator Ports ----------------
569 GT0_TXPRBSSEL_IN => GT0_TXPRBSSEL_IN,
574 --____________________________COMMON PORTS________________________________
575 ---------------------- Common Block - Ref Clock Ports ---------------------
576 GT0_GTREFCLK0_COMMON_IN => GT0_GTREFCLK0_COMMON_IN ,
577 ------------------------- Common Block - QPLL Ports ------------------------
578 GT0_QPLLLOCK_OUT => gt0_qplllock_i,
579 GT0_QPLLLOCKDETCLK_IN => GT0_QPLLLOCKDETCLK_IN ,
580 GT0_QPLLREFCLKLOST_OUT => gt0_qpllrefclklost_i ,
581 GT0_QPLLRESET_IN => gt0_qpllreset_i
586 gt0_rxdfelpmreset_i <= tied_to_ground_i;
591 GT0_CPLLLOCK_OUT <= gt0_cplllock_i;
592 GT0_TXRESETDONE_OUT <= gt0_txresetdone_i;
593 GT0_RXRESETDONE_OUT <= gt0_rxresetdone_i;
594 GT0_QPLLLOCK_OUT <= gt0_qplllock_i;
596 chipscope : if EXAMPLE_USE_CHIPSCOPE = 1 generate
597 gt0_cpllreset_i <= GT0_CPLLRESET_IN or gt0_cpllreset_t;
598 gt0_gttxreset_i <= GT0_GTTXRESET_IN or gt0_gttxreset_t;
599 gt0_gtrxreset_i <= GT0_GTRXRESET_IN or gt0_gtrxreset_t;
600 gt0_txuserrdy_i <= GT0_TXUSERRDY_IN or gt0_txuserrdy_t;
601 gt0_rxuserrdy_i <= GT0_RXUSERRDY_IN or gt0_rxuserrdy_t;
602 gt0_qpllreset_i <= GT0_QPLLRESET_IN or gt0_qpllreset_t;
603 end generate chipscope;
605 no_chipscope : if EXAMPLE_USE_CHIPSCOPE = 0 generate
606 gt0_cpllreset_i <= gt0_cpllreset_t;
607 gt0_gttxreset_i <= gt0_gttxreset_t;
608 gt0_gtrxreset_i <= gt0_gtrxreset_t;
609 gt0_txuserrdy_i <= gt0_txuserrdy_t;
610 gt0_rxuserrdy_i <= gt0_rxuserrdy_t;
611 gt0_qpllreset_i <= gt0_qpllreset_t;
612 end generate no_chipscope;
618 GT_TYPE =>
"GTX",
--GTX or GTH or GTP
619 STABLE_CLOCK_PERIOD => STABLE_CLOCK_PERIOD,
-- Period of the stable clock driving this state-machine, unit is [ns]
620 RETRY_COUNTER_BITWIDTH =>
8,
621 TX_QPLL_USED => FALSE ,
-- the TX and RX Reset FSMs must
622 RX_QPLL_USED => FALSE,
-- share these two generic values
623 PHASE_ALIGNMENT_MANUAL => FALSE
-- Decision if a manual phase-alignment is necessary or the automatic
624 -- is enough. For single-lane applications the automatic alignment is
628 STABLE_CLOCK => SYSCLK_IN,
629 TXUSERCLK => GT0_TXUSRCLK_IN,
630 SOFT_RESET => SOFT_RESET_IN,
631 QPLLREFCLKLOST => tied_to_ground_i,
632 CPLLREFCLKLOST => gt0_cpllrefclklost_i ,
633 QPLLLOCK => tied_to_vcc_i,
634 CPLLLOCK => gt0_cplllock_i,
635 TXRESETDONE => gt0_txresetdone_i,
636 MMCM_LOCK => tied_to_vcc_i,
637 GTTXRESET => gt0_gttxreset_t,
640 CPLL_RESET => gt0_cpllreset_t,
641 TX_FSM_RESET_DONE => GT0_TX_FSM_RESET_DONE_OUT ,
642 TXUSERRDY => gt0_txuserrdy_t,
643 RUN_PHALIGNMENT =>
open,
644 RESET_PHALIGNMENT =>
open,
645 PHALIGNMENT_DONE => tied_to_vcc_i,
646 RETRY_COUNTER =>
open
657 EXAMPLE_SIMULATION => EXAMPLE_SIMULATION,
658 GT_TYPE =>
"GTX",
--GTX or GTH or GTP
659 EQ_MODE =>
"LPM",
--Rx Equalization Mode - Set to DFE or LPM
660 STABLE_CLOCK_PERIOD => STABLE_CLOCK_PERIOD,
--Period of the stable clock driving this state-machine, unit is [ns]
661 RETRY_COUNTER_BITWIDTH =>
8,
662 TX_QPLL_USED => FALSE ,
-- the TX and RX Reset FSMs must
663 RX_QPLL_USED => FALSE,
-- share these two generic values
664 PHASE_ALIGNMENT_MANUAL => FALSE
-- Decision if a manual phase-alignment is necessary or the automatic
665 -- is enough. For single-lane applications the automatic alignment is
669 STABLE_CLOCK => SYSCLK_IN,
670 RXUSERCLK => GT0_RXUSRCLK_IN,
671 SOFT_RESET => SOFT_RESET_IN,
672 DONT_RESET_ON_DATA_ERROR => DONT_RESET_ON_DATA_ERROR_IN,
673 QPLLREFCLKLOST => tied_to_ground_i,
674 CPLLREFCLKLOST => gt0_cpllrefclklost_i ,
675 QPLLLOCK => tied_to_vcc_i,
676 CPLLLOCK => gt0_cplllock_i,
677 RXRESETDONE => gt0_rxresetdone_i,
678 MMCM_LOCK => tied_to_vcc_i,
679 RECCLK_STABLE => gt0_recclk_stable_i ,
680 RECCLK_MONITOR_RESTART => tied_to_ground_i,
681 DATA_VALID => GT0_DATA_VALID_IN,
682 TXUSERRDY => gt0_txuserrdy_i,
683 GTRXRESET => gt0_gtrxreset_t,
687 RX_FSM_RESET_DONE => GT0_RX_FSM_RESET_DONE_OUT ,
688 RXUSERRDY => gt0_rxuserrdy_t,
689 RUN_PHALIGNMENT =>
open,
690 RESET_PHALIGNMENT =>
open,
691 PHALIGNMENT_DONE => tied_to_vcc_i,
692 RXDFEAGCHOLD => gt0_rxdfeagchold_i ,
693 RXDFELFHOLD => gt0_rxdfelfhold_i,
694 RXLPMLFHOLD => gt0_rxlpmlfhold_i,
695 RXLPMHFHOLD => gt0_rxlpmhfhold_i,
696 RETRY_COUNTER =>
open
701 cdrlock_timeout:
process(SYSCLK_IN)
703 if rising_edge(SYSCLK_IN) then
704 if(gt0_gtrxreset_i = '1') then
706 rx_cdrlock_counter <= 0 after DLY;
707 elsif (rx_cdrlock_counter = WAIT_TIME_CDRLOCK) then
709 rx_cdrlock_counter <= rx_cdrlock_counter after DLY;
711 rx_cdrlock_counter <= rx_cdrlock_counter + 1 after DLY;
716 gt0_recclk_stable_i <= rx_cdrlocked;