SURF  1.0
Gth7RxRst.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 : Gth7RxRst.vhd
8 --// /___/ /\
9 --// \ \ / \
10 --// \___\/\___\
11 --//
12 --//
13 -- Description : This module performs RX reset and initialization.
14 --
15 --
16 --
17 -- Module Gth7RxRst
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.numeric_std.all;
73 use ieee.std_logic_unsigned.all;
74 use ieee.std_logic_arith.all;
75 
76 --! @see entity
77  --! @ingroup xilinx_7Series_gth7
78 entity Gth7RxRst is
79  generic(
80  TPD_G : time := 1 ns;
81  EXAMPLE_SIMULATION : integer := 0;
82  GT_TYPE : string := "GTX";
83  EQ_MODE : string := "DFE"; --RX Equalisation Mode; set to DFE or LPM
84  STABLE_CLOCK_PERIOD : integer range 4 to 20 := 8; --Period of the stable clock driving this state-machine, unit is [ns]
85  RETRY_COUNTER_BITWIDTH : integer range 2 to 8 := 8
86  );
87  port (
88  STABLE_CLOCK : in std_logic; --Stable Clock, either a stable clock from the PCB
89  --or reference-clock present at startup.
90  RXUSERCLK : in std_logic; --RXUSERCLK as used in the design
91  SOFT_RESET : in std_logic; --User Reset, can be pulled any time
92  PLLREFCLKLOST : in std_logic; --PLL Reference-clock for the GT is lost
93  PLLLOCK : in std_logic; --Lock Detect from the PLL of the GT
94  RXRESETDONE : in std_logic;
95  MMCM_LOCK : in std_logic;
96  RECCLK_STABLE : in std_logic;
97  RECCLK_MONITOR_RESTART : in std_logic := '0';
98  DATA_VALID : in std_logic;
99  TXUSERRDY : in std_logic; --TXUSERRDY from GT
100  GTRXRESET : out std_logic := '0';
101  MMCM_RESET : out std_logic := '1';
102  PLL_RESET : out std_logic := '0'; --Reset PLL
103  RX_FSM_RESET_DONE : out std_logic; --Reset-sequence has sucessfully been finished.
104  RXUSERRDY : out std_logic := '0';
105  RUN_PHALIGNMENT : out std_logic;
106  PHALIGNMENT_DONE : in std_logic; -- Drive high if phase alignment not needed
107  RESET_PHALIGNMENT : out std_logic := '0';
108  RXDFEAGCHOLD : out std_logic;
109  RXDFELFHOLD : out std_logic;
110  RXLPMLFHOLD : out std_logic;
111  RXLPMHFHOLD : out std_logic;
112 
113  RETRY_COUNTER : out std_logic_vector (RETRY_COUNTER_BITWIDTH-1 downto 0) := (others => '0') -- Number of
114  -- Retries it took to get the transceiver up and running
115  );
116 end Gth7RxRst;
117 
118 --Interdependencies:
119 -- * Timing depends on the frequency of the stable clock. Hence counters-sizes
120 -- are calculated at design-time based on the Generics
121 --
122 -- * if either of the PLLs is reset during TX-startup, it does not need to be reset again by RX
123 -- => signal which PLL has been reset
124 -- *
125 
126 
127 
128 architecture RTL of Gth7RxRst is
130  INIT, ASSERT_ALL_RESETS, RELEASE_PLL_RESET, VERIFY_RECCLK_STABLE,
131  RELEASE_MMCM_RESET, WAIT_RESET_DONE, DO_PHASE_ALIGNMENT,
132  MONITOR_DATA_VALID, FSM_DONE);
133 
134  signal rx_state : rx_rst_fsm_type := INIT;
135 
136  constant MMCM_LOCK_CNT_MAX : integer := 1024;
137  constant STARTUP_DELAY : integer := 500; --AR43482: Transceiver needs to wait for 500 ns after configuration
138  constant WAIT_CYCLES : integer := STARTUP_DELAY / STABLE_CLOCK_PERIOD; -- Number of Clock-Cycles to wait after configuration
139  constant WAIT_MAX : integer := WAIT_CYCLES + 10; -- 500 ns plus some additional margin
140 
141  constant WAIT_TIMEOUT_2ms : integer := 3000000 / STABLE_CLOCK_PERIOD; -- 2 ms time-out
142  constant WAIT_TLOCK_MAX : integer := 100000 / STABLE_CLOCK_PERIOD; --100 us time-out
143  constant WAIT_TIMEOUT_500us : integer := 500000 / STABLE_CLOCK_PERIOD; --500 us time-out
144  constant WAIT_TIMEOUT_1us : integer := 1000 / STABLE_CLOCK_PERIOD; --1 us time-out
145  constant WAIT_TIMEOUT_100us : integer := 100000 / STABLE_CLOCK_PERIOD; --100 us time-out
146  constant WAIT_TIME_ADAPT : integer := (37000000 /integer(3.125))/STABLE_CLOCK_PERIOD;
147 
148  signal soft_reset_sync : std_logic;
149  signal soft_reset_rise : std_logic;
150  signal soft_reset_fall : std_logic;
151 
152 
153  signal init_wait_count : integer range 0 to WAIT_MAX := 0;
154  signal init_wait_done : std_logic := '0';
155  signal pll_reset_asserted : std_logic := '0';
156  signal rx_fsm_reset_done_int : std_logic := '0';
157  signal rx_fsm_reset_done_int_s3 : std_logic := '0';
158 
159  signal rxresetdone_s3 : std_logic := '0';
160 
161  constant MAX_RETRIES : integer := 2**RETRY_COUNTER_BITWIDTH-1;
162  signal retry_counter_int : integer range 0 to MAX_RETRIES := 0;
163  signal time_out_counter : integer range 0 to WAIT_TIMEOUT_2ms := 0;
164  signal recclk_mon_restart_count : integer range 0 to 3 := 0;
165  signal recclk_mon_count_reset : std_logic := '0';
166 
167  signal reset_time_out : std_logic := '0';
168  signal time_out_2ms : std_logic := '0'; --\Flags that the various time-out points
169  signal time_tlock_max : std_logic := '0'; --|have been reached.
170  signal time_out_500us : std_logic := '0'; --|
171  signal time_out_1us : std_logic := '0'; --/
172  signal time_out_100us : std_logic := '0'; --/
173  signal check_tlock_max : std_logic := '0';
174 
175  signal mmcm_lock_count : integer range 0 to MMCM_LOCK_CNT_MAX-1 := 0;
176  signal mmcm_lock_int : std_logic := '0';
177  signal mmcm_lock_reclocked : std_logic_vector(3 downto 0) := (others => '0');
178 
179  signal run_phase_alignment_int : std_logic := '0';
180  signal run_phase_alignment_int_s3 : std_logic := '0';
181 
182  constant MAX_WAIT_BYPASS : integer := 5000; --5000 RXUSRCLK cycles is the max time for Multi lanes designs
183  signal wait_bypass_count : integer range 0 to MAX_WAIT_BYPASS-1;
184  signal time_out_wait_bypass : std_logic := '0';
185  signal time_out_wait_bypass_s3 : std_logic := '0';
186 
187  signal refclk_lost : std_logic;
188 
189  signal time_out_adapt : std_logic := '0';
190  signal adapt_count_reset : std_logic := '0';
191  signal adapt_count : integer range 0 to WAIT_TIME_ADAPT-1;
192 
193  signal data_valid_sync : std_logic := '0';
194  signal plllock_sync : std_logic := '0';
195  signal phalignment_done_sync : std_logic := '0';
196 
197  signal fsmCnt : std_logic_vector(15 downto 0);
198 
199  attribute dont_touch : string;
200  attribute dont_touch of rx_state,
205  data_valid_sync : signal is "TRUE";
206 
207  attribute KEEP_HIERARCHY : string;
208  attribute KEEP_HIERARCHY of
209  Synchronizer_run_phase_alignment,
210  Synchronizer_fsm_reset_done,
211  Synchronizer_SOFT_RESET,
212  Synchronizer_RXRESETDONE,
213  Synchronizer_time_out_wait_bypass,
214  Synchronizer_mmcm_lock_reclocked,
215  Synchronizer_data_valid,
216  Synchronizer_PLLLOCK,
217  Synchronizer_PHALIGNMENT_DONE : label is "TRUE";
218 
219 begin
220 
221  --Alias section, signals used within this module mapped to output ports:
222  RETRY_COUNTER <= std_logic_vector(TO_UNSIGNED(retry_counter_int, RETRY_COUNTER_BITWIDTH));
225 
226  process(STABLE_CLOCK)
227  begin
228  if rising_edge(STABLE_CLOCK) then
229  -- The counter starts running when configuration has finished and
230  -- the clock is stable. When its maximum count-value has been reached,
231  -- the 500 ns from Answer Record 43482 have been passed.
232  if init_wait_count = WAIT_MAX then
233  init_wait_done <= '1';
234  else
236  end if;
237  end if;
238  end process;
239 
240 
241  adapt_wait_sim : if(EXAMPLE_SIMULATION = 1) generate
242  time_out_adapt <= '1';
243  end generate;
244 
245  adapt_wait_hw : if(EXAMPLE_SIMULATION = 0) generate
246  process(STABLE_CLOCK)
247  begin
248  if rising_edge(STABLE_CLOCK) then
249  if(adapt_count_reset = '1') then
250  adapt_count <= 0;
251  time_out_adapt <= '0';
252  elsif(adapt_count = WAIT_TIME_ADAPT -1) then
253  time_out_adapt <= '1';
254  else
255  adapt_count <= adapt_count + 1;
256  end if;
257  end if;
258  end process;
259  end generate;
260 
261  retries_recclk_monitor : process(STABLE_CLOCK)
262  begin
263  --This counter monitors, how many retries the RECCLK monitor
264  --runs. If during startup too many retries are necessary, the whole
265  --initialisation-process of the transceivers gets restarted.
266  if rising_edge(STABLE_CLOCK) then
267  if recclk_mon_count_reset = '1' then
269  elsif RECCLK_MONITOR_RESTART = '1' then
270  if recclk_mon_restart_count = 3 then
272  else
274  end if;
275  end if;
276  end if;
277  end process;
278 
279  timeouts : process(STABLE_CLOCK)
280  begin
281  if rising_edge(STABLE_CLOCK) then
282  -- One common large counter for generating three time-out signals.
283  -- Intermediate time-outs are derived from calculated values, based
284  -- on the period of the provided clock.
285  if reset_time_out = '1' then
286  time_out_counter <= 0;
287  time_out_2ms <= '0';
288  time_tlock_max <= '0';
289  time_out_500us <= '0';
290  time_out_1us <= '0';
291  time_out_100us <= '0';
292  else
294  time_out_2ms <= '1';
295  else
297  end if;
298 
299  if (time_out_counter > WAIT_TLOCK_MAX) and (check_tlock_max = '1') then
300  time_tlock_max <= '1';
301  end if;
302 
304  time_out_500us <= '1';
305  end if;
306 
308  time_out_1us <= '1';
309  end if;
310 
312  time_out_100us <= '1';
313  end if;
314 
315  end if;
316  end if;
317  end process;
318 
319 
320  mmcm_lock_wait : process(RXUSERCLK, MMCM_LOCK)
321  begin
322  --The lock-signal from the MMCM is not immediately used but
323  --enabling a counter. Only when the counter hits its maximum,
324  --the MMCM is considered as "really" locked.
325  --The counter avoids that the FSM already starts on only a
326  --coarse lock of the MMCM (=toggling of the LOCK-signal).
327  if MMCM_LOCK = '0' then
328  mmcm_lock_count <= 0;
329  mmcm_lock_int <= '0';
330  elsif rising_edge(RXUSERCLK) then
331  if mmcm_lock_count < MMCM_LOCK_CNT_MAX - 1 then
333  else
334  mmcm_lock_int <= '1';
335  end if;
336  end if;
337  end process;
338 
339 
340  -- Clock Domain Crossing
341  Synchronizer_run_phase_alignment : entity work.Synchronizer
342  generic map (
343  TPD_G => TPD_G,
344  STAGES_G => 3,
345  INIT_G => "000")
346  port map (
347  clk => RXUSERCLK,
350 
351  Synchronizer_fsm_reset_done : entity work.Synchronizer
352  generic map (
353  TPD_G => TPD_G,
354  STAGES_G => 3,
355  INIT_G => "000")
356  port map (
357  clk => RXUSERCLK,
360 
361  Synchronizer_SOFT_RESET : entity work.SynchronizerEdge
362  generic map (
363  TPD_G => TPD_G)
364  port map (
365  clk => STABLE_CLOCK,
366  dataIn => SOFT_RESET,
370 
371  Synchronizer_RXRESETDONE : entity work.Synchronizer
372  generic map (
373  TPD_G => TPD_G,
374  STAGES_G => 3,
375  INIT_G => "000")
376  port map (
377  clk => STABLE_CLOCK,
378  dataIn => RXRESETDONE,
380 
381  Synchronizer_time_out_wait_bypass : entity work.Synchronizer
382  generic map (
383  TPD_G => TPD_G,
384  STAGES_G => 3,
385  INIT_G => "000")
386  port map (
387  clk => STABLE_CLOCK,
390 
391  Synchronizer_mmcm_lock_reclocked : entity work.Synchronizer
392  generic map (
393  TPD_G => TPD_G)
394  port map (
395  clk => STABLE_CLOCK,
398 
399  Synchronizer_data_valid : entity work.Synchronizer
400  generic map (
401  TPD_G => TPD_G)
402  port map (
403  clk => STABLE_CLOCK,
404  dataIn => DATA_VALID,
406 
407 
408  Synchronizer_PLLLOCK : entity work.Synchronizer
409  generic map (
410  TPD_G => TPD_G)
411  port map (
412  clk => STABLE_CLOCK,
413  dataIn => PLLLOCK,
414  dataOut => plllock_sync);
415 
416  -- Phase aligner might run on rxusrclk in some cases
417  -- Synchronizer it just in case
418  Synchronizer_PHALIGNMENT_DONE : entity work.Synchronizer
419  generic map (
420  TPD_G => TPD_G)
421  port map (
422  clk => STABLE_CLOCK,
425 
426 
427  timeout_buffer_bypass : process(RXUSERCLK)
428  begin
429  if rising_edge(RXUSERCLK) then
430  if run_phase_alignment_int_s3 = '0' then
431  wait_bypass_count <= 0;
432  time_out_wait_bypass <= '0';
433  elsif (run_phase_alignment_int_s3 = '1') and (rx_fsm_reset_done_int_s3 = '0') then
434  if wait_bypass_count = MAX_WAIT_BYPASS - 1 then
435  time_out_wait_bypass <= '1';
436  else
438  end if;
439  end if;
440  end if;
441  end process;
442 
443  -- Lock Detect Clock should be driven by STABLE_CLOCK, no need to synchronize
445 
446 
447 
448  --FSM for resetting the GTX/GTH/GTP in the 7-series.
449  --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
450  --
451  -- Following steps are performed:
452  -- 1) After configuration wait for approximately 500 ns as specified in
453  -- answer-record 43482
454  -- 2) Assert all resets on the GT and on an MMCM potentially connected.
455  -- After that wait until a reference-clock has been detected.
456  -- 3) Release the reset to the GT and wait until the GT-PLL has locked.
457  -- 4) Release the MMCM-reset and wait until the MMCM has signalled lock.
458  -- Also get info from the TX-side which PLL has been reset.
459  -- 5) Wait for the RESET_DONE-signal from the GT.
460  -- 6) Signal to start the phase-alignment procedure and wait for it to
461  -- finish.
462  -- 7) Reset-sequence has successfully run through. Signal this to the
463  -- rest of the design by asserting RX_FSM_RESET_DONE.
464 
465  reset_fsm : process(STABLE_CLOCK)
466  begin
467  if rising_edge(STABLE_CLOCK) then
468  if (soft_reset_sync = '1' or
469  (not(rx_state = INIT) and not(rx_state = ASSERT_ALL_RESETS) and refclk_lost = '1')) then
470  rx_state <= INIT;
471  RXUSERRDY <= '0';
472  GTRXRESET <= '0';
473  MMCM_RESET <= '1';
474  rx_fsm_reset_done_int <= '0';
475  PLL_RESET <= '0';
476  pll_reset_asserted <= '0';
477  reset_time_out <= '1';
478  retry_counter_int <= 0;
480  check_tlock_max <= '0';
481  RESET_PHALIGNMENT <= '1';
482  recclk_mon_count_reset <= '1';
483  adapt_count_reset <= '1';
484  RXDFEAGCHOLD <= '0';
485  RXDFELFHOLD <= '0';
486  RXLPMLFHOLD <= '0';
487  RXLPMHFHOLD <= '0';
488  fsmCnt <= (others=>'0');
489 
490  else
491 
492  case rx_state is
493  when INIT =>
494  --Initial state after configuration. This state will be left after
495  --approx. 500 ns and not be re-entered.
496  if init_wait_done = '1' then
497  rx_state <= ASSERT_ALL_RESETS;
498  end if;
499 
500  when ASSERT_ALL_RESETS =>
501  --This is the state into which the FSM will always jump back if any
502  --time-outs will occur.
503  --The number of retries is reported on the output RETRY_COUNTER. In
504  --case the transceiver never comes up for some reason, this machine
505  --will still continue its best and rerun until the FPGA is turned off
506  --or the transceivers come up correctly.
507  if pll_reset_asserted = '0' then
508  PLL_RESET <= '1';
509  pll_reset_asserted <= '1';
510  else
511  PLL_RESET <= '0';
512  end if;
513 
514  RXUSERRDY <= '0';
515  GTRXRESET <= '1';
516  MMCM_RESET <= '1';
518  RESET_PHALIGNMENT <= '1';
519  check_tlock_max <= '0';
520  recclk_mon_count_reset <= '1';
521  adapt_count_reset <= '1';
522 
523 
524  if (PLLREFCLKLOST = '0' and pll_reset_asserted = '1') then
525  rx_state <= RELEASE_PLL_RESET;
526  reset_time_out <= '1';
527  end if;
528 
529  when RELEASE_PLL_RESET =>
530  --PLL-Reset of the GTX gets released and the time-out counter
531  --starts running.
532  pll_reset_asserted <= '0';
533  reset_time_out <= '0';
534 
535 
536  if (plllock_sync = '1') then
537  rx_state <= VERIFY_RECCLK_STABLE;
538  reset_time_out <= '1';
539  recclk_mon_count_reset <= '0';
540  adapt_count_reset <= '0';
541  end if;
542 
543  if time_out_2ms = '1' then
545  -- If too many retries are performed compared to what is specified in
546  -- the generic, the counter simply wraps around.
547  retry_counter_int <= 0;
548  else
550  end if;
551  rx_state <= ASSERT_ALL_RESETS;
552  end if;
553 
554  when VERIFY_RECCLK_STABLE =>
555  --reset_time_out <= '0';
556  --Time-out counter is not released in this state as here the FSM
557  --does not wait for a certain period of time but checks on the number
558  --of retries in the RECCLK monitor
559  GTRXRESET <= '0';
560  if RECCLK_STABLE = '1' then
561  rx_state <= RELEASE_MMCM_RESET;
562  reset_time_out <= '1';
563 
564  end if;
565 
566  if recclk_mon_restart_count = 2 then
567  --If two retries are performed in the RECCLK monitor
568  --the whole initialisation-sequence gets restarted.
570  -- If too many retries are performed compared to what is specified in
571  -- the generic, the counter simply wraps around.
572  retry_counter_int <= 0;
573  else
575  end if;
576  rx_state <= ASSERT_ALL_RESETS;
577  end if;
578 
579  when RELEASE_MMCM_RESET =>
580  --Release of the MMCM-reset. Waiting for the MMCM to lock.
581  reset_time_out <= '0';
582  check_tlock_max <= '1';
583 
584  MMCM_RESET <= '0';
585  if mmcm_lock_reclocked(0) = '1' then
586  rx_state <= WAIT_RESET_DONE;
587  reset_time_out <= '1';
588  end if;
589 
590  if time_tlock_max = '1' and reset_time_out = '0' then
592  -- If too many retries are performed compared to what is specified in
593  -- the generic, the counter simply wraps around.
594  retry_counter_int <= 0;
595  else
597  end if;
598  rx_state <= ASSERT_ALL_RESETS;
599  end if;
600 
601  when WAIT_RESET_DONE =>
602  --When TXOUTCLK is the source for RXUSRCLK, RXUSERRDY depends on TXUSERRDY
603  --If RXOUTCLK is the source for RXUSRCLK, TXUSERRDY can be tied to '1'
604  if TXUSERRDY = '1' then
605  RXUSERRDY <= '1';
606  end if;
607  reset_time_out <= '0';
608  if rxresetdone_s3 = '1' then
609  rx_state <= DO_PHASE_ALIGNMENT;
610  reset_time_out <= '1';
611  end if;
612 
613  if time_out_2ms = '1' and reset_time_out = '0' then
615  -- If too many retries are performed compared to what is specified in
616  -- the generic, the counter simply wraps around.
617  retry_counter_int <= 0;
618  else
620  end if;
621  rx_state <= ASSERT_ALL_RESETS;
622  end if;
623 
624  when DO_PHASE_ALIGNMENT =>
625  --The direct handling of the signals for the Phase Alignment is done outside
626  --this state-machine.
627  RESET_PHALIGNMENT <= '0';
629  reset_time_out <= '0';
630 
631  if phalignment_done_sync = '1' then
632  rx_state <= MONITOR_DATA_VALID;
633  reset_time_out <= '1';
634  end if;
635 
636  if time_out_wait_bypass_s3 = '1' then
638  -- If too many retries are performed compared to what is specified in
639  -- the generic, the counter simply wraps around.
640  retry_counter_int <= 0;
641  else
643  end if;
644  rx_state <= ASSERT_ALL_RESETS;
645  end if;
646 
647  when MONITOR_DATA_VALID =>
648  reset_time_out <= '0';
649 
650  if (time_out_100us = '1' and (data_valid_sync = '0') and reset_time_out = '0') then
651  fsmCnt <= (others=>'0');
652  rx_state <= ASSERT_ALL_RESETS;
653  rx_fsm_reset_done_int <= '0';
654  elsif fsmCnt = x"FFFF" then
655  fsmCnt <= (others=>'0');
656  rx_state <= ASSERT_ALL_RESETS;
657  rx_fsm_reset_done_int <= '0';
658  elsif (data_valid_sync = '1') then
659  fsmCnt <= fsmCnt + 1;
660  rx_state <= FSM_DONE;
661  rx_fsm_reset_done_int <= '0';
662  reset_time_out <= '1';
663  end if;
664 
665  when FSM_DONE =>
666  reset_time_out <= '0';
667  if (data_valid_sync = '0') then
668  rx_fsm_reset_done_int <= '0';
669  reset_time_out <= '1';
670  rx_state <= MONITOR_DATA_VALID;
671  elsif (time_out_1us = '1') then
672  rx_fsm_reset_done_int <= '1';
673  end if;
674 
675  if(time_out_adapt = '1') then
676  if(EQ_MODE = "DFE") then
677  RXDFEAGCHOLD <= '1';
678  RXDFELFHOLD <= '1';
679  else
680  RXDFEAGCHOLD <= '0';
681  RXDFELFHOLD <= '0';
682  RXLPMHFHOLD <= '0';
683  RXLPMLFHOLD <= '0';
684  end if;
685  end if;
686 
687  end case;
688  end if;
689  end if;
690  end process;
691 
692 end RTL;
693 
694 
INIT_Gslv := "0"
std_logic := '0' rx_fsm_reset_done_int
Definition: Gth7RxRst.vhd:156
integer := 5000 MAX_WAIT_BYPASS
Definition: Gth7RxRst.vhd:182
rx_rst_fsm_type := INIT rx_state
Definition: Gth7RxRst.vhd:134
std_logic refclk_lost
Definition: Gth7RxRst.vhd:187
(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: Gth7RxRst.vhd:129
integer range 0 to 3:= 0 recclk_mon_restart_count
Definition: Gth7RxRst.vhd:164
integer range 0 to MAX_RETRIES:= 0 retry_counter_int
Definition: Gth7RxRst.vhd:162
out PLL_RESETstd_logic := '0'
Definition: Gth7RxRst.vhd:102
out RXDFELFHOLDstd_logic
Definition: Gth7RxRst.vhd:109
integer := 500 STARTUP_DELAY
Definition: Gth7RxRst.vhd:137
STABLE_CLOCK_PERIODinteger range 4 to 20:= 8
Definition: Gth7RxRst.vhd:84
integer range 0 to MAX_WAIT_BYPASS- 1 wait_bypass_count
Definition: Gth7RxRst.vhd:183
integer := 1000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_1us
Definition: Gth7RxRst.vhd:144
std_logic := '0' phalignment_done_sync
Definition: Gth7RxRst.vhd:195
STAGES_Gpositive := 2
out RX_FSM_RESET_DONEstd_logic
Definition: Gth7RxRst.vhd:103
in PLLLOCKstd_logic
Definition: Gth7RxRst.vhd:93
out RXDFEAGCHOLDstd_logic
Definition: Gth7RxRst.vhd:108
in SOFT_RESETstd_logic
Definition: Gth7RxRst.vhd:91
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_100us
Definition: Gth7RxRst.vhd:145
std_logic := '0' run_phase_alignment_int_s3
Definition: Gth7RxRst.vhd:180
out RESET_PHALIGNMENTstd_logic := '0'
Definition: Gth7RxRst.vhd:107
std_logic := '0' time_tlock_max
Definition: Gth7RxRst.vhd:169
integer := 2** RETRY_COUNTER_BITWIDTH- 1 MAX_RETRIES
Definition: Gth7RxRst.vhd:161
GT_TYPEstring := "GTX"
Definition: Gth7RxRst.vhd:82
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TLOCK_MAX
Definition: Gth7RxRst.vhd:142
std_logic := '0' recclk_mon_count_reset
Definition: Gth7RxRst.vhd:165
std_logic := '0' pll_reset_asserted
Definition: Gth7RxRst.vhd:155
std_logic := '0' reset_time_out
Definition: Gth7RxRst.vhd:167
std_logic := '0' plllock_sync
Definition: Gth7RxRst.vhd:194
in TXUSERRDYstd_logic
Definition: Gth7RxRst.vhd:99
in PLLREFCLKLOSTstd_logic
Definition: Gth7RxRst.vhd:92
out dataOutsl
TPD_Gtime := 1 ns
Definition: Gth7RxRst.vhd:80
in MMCM_LOCKstd_logic
Definition: Gth7RxRst.vhd:95
integer := WAIT_CYCLES+ 10 WAIT_MAX
Definition: Gth7RxRst.vhd:139
in RXRESETDONEstd_logic
Definition: Gth7RxRst.vhd:94
out RXUSERRDYstd_logic := '0'
Definition: Gth7RxRst.vhd:104
std_logic := '0' check_tlock_max
Definition: Gth7RxRst.vhd:173
std_logic := '0' time_out_2ms
Definition: Gth7RxRst.vhd:168
std_logic_vector( 15 downto 0) fsmCnt
Definition: Gth7RxRst.vhd:197
in RECCLK_MONITOR_RESTARTstd_logic := '0'
Definition: Gth7RxRst.vhd:97
std_logic := '0' init_wait_done
Definition: Gth7RxRst.vhd:154
integer range 0 to WAIT_TIME_ADAPT- 1 adapt_count
Definition: Gth7RxRst.vhd:191
std_logic soft_reset_sync
Definition: Gth7RxRst.vhd:148
std_logic soft_reset_fall
Definition: Gth7RxRst.vhd:150
out RXLPMLFHOLDstd_logic
Definition: Gth7RxRst.vhd:110
TPD_Gtime := 1 ns
integer := STARTUP_DELAY/ STABLE_CLOCK_PERIOD WAIT_CYCLES
Definition: Gth7RxRst.vhd:138
EQ_MODEstring := "DFE"
Definition: Gth7RxRst.vhd:83
std_logic soft_reset_rise
Definition: Gth7RxRst.vhd:149
std_logic := '0' time_out_wait_bypass
Definition: Gth7RxRst.vhd:184
integer := 500000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_500us
Definition: Gth7RxRst.vhd:143
std_logic := '0' rxresetdone_s3
Definition: Gth7RxRst.vhd:159
integer range 0 to WAIT_MAX:= 0 init_wait_count
Definition: Gth7RxRst.vhd:153
std_logic := '0' run_phase_alignment_int
Definition: Gth7RxRst.vhd:179
std_logic := '0' rx_fsm_reset_done_int_s3
Definition: Gth7RxRst.vhd:157
out MMCM_RESETstd_logic := '1'
Definition: Gth7RxRst.vhd:101
in RECCLK_STABLEstd_logic
Definition: Gth7RxRst.vhd:96
integer :=( 37000000/ integer( 3.125))/ STABLE_CLOCK_PERIOD WAIT_TIME_ADAPT
Definition: Gth7RxRst.vhd:146
std_logic := '0' time_out_wait_bypass_s3
Definition: Gth7RxRst.vhd:185
in DATA_VALIDstd_logic
Definition: Gth7RxRst.vhd:98
out RXLPMHFHOLDstd_logic
Definition: Gth7RxRst.vhd:111
RETRY_COUNTER_BITWIDTHinteger range 2 to 8:= 8
Definition: Gth7RxRst.vhd:86
std_logic_vector( 3 downto 0) :=( others => '0') mmcm_lock_reclocked
Definition: Gth7RxRst.vhd:177
integer := 3000000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_2ms
Definition: Gth7RxRst.vhd:141
out GTRXRESETstd_logic := '0'
Definition: Gth7RxRst.vhd:100
EXAMPLE_SIMULATIONinteger := 0
Definition: Gth7RxRst.vhd:81
std_logic := '0' time_out_adapt
Definition: Gth7RxRst.vhd:189
out RUN_PHALIGNMENTstd_logic
Definition: Gth7RxRst.vhd:105
integer range 0 to MMCM_LOCK_CNT_MAX- 1:= 0 mmcm_lock_count
Definition: Gth7RxRst.vhd:175
std_logic := '0' time_out_100us
Definition: Gth7RxRst.vhd:172
integer := 1024 MMCM_LOCK_CNT_MAX
Definition: Gth7RxRst.vhd:136
in STABLE_CLOCKstd_logic
Definition: Gth7RxRst.vhd:88
std_logic := '0' data_valid_sync
Definition: Gth7RxRst.vhd:193
std_logic := '0' time_out_500us
Definition: Gth7RxRst.vhd:170
string dont_touch
Definition: Gth7RxRst.vhd:199
std_logic := '0' time_out_1us
Definition: Gth7RxRst.vhd:171
std_logic := '0' mmcm_lock_int
Definition: Gth7RxRst.vhd:176
out RETRY_COUNTERstd_logic_vector( RETRY_COUNTER_BITWIDTH- 1 downto 0) :=( others => '0')
Definition: Gth7RxRst.vhd:115
std_logic := '0' adapt_count_reset
Definition: Gth7RxRst.vhd:190
in PHALIGNMENT_DONEstd_logic
Definition: Gth7RxRst.vhd:106
in RXUSERCLKstd_logic
Definition: Gth7RxRst.vhd:90
integer range 0 to WAIT_TIMEOUT_2ms:= 0 time_out_counter
Definition: Gth7RxRst.vhd:163