SURF  1.0
Gtx7RxRst.vhd
Go to the documentation of this file.
1 --////////////////////////////////////////////////////////////////////////////////
2 --// ____ ____
3 --// / /\/ /
4 --// /___/ \ / Vendor: Xilinx
5 --// \ \ \/ Version : 2.2
6 --// \ \ Application : 7 Series FPGAs Transceivers Wizard
7 --// / / Filename : Gtx7RxRst.vhd
8 --// /___/ /\
9 --// \ \ / \
10 --// \___\/\___\
11 --//
12 --//
13 -- Description : This module performs RX reset and initialization.
14 --
15 --
16 --
17 -- Module Gtx7RxRst
18 -- Generated by Xilinx 7 Series FPGAs Transceivers Wizard
19 --
20 --
21 -- (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved.
22 --
23 -- This file contains confidential and proprietary information
24 -- of Xilinx, Inc. and is protected under U.S. and
25 -- international copyright and other intellectual property
26 -- laws.
27 --
28 -- DISCLAIMER
29 -- This disclaimer is not a license and does not grant any
30 -- rights to the materials distributed herewith. Except as
31 -- otherwise provided in a valid license issued to you by
32 -- Xilinx, and to the maximum extent permitted by applicable
33 -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
34 -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
35 -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
36 -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
37 -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
38 -- (2) Xilinx shall not be liable (whether in contract or tort,
39 -- including negligence, or under any other theory of
40 -- liability) for any loss or damage of any kind or nature
41 -- related to, arising under or in connection with these
42 -- materials, including for any direct, or any indirect,
43 -- special, incidental, or consequential loss or damage
44 -- (including loss of data, profits, goodwill, or any type of
45 -- loss or damage suffered as a result of any action brought
46 -- by a third party) even if such damage or loss was
47 -- reasonably foreseeable or Xilinx had been advised of the
48 -- possibility of the same.
49 --
50 -- CRITICAL APPLICATIONS
51 -- Xilinx products are not designed or intended to be fail-
52 -- safe, or for use in any application requiring fail-safe
53 -- performance, such as life-support or safety devices or
54 -- systems, Class III medical devices, nuclear facilities,
55 -- applications related to the deployment of airbags, or any
56 -- other applications that could lead to death, personal
57 -- injury, or severe property or environmental damage
58 -- (individually and collectively, "Critical
59 -- Applications"). Customer assumes the sole risk and
60 -- liability of any use of Xilinx products in Critical
61 -- Applications, subject only to applicable laws and
62 -- regulations governing limitations on product liability.
63 --
64 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
65 -- PART OF THIS FILE AT ALL TIMES.
66 
67 
68 --*****************************************************************************
69 
70 library ieee;
71 use ieee.std_logic_1164.all;
72 use ieee.std_logic_arith.all;
73 use ieee.std_logic_unsigned.all;
74 
75 --! @see entity
76  --! @ingroup xilinx_7Series_gtx7
77 entity Gtx7RxRst is
78  generic(
79  TPD_G : time := 1 ns;
80  EXAMPLE_SIMULATION : integer := 0;
81  GT_TYPE : string := "GTX";
82  EQ_MODE : string := "DFE"; --RX Equalisation Mode; set to DFE or LPM
83  STABLE_CLOCK_PERIOD : integer range 4 to 20 := 8; --Period of the stable clock driving this state-machine, unit is [ns]
84  RETRY_COUNTER_BITWIDTH : integer range 2 to 8 := 8
85  );
86  port (
87  STABLE_CLOCK : in std_logic; --Stable Clock, either a stable clock from the PCB
88  --or reference-clock present at startup.
89  RXUSERCLK : in std_logic; --RXUSERCLK as used in the design
90  SOFT_RESET : in std_logic; --User Reset, can be pulled any time
91  PLLREFCLKLOST : in std_logic; --PLL Reference-clock for the GT is lost
92  PLLLOCK : in std_logic; --Lock Detect from the PLL of the GT
93  RXRESETDONE : in std_logic;
94  MMCM_LOCK : in std_logic;
95  RECCLK_STABLE : in std_logic;
96  RECCLK_MONITOR_RESTART : in std_logic := '0';
97  DATA_VALID : in std_logic;
98  TXUSERRDY : in std_logic; --TXUSERRDY from GT
99  GTRXRESET : out std_logic := '0';
100  MMCM_RESET : out std_logic := '1';
101  PLL_RESET : out std_logic := '0'; --Reset PLL
102  RX_FSM_RESET_DONE : out std_logic; --Reset-sequence has sucessfully been finished.
103  RXUSERRDY : out std_logic := '0';
104  RUN_PHALIGNMENT : out std_logic;
105  PHALIGNMENT_DONE : in std_logic; -- Drive high if phase alignment not needed
106  RESET_PHALIGNMENT : out std_logic := '0';
107  RXDFEAGCHOLD : out std_logic;
108  RXDFELFHOLD : out std_logic;
109  RXLPMLFHOLD : out std_logic;
110  RXLPMHFHOLD : out std_logic;
111 
112  RETRY_COUNTER : out std_logic_vector (RETRY_COUNTER_BITWIDTH-1 downto 0) := (others => '0') -- Number of
113  -- Retries it took to get the transceiver up and running
114  );
115 end Gtx7RxRst;
116 
117 --Interdependencies:
118 -- * Timing depends on the frequency of the stable clock. Hence counters-sizes
119 -- are calculated at design-time based on the Generics
120 --
121 -- * if either of the PLLs is reset during TX-startup, it does not need to be reset again by RX
122 -- => signal which PLL has been reset
123 -- *
124 
125 
126 
127 architecture RTL of Gtx7RxRst is
129  INIT, ASSERT_ALL_RESETS, RELEASE_PLL_RESET, VERIFY_RECCLK_STABLE,
130  RELEASE_MMCM_RESET, WAIT_RESET_DONE, DO_PHASE_ALIGNMENT,
131  MONITOR_DATA_VALID, FSM_DONE);
132 
133  signal rx_state : rx_rst_fsm_type := INIT;
134 
135  constant MMCM_LOCK_CNT_MAX : integer := 1024;
136  constant STARTUP_DELAY : integer := 500; --AR43482: Transceiver needs to wait for 500 ns after configuration
137  constant WAIT_CYCLES : integer := STARTUP_DELAY / STABLE_CLOCK_PERIOD; -- Number of Clock-Cycles to wait after configuration
138  constant WAIT_MAX : integer := WAIT_CYCLES + 10; -- 500 ns plus some additional margin
139 
140  constant WAIT_TIMEOUT_2ms : integer := 3000000 / STABLE_CLOCK_PERIOD; -- 2 ms time-out
141  constant WAIT_TLOCK_MAX : integer := 100000 / STABLE_CLOCK_PERIOD; --100 us time-out
142  constant WAIT_TIMEOUT_500us : integer := 500000 / STABLE_CLOCK_PERIOD; --500 us time-out
143  constant WAIT_TIMEOUT_1us : integer := 1000 / STABLE_CLOCK_PERIOD; --1 us time-out
144  constant WAIT_TIMEOUT_100us : integer := 100000 / STABLE_CLOCK_PERIOD; --100 us time-out
145  constant WAIT_TIME_ADAPT : integer := (37000000 /integer(3.125))/STABLE_CLOCK_PERIOD;
146 
147  signal soft_reset_sync : std_logic;
148  signal soft_reset_rise : std_logic;
149  signal soft_reset_fall : std_logic;
150 
151 
152  signal init_wait_count : integer range 0 to WAIT_MAX := 0;
153  signal init_wait_done : std_logic := '0';
154  signal pll_reset_asserted : std_logic := '0';
155  signal rx_fsm_reset_done_int : std_logic := '0';
156  signal rx_fsm_reset_done_int_s3 : std_logic := '0';
157 
158  signal rxresetdone_s3 : std_logic := '0';
159 
160  constant MAX_RETRIES : integer := 2**RETRY_COUNTER_BITWIDTH-1;
161  signal retry_counter_int : integer range 0 to MAX_RETRIES := 0;
162  signal time_out_counter : integer range 0 to WAIT_TIMEOUT_2ms := 0;
163  signal recclk_mon_restart_count : integer range 0 to 3 := 0;
164  signal recclk_mon_count_reset : std_logic := '0';
165 
166  signal reset_time_out : std_logic := '0';
167  signal time_out_2ms : std_logic := '0'; --\Flags that the various time-out points
168  signal time_tlock_max : std_logic := '0'; --|have been reached.
169  signal time_out_500us : std_logic := '0'; --|
170  signal time_out_1us : std_logic := '0'; --/
171  signal time_out_100us : std_logic := '0'; --/
172  signal check_tlock_max : std_logic := '0';
173 
174  signal mmcm_lock_count : integer range 0 to MMCM_LOCK_CNT_MAX-1 := 0;
175  signal mmcm_lock_int : std_logic := '0';
176  signal mmcm_lock_reclocked : std_logic_vector(3 downto 0) := (others => '0');
177 
178  signal run_phase_alignment_int : std_logic := '0';
179  signal run_phase_alignment_int_s3 : std_logic := '0';
180 
181  constant MAX_WAIT_BYPASS : integer := 5000; --5000 RXUSRCLK cycles is the max time for Multi lanes designs
182  signal wait_bypass_count : integer range 0 to MAX_WAIT_BYPASS-1;
183  signal time_out_wait_bypass : std_logic := '0';
184  signal time_out_wait_bypass_s3 : std_logic := '0';
185 
186  signal refclk_lost : std_logic;
187 
188  signal time_out_adapt : std_logic := '0';
189  signal adapt_count_reset : std_logic := '0';
190  signal adapt_count : integer range 0 to WAIT_TIME_ADAPT-1;
191 
192  signal data_valid_sync : std_logic := '0';
193  signal plllock_sync : std_logic := '0';
194  signal phalignment_done_sync : std_logic := '0';
195 
196  signal fsmCnt : std_logic_vector(15 downto 0);
197 
198  attribute dont_touch : string;
199  attribute dont_touch of rx_state,
204  data_valid_sync : signal is "TRUE";
205 
206  attribute KEEP_HIERARCHY : string;
207  attribute KEEP_HIERARCHY of
208  Synchronizer_run_phase_alignment,
209  Synchronizer_fsm_reset_done,
210  Synchronizer_SOFT_RESET,
211  Synchronizer_RXRESETDONE,
212  Synchronizer_time_out_wait_bypass,
213  Synchronizer_mmcm_lock_reclocked,
214  Synchronizer_data_valid,
215  Synchronizer_PLLLOCK,
216  Synchronizer_PHALIGNMENT_DONE : label is "TRUE";
217 
218 begin
219 
220  --Alias section, signals used within this module mapped to output ports:
221  RETRY_COUNTER <= conv_std_logic_vector(retry_counter_int, RETRY_COUNTER_BITWIDTH);
224 
225  process(STABLE_CLOCK)
226  begin
227  if rising_edge(STABLE_CLOCK) then
228  -- The counter starts running when configuration has finished and
229  -- the clock is stable. When its maximum count-value has been reached,
230  -- the 500 ns from Answer Record 43482 have been passed.
231  if init_wait_count = WAIT_MAX then
232  init_wait_done <= '1';
233  else
235  end if;
236  end if;
237  end process;
238 
239 
240  adapt_wait_sim : if(EXAMPLE_SIMULATION = 1) generate
241  time_out_adapt <= '1';
242  end generate;
243 
244  adapt_wait_hw : if(EXAMPLE_SIMULATION = 0) generate
245  process(STABLE_CLOCK)
246  begin
247  if rising_edge(STABLE_CLOCK) then
248  if(adapt_count_reset = '1') then
249  adapt_count <= 0;
250  time_out_adapt <= '0';
251  elsif(adapt_count = WAIT_TIME_ADAPT -1) then
252  time_out_adapt <= '1';
253  else
254  adapt_count <= adapt_count + 1;
255  end if;
256  end if;
257  end process;
258  end generate;
259 
260  retries_recclk_monitor : process(STABLE_CLOCK)
261  begin
262  --This counter monitors, how many retries the RECCLK monitor
263  --runs. If during startup too many retries are necessary, the whole
264  --initialisation-process of the transceivers gets restarted.
265  if rising_edge(STABLE_CLOCK) then
266  if recclk_mon_count_reset = '1' then
268  elsif RECCLK_MONITOR_RESTART = '1' then
269  if recclk_mon_restart_count = 3 then
271  else
273  end if;
274  end if;
275  end if;
276  end process;
277 
278  timeouts : process(STABLE_CLOCK)
279  begin
280  if rising_edge(STABLE_CLOCK) then
281  -- One common large counter for generating three time-out signals.
282  -- Intermediate time-outs are derived from calculated values, based
283  -- on the period of the provided clock.
284  if reset_time_out = '1' then
285  time_out_counter <= 0;
286  time_out_2ms <= '0';
287  time_tlock_max <= '0';
288  time_out_500us <= '0';
289  time_out_1us <= '0';
290  time_out_100us <= '0';
291  else
293  time_out_2ms <= '1';
294  else
296  end if;
297 
298  if (time_out_counter > WAIT_TLOCK_MAX) and (check_tlock_max = '1') then
299  time_tlock_max <= '1';
300  end if;
301 
303  time_out_500us <= '1';
304  end if;
305 
307  time_out_1us <= '1';
308  end if;
309 
311  time_out_100us <= '1';
312  end if;
313 
314  end if;
315  end if;
316  end process;
317 
318 
319  mmcm_lock_wait : process(RXUSERCLK, MMCM_LOCK)
320  begin
321  --The lock-signal from the MMCM is not immediately used but
322  --enabling a counter. Only when the counter hits its maximum,
323  --the MMCM is considered as "really" locked.
324  --The counter avoids that the FSM already starts on only a
325  --coarse lock of the MMCM (=toggling of the LOCK-signal).
326  if MMCM_LOCK = '0' then
327  mmcm_lock_count <= 0;
328  mmcm_lock_int <= '0';
329  elsif rising_edge(RXUSERCLK) then
330  if mmcm_lock_count < MMCM_LOCK_CNT_MAX - 1 then
332  else
333  mmcm_lock_int <= '1';
334  end if;
335  end if;
336  end process;
337 
338 
339  -- Clock Domain Crossing
340  Synchronizer_run_phase_alignment : entity work.Synchronizer
341  generic map (
342  TPD_G => TPD_G,
343  STAGES_G => 3,
344  INIT_G => "000")
345  port map (
346  clk => RXUSERCLK,
349 
350  Synchronizer_fsm_reset_done : entity work.Synchronizer
351  generic map (
352  TPD_G => TPD_G,
353  STAGES_G => 3,
354  INIT_G => "000")
355  port map (
356  clk => RXUSERCLK,
359 
360  Synchronizer_SOFT_RESET : entity work.SynchronizerEdge
361  generic map (
362  TPD_G => TPD_G)
363  port map (
364  clk => STABLE_CLOCK,
365  dataIn => SOFT_RESET,
369 
370  Synchronizer_RXRESETDONE : entity work.Synchronizer
371  generic map (
372  TPD_G => TPD_G,
373  STAGES_G => 3,
374  INIT_G => "000")
375  port map (
376  clk => STABLE_CLOCK,
377  dataIn => RXRESETDONE,
379 
380  Synchronizer_time_out_wait_bypass : entity work.Synchronizer
381  generic map (
382  TPD_G => TPD_G,
383  STAGES_G => 3,
384  INIT_G => "000")
385  port map (
386  clk => STABLE_CLOCK,
389 
390  Synchronizer_mmcm_lock_reclocked : entity work.Synchronizer
391  generic map (
392  TPD_G => TPD_G)
393  port map (
394  clk => STABLE_CLOCK,
397 
398  Synchronizer_data_valid : entity work.Synchronizer
399  generic map (
400  TPD_G => TPD_G)
401  port map (
402  clk => STABLE_CLOCK,
403  dataIn => DATA_VALID,
405 
406 
407  Synchronizer_PLLLOCK : entity work.Synchronizer
408  generic map (
409  TPD_G => TPD_G)
410  port map (
411  clk => STABLE_CLOCK,
412  dataIn => PLLLOCK,
413  dataOut => plllock_sync);
414 
415  -- Phase aligner might run on rxusrclk in some cases
416  -- Synchronizer it just in case
417  Synchronizer_PHALIGNMENT_DONE : entity work.Synchronizer
418  generic map (
419  TPD_G => TPD_G)
420  port map (
421  clk => STABLE_CLOCK,
424 
425 
426  timeout_buffer_bypass : process(RXUSERCLK)
427  begin
428  if rising_edge(RXUSERCLK) then
429  if run_phase_alignment_int_s3 = '0' then
430  wait_bypass_count <= 0;
431  time_out_wait_bypass <= '0';
432  elsif (run_phase_alignment_int_s3 = '1') and (rx_fsm_reset_done_int_s3 = '0') then
433  if wait_bypass_count = MAX_WAIT_BYPASS - 1 then
434  time_out_wait_bypass <= '1';
435  else
437  end if;
438  end if;
439  end if;
440  end process;
441 
442  -- Lock Detect Clock should be driven by STABLE_CLOCK, no need to synchronize
444 
445 
446 
447  --FSM for resetting the GTX/GTH/GTP in the 7-series.
448  --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
449  --
450  -- Following steps are performed:
451  -- 1) After configuration wait for approximately 500 ns as specified in
452  -- answer-record 43482
453  -- 2) Assert all resets on the GT and on an MMCM potentially connected.
454  -- After that wait until a reference-clock has been detected.
455  -- 3) Release the reset to the GT and wait until the GT-PLL has locked.
456  -- 4) Release the MMCM-reset and wait until the MMCM has signalled lock.
457  -- Also get info from the TX-side which PLL has been reset.
458  -- 5) Wait for the RESET_DONE-signal from the GT.
459  -- 6) Signal to start the phase-alignment procedure and wait for it to
460  -- finish.
461  -- 7) Reset-sequence has successfully run through. Signal this to the
462  -- rest of the design by asserting RX_FSM_RESET_DONE.
463 
464  reset_fsm : process(STABLE_CLOCK)
465  begin
466  if rising_edge(STABLE_CLOCK) then
467  if (soft_reset_sync = '1' or
468  (not(rx_state = INIT) and not(rx_state = ASSERT_ALL_RESETS) and refclk_lost = '1')) then
469  rx_state <= INIT;
470  RXUSERRDY <= '0';
471  GTRXRESET <= '0';
472  MMCM_RESET <= '1';
473  rx_fsm_reset_done_int <= '0';
474  PLL_RESET <= '0';
475  pll_reset_asserted <= '0';
476  reset_time_out <= '1';
477  retry_counter_int <= 0;
479  check_tlock_max <= '0';
480  RESET_PHALIGNMENT <= '1';
481  recclk_mon_count_reset <= '1';
482  adapt_count_reset <= '1';
483  RXDFEAGCHOLD <= '0';
484  RXDFELFHOLD <= '0';
485  RXLPMLFHOLD <= '0';
486  RXLPMHFHOLD <= '0';
487  fsmCnt <= (others=>'0');
488 
489  else
490 
491  case rx_state is
492  when INIT =>
493  --Initial state after configuration. This state will be left after
494  --approx. 500 ns and not be re-entered.
495  if init_wait_done = '1' then
496  rx_state <= ASSERT_ALL_RESETS;
497  end if;
498 
499  when ASSERT_ALL_RESETS =>
500  --This is the state into which the FSM will always jump back if any
501  --time-outs will occur.
502  --The number of retries is reported on the output RETRY_COUNTER. In
503  --case the transceiver never comes up for some reason, this machine
504  --will still continue its best and rerun until the FPGA is turned off
505  --or the transceivers come up correctly.
506  if pll_reset_asserted = '0' then
507  PLL_RESET <= '1';
508  pll_reset_asserted <= '1';
509  else
510  PLL_RESET <= '0';
511  end if;
512 
513  RXUSERRDY <= '0';
514  GTRXRESET <= '1';
515  MMCM_RESET <= '1';
517  RESET_PHALIGNMENT <= '1';
518  check_tlock_max <= '0';
519  recclk_mon_count_reset <= '1';
520  adapt_count_reset <= '1';
521 
522 
523  if (PLLREFCLKLOST = '0' and pll_reset_asserted = '1') then
524  rx_state <= RELEASE_PLL_RESET;
525  reset_time_out <= '1';
526  end if;
527 
528  when RELEASE_PLL_RESET =>
529  --PLL-Reset of the GTX gets released and the time-out counter
530  --starts running.
531  pll_reset_asserted <= '0';
532  reset_time_out <= '0';
533 
534 
535  if (plllock_sync = '1') then
536  rx_state <= VERIFY_RECCLK_STABLE;
537  reset_time_out <= '1';
538  recclk_mon_count_reset <= '0';
539  adapt_count_reset <= '0';
540  end if;
541 
542  if time_out_2ms = '1' then
544  -- If too many retries are performed compared to what is specified in
545  -- the generic, the counter simply wraps around.
546  retry_counter_int <= 0;
547  else
549  end if;
550  rx_state <= ASSERT_ALL_RESETS;
551  end if;
552 
553  when VERIFY_RECCLK_STABLE =>
554  --reset_time_out <= '0';
555  --Time-out counter is not released in this state as here the FSM
556  --does not wait for a certain period of time but checks on the number
557  --of retries in the RECCLK monitor
558  GTRXRESET <= '0';
559  if RECCLK_STABLE = '1' then
560  rx_state <= RELEASE_MMCM_RESET;
561  reset_time_out <= '1';
562 
563  end if;
564 
565  if recclk_mon_restart_count = 2 then
566  --If two retries are performed in the RECCLK monitor
567  --the whole initialisation-sequence gets restarted.
569  -- If too many retries are performed compared to what is specified in
570  -- the generic, the counter simply wraps around.
571  retry_counter_int <= 0;
572  else
574  end if;
575  rx_state <= ASSERT_ALL_RESETS;
576  end if;
577 
578  when RELEASE_MMCM_RESET =>
579  --Release of the MMCM-reset. Waiting for the MMCM to lock.
580  reset_time_out <= '0';
581  check_tlock_max <= '1';
582 
583  MMCM_RESET <= '0';
584  if mmcm_lock_reclocked(0) = '1' then
585  rx_state <= WAIT_RESET_DONE;
586  reset_time_out <= '1';
587  end if;
588 
589  if time_tlock_max = '1' and reset_time_out = '0' then
591  -- If too many retries are performed compared to what is specified in
592  -- the generic, the counter simply wraps around.
593  retry_counter_int <= 0;
594  else
596  end if;
597  rx_state <= ASSERT_ALL_RESETS;
598  end if;
599 
600  when WAIT_RESET_DONE =>
601  --When TXOUTCLK is the source for RXUSRCLK, RXUSERRDY depends on TXUSERRDY
602  --If RXOUTCLK is the source for RXUSRCLK, TXUSERRDY can be tied to '1'
603  if TXUSERRDY = '1' then
604  RXUSERRDY <= '1';
605  end if;
606  reset_time_out <= '0';
607  if rxresetdone_s3 = '1' then
608  rx_state <= DO_PHASE_ALIGNMENT;
609  reset_time_out <= '1';
610  end if;
611 
612  if time_out_2ms = '1' and reset_time_out = '0' then
614  -- If too many retries are performed compared to what is specified in
615  -- the generic, the counter simply wraps around.
616  retry_counter_int <= 0;
617  else
619  end if;
620  rx_state <= ASSERT_ALL_RESETS;
621  end if;
622 
623  when DO_PHASE_ALIGNMENT =>
624  --The direct handling of the signals for the Phase Alignment is done outside
625  --this state-machine.
626  RESET_PHALIGNMENT <= '0';
628  reset_time_out <= '0';
629 
630  if phalignment_done_sync = '1' then
631  rx_state <= MONITOR_DATA_VALID;
632  reset_time_out <= '1';
633  end if;
634 
635  if time_out_wait_bypass_s3 = '1' then
637  -- If too many retries are performed compared to what is specified in
638  -- the generic, the counter simply wraps around.
639  retry_counter_int <= 0;
640  else
642  end if;
643  rx_state <= ASSERT_ALL_RESETS;
644  end if;
645 
646  when MONITOR_DATA_VALID =>
647  reset_time_out <= '0';
648 
649  if (time_out_100us = '1' and (data_valid_sync = '0') and reset_time_out = '0') then
650  fsmCnt <= (others=>'0');
651  rx_state <= ASSERT_ALL_RESETS;
652  rx_fsm_reset_done_int <= '0';
653  elsif fsmCnt = x"FFFF" then
654  fsmCnt <= (others=>'0');
655  rx_state <= ASSERT_ALL_RESETS;
656  rx_fsm_reset_done_int <= '0';
657  elsif (data_valid_sync = '1') then
658  fsmCnt <= fsmCnt + 1;
659  rx_state <= FSM_DONE;
660  rx_fsm_reset_done_int <= '0';
661  reset_time_out <= '1';
662  end if;
663 
664  when FSM_DONE =>
665  reset_time_out <= '0';
666  if (data_valid_sync = '0') then
667  rx_fsm_reset_done_int <= '0';
668  reset_time_out <= '1';
669  rx_state <= MONITOR_DATA_VALID;
670  elsif (time_out_1us = '1') then
671  rx_fsm_reset_done_int <= '1';
672  end if;
673 
674  if(time_out_adapt = '1') then
675  if(EQ_MODE = "DFE") then
676  RXDFEAGCHOLD <= '1';
677  RXDFELFHOLD <= '1';
678  else
679  RXDFEAGCHOLD <= '0';
680  RXDFELFHOLD <= '0';
681  RXLPMHFHOLD <= '0';
682  RXLPMLFHOLD <= '0';
683  end if;
684  end if;
685 
686  end case;
687  end if;
688  end if;
689  end process;
690 
691 end RTL;
692 
693 
std_logic := '0' rxresetdone_s3
Definition: Gtx7RxRst.vhd:158
INIT_Gslv := "0"
out RUN_PHALIGNMENTstd_logic
Definition: Gtx7RxRst.vhd:104
std_logic := '0' init_wait_done
Definition: Gtx7RxRst.vhd:153
in RXRESETDONEstd_logic
Definition: Gtx7RxRst.vhd:93
integer := 500 STARTUP_DELAY
Definition: Gtx7RxRst.vhd:136
in RECCLK_STABLEstd_logic
Definition: Gtx7RxRst.vhd:95
std_logic := '0' time_tlock_max
Definition: Gtx7RxRst.vhd:168
std_logic := '0' check_tlock_max
Definition: Gtx7RxRst.vhd:172
rx_rst_fsm_type := INIT rx_state
Definition: Gtx7RxRst.vhd:133
std_logic refclk_lost
Definition: Gtx7RxRst.vhd:186
std_logic := '0' time_out_2ms
Definition: Gtx7RxRst.vhd:167
std_logic_vector( 15 downto 0) fsmCnt
Definition: Gtx7RxRst.vhd:196
out RXDFEAGCHOLDstd_logic
Definition: Gtx7RxRst.vhd:107
std_logic_vector( 3 downto 0) :=( others => '0') mmcm_lock_reclocked
Definition: Gtx7RxRst.vhd:176
in SOFT_RESETstd_logic
Definition: Gtx7RxRst.vhd:90
std_logic := '0' recclk_mon_count_reset
Definition: Gtx7RxRst.vhd:164
in RECCLK_MONITOR_RESTARTstd_logic := '0'
Definition: Gtx7RxRst.vhd:96
std_logic := '0' phalignment_done_sync
Definition: Gtx7RxRst.vhd:194
std_logic soft_reset_rise
Definition: Gtx7RxRst.vhd:148
EQ_MODEstring := "DFE"
Definition: Gtx7RxRst.vhd:82
out MMCM_RESETstd_logic := '1'
Definition: Gtx7RxRst.vhd:100
integer := 3000000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_2ms
Definition: Gtx7RxRst.vhd:140
std_logic soft_reset_sync
Definition: Gtx7RxRst.vhd:147
std_logic soft_reset_fall
Definition: Gtx7RxRst.vhd:149
integer := 1024 MMCM_LOCK_CNT_MAX
Definition: Gtx7RxRst.vhd:135
integer := WAIT_CYCLES+ 10 WAIT_MAX
Definition: Gtx7RxRst.vhd:138
integer range 0 to MAX_WAIT_BYPASS- 1 wait_bypass_count
Definition: Gtx7RxRst.vhd:182
in MMCM_LOCKstd_logic
Definition: Gtx7RxRst.vhd:94
std_logic := '0' time_out_adapt
Definition: Gtx7RxRst.vhd:188
STAGES_Gpositive := 2
std_logic := '0' rx_fsm_reset_done_int
Definition: Gtx7RxRst.vhd:155
(INIT,ASSERT_ALL_RESETS,RELEASE_PLL_RESET,VERIFY_RECCLK_STABLE,RELEASE_MMCM_RESET,WAIT_RESET_DONE,DO_PHASE_ALIGNMENT,MONITOR_DATA_VALID,FSM_DONE) rx_rst_fsm_type
Definition: Gtx7RxRst.vhd:128
in DATA_VALIDstd_logic
Definition: Gtx7RxRst.vhd:97
std_logic := '0' time_out_wait_bypass_s3
Definition: Gtx7RxRst.vhd:184
out dataOutsl
integer := STARTUP_DELAY/ STABLE_CLOCK_PERIOD WAIT_CYCLES
Definition: Gtx7RxRst.vhd:137
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_100us
Definition: Gtx7RxRst.vhd:144
RETRY_COUNTER_BITWIDTHinteger range 2 to 8:= 8
Definition: Gtx7RxRst.vhd:85
GT_TYPEstring := "GTX"
Definition: Gtx7RxRst.vhd:81
out RETRY_COUNTERstd_logic_vector( RETRY_COUNTER_BITWIDTH- 1 downto 0) :=( others => '0')
Definition: Gtx7RxRst.vhd:114
integer range 0 to WAIT_TIMEOUT_2ms:= 0 time_out_counter
Definition: Gtx7RxRst.vhd:162
out RXLPMHFHOLDstd_logic
Definition: Gtx7RxRst.vhd:110
STABLE_CLOCK_PERIODinteger range 4 to 20:= 8
Definition: Gtx7RxRst.vhd:83
std_logic := '0' data_valid_sync
Definition: Gtx7RxRst.vhd:192
std_logic := '0' plllock_sync
Definition: Gtx7RxRst.vhd:193
integer range 0 to MMCM_LOCK_CNT_MAX- 1:= 0 mmcm_lock_count
Definition: Gtx7RxRst.vhd:174
integer range 0 to 3:= 0 recclk_mon_restart_count
Definition: Gtx7RxRst.vhd:163
std_logic := '0' adapt_count_reset
Definition: Gtx7RxRst.vhd:189
EXAMPLE_SIMULATIONinteger := 0
Definition: Gtx7RxRst.vhd:80
std_logic := '0' mmcm_lock_int
Definition: Gtx7RxRst.vhd:175
std_logic := '0' rx_fsm_reset_done_int_s3
Definition: Gtx7RxRst.vhd:156
TPD_Gtime := 1 ns
std_logic := '0' run_phase_alignment_int_s3
Definition: Gtx7RxRst.vhd:179
integer range 0 to WAIT_MAX:= 0 init_wait_count
Definition: Gtx7RxRst.vhd:152
in STABLE_CLOCKstd_logic
Definition: Gtx7RxRst.vhd:87
out RESET_PHALIGNMENTstd_logic := '0'
Definition: Gtx7RxRst.vhd:106
std_logic := '0' run_phase_alignment_int
Definition: Gtx7RxRst.vhd:178
std_logic := '0' time_out_500us
Definition: Gtx7RxRst.vhd:169
std_logic := '0' time_out_wait_bypass
Definition: Gtx7RxRst.vhd:183
std_logic := '0' time_out_1us
Definition: Gtx7RxRst.vhd:170
out RXDFELFHOLDstd_logic
Definition: Gtx7RxRst.vhd:108
string dont_touch
Definition: Gtx7RxRst.vhd:198
integer := 5000 MAX_WAIT_BYPASS
Definition: Gtx7RxRst.vhd:181
in TXUSERRDYstd_logic
Definition: Gtx7RxRst.vhd:98
out RXLPMLFHOLDstd_logic
Definition: Gtx7RxRst.vhd:109
out RX_FSM_RESET_DONEstd_logic
Definition: Gtx7RxRst.vhd:102
in PLLLOCKstd_logic
Definition: Gtx7RxRst.vhd:92
in PHALIGNMENT_DONEstd_logic
Definition: Gtx7RxRst.vhd:105
std_logic := '0' time_out_100us
Definition: Gtx7RxRst.vhd:171
in PLLREFCLKLOSTstd_logic
Definition: Gtx7RxRst.vhd:91
TPD_Gtime := 1 ns
Definition: Gtx7RxRst.vhd:79
in RXUSERCLKstd_logic
Definition: Gtx7RxRst.vhd:89
integer :=( 37000000/ integer( 3.125))/ STABLE_CLOCK_PERIOD WAIT_TIME_ADAPT
Definition: Gtx7RxRst.vhd:145
std_logic := '0' reset_time_out
Definition: Gtx7RxRst.vhd:166
std_logic := '0' pll_reset_asserted
Definition: Gtx7RxRst.vhd:154
integer := 500000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_500us
Definition: Gtx7RxRst.vhd:142
integer range 0 to WAIT_TIME_ADAPT- 1 adapt_count
Definition: Gtx7RxRst.vhd:190
out PLL_RESETstd_logic := '0'
Definition: Gtx7RxRst.vhd:101
out RXUSERRDYstd_logic := '0'
Definition: Gtx7RxRst.vhd:103
integer := 2** RETRY_COUNTER_BITWIDTH- 1 MAX_RETRIES
Definition: Gtx7RxRst.vhd:160
integer := 1000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_1us
Definition: Gtx7RxRst.vhd:143
integer range 0 to MAX_RETRIES:= 0 retry_counter_int
Definition: Gtx7RxRst.vhd:161
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TLOCK_MAX
Definition: Gtx7RxRst.vhd:141
out GTRXRESETstd_logic := '0'
Definition: Gtx7RxRst.vhd:99