SURF  1.0
GLinkGtx7RxRst.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : GLinkGtx7RxRst.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2012-12-17
5 -- Last update: 2014-11-10
6 -------------------------------------------------------------------------------
7 -- Description: G-Link GTX7 Reset module
8 -------------------------------------------------------------------------------
9 -- This file is part of 'SLAC Firmware Standard Library'.
10 -- It is subject to the license terms in the LICENSE.txt file found in the
11 -- top-level directory of this distribution and at:
12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
13 -- No part of 'SLAC Firmware Standard Library', including this file,
14 -- may be copied, modified, propagated, or distributed except according to
15 -- the terms contained in the LICENSE.txt file.
16 -------------------------------------------------------------------------------
17 
18 library ieee;
19 use ieee.std_logic_1164.all;
20 use ieee.numeric_std.all;
21 use ieee.std_logic_unsigned.all;
22 use ieee.std_logic_arith.all;
23 
24 --! @see entity
25  --! @ingroup protocols_glink_gtx7
26 entity GLinkGtx7RxRst is
27  generic(
28  TPD_G : time := 1 ns;
29  EXAMPLE_SIMULATION : integer := 0;
30  GT_TYPE : string := "GTX";
31  STABLE_CLOCK_PERIOD : integer range 4 to 20 := 8; --Period of the stable clock driving this state-machine, unit is [ns]
32  RETRY_COUNTER_BITWIDTH : integer range 2 to 8 := 8
33  );
34  port (
35  lpmMode : in std_logic;
36  STABLE_CLOCK : in std_logic; --Stable Clock, either a stable clock from the PCB
37  --or reference-clock present at startup.
38  RXUSERCLK : in std_logic; --RXUSERCLK as used in the design
39  SOFT_RESET : in std_logic; --User Reset, can be pulled any time
40  PLLREFCLKLOST : in std_logic; --PLL Reference-clock for the GT is lost
41  PLLLOCK : in std_logic; --Lock Detect from the PLL of the GT
42  RXRESETDONE : in std_logic;
43  MMCM_LOCK : in std_logic;
44  RECCLK_STABLE : in std_logic;
45  RECCLK_MONITOR_RESTART : in std_logic := '0';
46  DATA_VALID : in std_logic;
47  TXUSERRDY : in std_logic; --TXUSERRDY from GT
48  GTRXRESET : out std_logic := '0';
49  MMCM_RESET : out std_logic := '1';
50  PLL_RESET : out std_logic := '0'; --Reset PLL
51  RX_FSM_RESET_DONE : out std_logic; --Reset-sequence has sucessfully been finished.
52  RXUSERRDY : out std_logic := '0';
53  RUN_PHALIGNMENT : out std_logic;
54  PHALIGNMENT_DONE : in std_logic; -- Drive high if phase alignment not needed
55  RESET_PHALIGNMENT : out std_logic := '0';
56  RXDFEAGCHOLD : out std_logic;
57  RXDFELFHOLD : out std_logic;
58  RXLPMLFHOLD : out std_logic;
59  RXLPMHFHOLD : out std_logic;
60 
61  RETRY_COUNTER : out std_logic_vector (RETRY_COUNTER_BITWIDTH-1 downto 0) := (others => '0') -- Number of
62  -- Retries it took to get the transceiver up and running
63  );
64 end GLinkGtx7RxRst;
65 
66 --Interdependencies:
67 -- * Timing depends on the frequency of the stable clock. Hence counters-sizes
68 -- are calculated at design-time based on the Generics
69 --
70 -- * if either of the PLLs is reset during TX-startup, it does not need to be reset again by RX
71 -- => signal which PLL has been reset
72 -- *
73 
74 
75 
76 architecture RTL of GLinkGtx7RxRst is
77  type rx_rst_fsm_type is(
78  INIT, ASSERT_ALL_RESETS, RELEASE_PLL_RESET, VERIFY_RECCLK_STABLE,
79  RELEASE_MMCM_RESET, WAIT_RESET_DONE, DO_PHASE_ALIGNMENT,
80  MONITOR_DATA_VALID, FSM_DONE);
81 
82  signal rx_state : rx_rst_fsm_type := INIT;
83 
84  constant MMCM_LOCK_CNT_MAX : integer := 1024;
85  constant STARTUP_DELAY : integer := 500; --AR43482: Transceiver needs to wait for 500 ns after configuration
86  constant WAIT_CYCLES : integer := STARTUP_DELAY / STABLE_CLOCK_PERIOD; -- Number of Clock-Cycles to wait after configuration
87  constant WAIT_MAX : integer := WAIT_CYCLES + 10; -- 500 ns plus some additional margin
88 
89  constant WAIT_TIMEOUT_2ms : integer := 3000000 / STABLE_CLOCK_PERIOD; -- 2 ms time-out
90  constant WAIT_TLOCK_MAX : integer := 100000 / STABLE_CLOCK_PERIOD; --100 us time-out
91  constant WAIT_TIMEOUT_500us : integer := 500000 / STABLE_CLOCK_PERIOD; --500 us time-out
92  constant WAIT_TIMEOUT_1us : integer := 1000 / STABLE_CLOCK_PERIOD; --1 us time-out
93  constant WAIT_TIMEOUT_100us : integer := 100000 / STABLE_CLOCK_PERIOD; --100 us time-out
94  constant WAIT_TIME_ADAPT : integer := (37000000 /integer(3.125))/STABLE_CLOCK_PERIOD;
95 
96  signal soft_reset_sync : std_logic;
97  signal soft_reset_rise : std_logic;
98  signal soft_reset_fall : std_logic;
99 
100 
101  signal init_wait_count : integer range 0 to WAIT_MAX := 0;
102  signal init_wait_done : std_logic := '0';
103  signal pll_reset_asserted : std_logic := '0';
104  signal rx_fsm_reset_done_int : std_logic := '0';
105  signal rx_fsm_reset_done_int_s3 : std_logic := '0';
106 
107  signal rxresetdone_s3 : std_logic := '0';
108 
109  constant MAX_RETRIES : integer := 2**RETRY_COUNTER_BITWIDTH-1;
110  signal retry_counter_int : integer range 0 to MAX_RETRIES := 0;
111  signal time_out_counter : integer range 0 to WAIT_TIMEOUT_2ms := 0;
112  signal recclk_mon_restart_count : integer range 0 to 3 := 0;
113  signal recclk_mon_count_reset : std_logic := '0';
114 
115  signal reset_time_out : std_logic := '0';
116  signal time_out_2ms : std_logic := '0'; --\Flags that the various time-out points
117  signal time_tlock_max : std_logic := '0'; --|have been reached.
118  signal time_out_500us : std_logic := '0'; --|
119  signal time_out_1us : std_logic := '0'; --/
120  signal time_out_100us : std_logic := '0'; --/
121  signal check_tlock_max : std_logic := '0';
122 
123  signal mmcm_lock_count : integer range 0 to MMCM_LOCK_CNT_MAX-1 := 0;
124  signal mmcm_lock_int : std_logic := '0';
125  signal mmcm_lock_reclocked : std_logic_vector(3 downto 0) := (others => '0');
126 
127  signal run_phase_alignment_int : std_logic := '0';
128  signal run_phase_alignment_int_s3 : std_logic := '0';
129 
130  constant MAX_WAIT_BYPASS : integer := 5000; --5000 RXUSRCLK cycles is the max time for Multi lanes designs
131  signal wait_bypass_count : integer range 0 to MAX_WAIT_BYPASS-1;
132  signal time_out_wait_bypass : std_logic := '0';
133  signal time_out_wait_bypass_s3 : std_logic := '0';
134 
135  signal refclk_lost : std_logic;
136 
137  signal time_out_adapt : std_logic := '0';
138  signal adapt_count_reset : std_logic := '0';
139  signal adapt_count : integer range 0 to WAIT_TIME_ADAPT-1;
140 
141  signal data_valid_sync : std_logic := '0';
142  signal plllock_sync : std_logic := '0';
143  signal phalignment_done_sync : std_logic := '0';
144 
145  signal fsmCnt : std_logic_vector(15 downto 0);
146 
147  attribute KEEP_HIERARCHY : string;
148  attribute KEEP_HIERARCHY of
149  Synchronizer_run_phase_alignment,
150  Synchronizer_fsm_reset_done,
151  Synchronizer_SOFT_RESET,
152  Synchronizer_RXRESETDONE,
153  Synchronizer_time_out_wait_bypass,
154  Synchronizer_mmcm_lock_reclocked,
155  Synchronizer_data_valid,
156  Synchronizer_PLLLOCK,
157  Synchronizer_PHALIGNMENT_DONE : label is "TRUE";
158 
159 begin
160 
161  --Alias section, signals used within this module mapped to output ports:
162  RETRY_COUNTER <= std_logic_vector(TO_UNSIGNED(retry_counter_int, RETRY_COUNTER_BITWIDTH));
165 
166  process(STABLE_CLOCK)
167  begin
168  if rising_edge(STABLE_CLOCK) then
169  -- The counter starts running when configuration has finished and
170  -- the clock is stable. When its maximum count-value has been reached,
171  -- the 500 ns from Answer Record 43482 have been passed.
172  if init_wait_count = WAIT_MAX then
173  init_wait_done <= '1';
174  else
176  end if;
177  end if;
178  end process;
179 
180 
181  adapt_wait_sim : if(EXAMPLE_SIMULATION = 1) generate
182  time_out_adapt <= '1';
183  end generate;
184 
185  adapt_wait_hw : if(EXAMPLE_SIMULATION = 0) generate
186  process(STABLE_CLOCK)
187  begin
188  if rising_edge(STABLE_CLOCK) then
189  if(adapt_count_reset = '1') then
190  adapt_count <= 0;
191  time_out_adapt <= '0';
192  elsif(adapt_count = WAIT_TIME_ADAPT -1) then
193  time_out_adapt <= '1';
194  else
195  adapt_count <= adapt_count + 1;
196  end if;
197  end if;
198  end process;
199  end generate;
200 
201  retries_recclk_monitor : process(STABLE_CLOCK)
202  begin
203  --This counter monitors, how many retries the RECCLK monitor
204  --runs. If during startup too many retries are necessary, the whole
205  --initialisation-process of the transceivers gets restarted.
206  if rising_edge(STABLE_CLOCK) then
207  if recclk_mon_count_reset = '1' then
209  elsif RECCLK_MONITOR_RESTART = '1' then
210  if recclk_mon_restart_count = 3 then
212  else
214  end if;
215  end if;
216  end if;
217  end process;
218 
219  timeouts : process(STABLE_CLOCK)
220  begin
221  if rising_edge(STABLE_CLOCK) then
222  -- One common large counter for generating three time-out signals.
223  -- Intermediate time-outs are derived from calculated values, based
224  -- on the period of the provided clock.
225  if reset_time_out = '1' then
226  time_out_counter <= 0;
227  time_out_2ms <= '0';
228  time_tlock_max <= '0';
229  time_out_500us <= '0';
230  time_out_1us <= '0';
231  time_out_100us <= '0';
232  else
234  time_out_2ms <= '1';
235  else
237  end if;
238 
239  if (time_out_counter > WAIT_TLOCK_MAX) and (check_tlock_max = '1') then
240  time_tlock_max <= '1';
241  end if;
242 
244  time_out_500us <= '1';
245  end if;
246 
248  time_out_1us <= '1';
249  end if;
250 
252  time_out_100us <= '1';
253  end if;
254 
255  end if;
256  end if;
257  end process;
258 
259 
260  mmcm_lock_wait : process(RXUSERCLK, MMCM_LOCK)
261  begin
262  --The lock-signal from the MMCM is not immediately used but
263  --enabling a counter. Only when the counter hits its maximum,
264  --the MMCM is considered as "really" locked.
265  --The counter avoids that the FSM already starts on only a
266  --coarse lock of the MMCM (=toggling of the LOCK-signal).
267  if MMCM_LOCK = '0' then
268  mmcm_lock_count <= 0;
269  mmcm_lock_int <= '0';
270  elsif rising_edge(RXUSERCLK) then
271  if mmcm_lock_count < MMCM_LOCK_CNT_MAX - 1 then
273  else
274  mmcm_lock_int <= '1';
275  end if;
276  end if;
277  end process;
278 
279 
280  -- Clock Domain Crossing
281  Synchronizer_run_phase_alignment : entity work.Synchronizer
282  generic map (
283  TPD_G => TPD_G,
284  STAGES_G => 3,
285  INIT_G => "000")
286  port map (
287  clk => RXUSERCLK,
290 
291  Synchronizer_fsm_reset_done : entity work.Synchronizer
292  generic map (
293  TPD_G => TPD_G,
294  STAGES_G => 3,
295  INIT_G => "000")
296  port map (
297  clk => RXUSERCLK,
300 
301  Synchronizer_SOFT_RESET : entity work.SynchronizerEdge
302  generic map (
303  TPD_G => TPD_G)
304  port map (
305  clk => STABLE_CLOCK,
306  dataIn => SOFT_RESET,
310 
311  Synchronizer_RXRESETDONE : entity work.Synchronizer
312  generic map (
313  TPD_G => TPD_G,
314  STAGES_G => 3,
315  INIT_G => "000")
316  port map (
317  clk => STABLE_CLOCK,
318  dataIn => RXRESETDONE,
320 
321  Synchronizer_time_out_wait_bypass : entity work.Synchronizer
322  generic map (
323  TPD_G => TPD_G,
324  STAGES_G => 3,
325  INIT_G => "000")
326  port map (
327  clk => STABLE_CLOCK,
330 
331  Synchronizer_mmcm_lock_reclocked : entity work.Synchronizer
332  generic map (
333  TPD_G => TPD_G)
334  port map (
335  clk => STABLE_CLOCK,
338 
339  Synchronizer_data_valid : entity work.Synchronizer
340  generic map (
341  TPD_G => TPD_G)
342  port map (
343  clk => STABLE_CLOCK,
344  dataIn => DATA_VALID,
346 
347 
348  Synchronizer_PLLLOCK : entity work.Synchronizer
349  generic map (
350  TPD_G => TPD_G)
351  port map (
352  clk => STABLE_CLOCK,
353  dataIn => PLLLOCK,
354  dataOut => plllock_sync);
355 
356  -- Phase aligner might run on rxusrclk in some cases
357  -- Synchronizer it just in case
358  Synchronizer_PHALIGNMENT_DONE : entity work.Synchronizer
359  generic map (
360  TPD_G => TPD_G)
361  port map (
362  clk => STABLE_CLOCK,
365 
366 
367  timeout_buffer_bypass : process(RXUSERCLK)
368  begin
369  if rising_edge(RXUSERCLK) then
370  if run_phase_alignment_int_s3 = '0' then
371  wait_bypass_count <= 0;
372  time_out_wait_bypass <= '0';
373  elsif (run_phase_alignment_int_s3 = '1') and (rx_fsm_reset_done_int_s3 = '0') then
374  if wait_bypass_count = MAX_WAIT_BYPASS - 1 then
375  time_out_wait_bypass <= '1';
376  else
378  end if;
379  end if;
380  end if;
381  end process;
382 
383  -- Lock Detect Clock should be driven by STABLE_CLOCK, no need to synchronize
385 
386 
387 
388  --FSM for resetting the GTX/GTH/GTP in the 7-series.
389  --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390  --
391  -- Following steps are performed:
392  -- 1) After configuration wait for approximately 500 ns as specified in
393  -- answer-record 43482
394  -- 2) Assert all resets on the GT and on an MMCM potentially connected.
395  -- After that wait until a reference-clock has been detected.
396  -- 3) Release the reset to the GT and wait until the GT-PLL has locked.
397  -- 4) Release the MMCM-reset and wait until the MMCM has signalled lock.
398  -- Also get info from the TX-side which PLL has been reset.
399  -- 5) Wait for the RESET_DONE-signal from the GT.
400  -- 6) Signal to start the phase-alignment procedure and wait for it to
401  -- finish.
402  -- 7) Reset-sequence has successfully run through. Signal this to the
403  -- rest of the design by asserting RX_FSM_RESET_DONE.
404 
405  reset_fsm : process(STABLE_CLOCK)
406  begin
407  if rising_edge(STABLE_CLOCK) then
408  if (soft_reset_sync = '1' or
409  (not(rx_state = INIT) and not(rx_state = ASSERT_ALL_RESETS) and refclk_lost = '1')) then
410  rx_state <= INIT;
411  RXUSERRDY <= '0';
412  GTRXRESET <= '0';
413  MMCM_RESET <= '1';
414  rx_fsm_reset_done_int <= '0';
415  PLL_RESET <= '0';
416  pll_reset_asserted <= '0';
417  reset_time_out <= '1';
418  retry_counter_int <= 0;
420  check_tlock_max <= '0';
421  RESET_PHALIGNMENT <= '1';
422  recclk_mon_count_reset <= '1';
423  adapt_count_reset <= '1';
424  RXDFEAGCHOLD <= '0';
425  RXDFELFHOLD <= '0';
426  RXLPMLFHOLD <= '0';
427  RXLPMHFHOLD <= '0';
428  fsmCnt <= (others=>'0');
429 
430  else
431 
432  case rx_state is
433  when INIT =>
434  --Initial state after configuration. This state will be left after
435  --approx. 500 ns and not be re-entered.
436  if init_wait_done = '1' then
437  rx_state <= ASSERT_ALL_RESETS;
438  end if;
439 
440  when ASSERT_ALL_RESETS =>
441  --This is the state into which the FSM will always jump back if any
442  --time-outs will occur.
443  --The number of retries is reported on the output RETRY_COUNTER. In
444  --case the transceiver never comes up for some reason, this machine
445  --will still continue its best and rerun until the FPGA is turned off
446  --or the transceivers come up correctly.
447  if pll_reset_asserted = '0' then
448  PLL_RESET <= '1';
449  pll_reset_asserted <= '1';
450  else
451  PLL_RESET <= '0';
452  end if;
453 
454  RXUSERRDY <= '0';
455  GTRXRESET <= '1';
456  MMCM_RESET <= '1';
458  RESET_PHALIGNMENT <= '1';
459  check_tlock_max <= '0';
460  recclk_mon_count_reset <= '1';
461  adapt_count_reset <= '1';
462 
463 
464  if (PLLREFCLKLOST = '0' and pll_reset_asserted = '1') then
465  rx_state <= RELEASE_PLL_RESET;
466  reset_time_out <= '1';
467  end if;
468 
469  when RELEASE_PLL_RESET =>
470  --PLL-Reset of the GTX gets released and the time-out counter
471  --starts running.
472  pll_reset_asserted <= '0';
473  reset_time_out <= '0';
474 
475 
476  if (plllock_sync = '1') then
477  rx_state <= VERIFY_RECCLK_STABLE;
478  reset_time_out <= '1';
479  recclk_mon_count_reset <= '0';
480  adapt_count_reset <= '0';
481  end if;
482 
483  if time_out_2ms = '1' then
485  -- If too many retries are performed compared to what is specified in
486  -- the generic, the counter simply wraps around.
487  retry_counter_int <= 0;
488  else
490  end if;
491  rx_state <= ASSERT_ALL_RESETS;
492  end if;
493 
494  when VERIFY_RECCLK_STABLE =>
495  --reset_time_out <= '0';
496  --Time-out counter is not released in this state as here the FSM
497  --does not wait for a certain period of time but checks on the number
498  --of retries in the RECCLK monitor
499  GTRXRESET <= '0';
500  if RECCLK_STABLE = '1' then
501  rx_state <= RELEASE_MMCM_RESET;
502  reset_time_out <= '1';
503 
504  end if;
505 
506  if recclk_mon_restart_count = 2 then
507  --If two retries are performed in the RECCLK monitor
508  --the whole initialisation-sequence gets restarted.
510  -- If too many retries are performed compared to what is specified in
511  -- the generic, the counter simply wraps around.
512  retry_counter_int <= 0;
513  else
515  end if;
516  rx_state <= ASSERT_ALL_RESETS;
517  end if;
518 
519  when RELEASE_MMCM_RESET =>
520  --Release of the MMCM-reset. Waiting for the MMCM to lock.
521  reset_time_out <= '0';
522  check_tlock_max <= '1';
523 
524  MMCM_RESET <= '0';
525  if mmcm_lock_reclocked(0) = '1' then
526  rx_state <= WAIT_RESET_DONE;
527  reset_time_out <= '1';
528  end if;
529 
530  if time_tlock_max = '1' and reset_time_out = '0' then
532  -- If too many retries are performed compared to what is specified in
533  -- the generic, the counter simply wraps around.
534  retry_counter_int <= 0;
535  else
537  end if;
538  rx_state <= ASSERT_ALL_RESETS;
539  end if;
540 
541  when WAIT_RESET_DONE =>
542  --When TXOUTCLK is the source for RXUSRCLK, RXUSERRDY depends on TXUSERRDY
543  --If RXOUTCLK is the source for RXUSRCLK, TXUSERRDY can be tied to '1'
544  if TXUSERRDY = '1' then
545  RXUSERRDY <= '1';
546  end if;
547  reset_time_out <= '0';
548  if rxresetdone_s3 = '1' then
549  rx_state <= DO_PHASE_ALIGNMENT;
550  reset_time_out <= '1';
551  end if;
552 
553  if time_out_2ms = '1' and reset_time_out = '0' then
555  -- If too many retries are performed compared to what is specified in
556  -- the generic, the counter simply wraps around.
557  retry_counter_int <= 0;
558  else
560  end if;
561  rx_state <= ASSERT_ALL_RESETS;
562  end if;
563 
564  when DO_PHASE_ALIGNMENT =>
565  --The direct handling of the signals for the Phase Alignment is done outside
566  --this state-machine.
567  RESET_PHALIGNMENT <= '0';
569  reset_time_out <= '0';
570 
571  if phalignment_done_sync = '1' then
572  rx_state <= MONITOR_DATA_VALID;
573  reset_time_out <= '1';
574  end if;
575 
576  if time_out_wait_bypass_s3 = '1' then
578  -- If too many retries are performed compared to what is specified in
579  -- the generic, the counter simply wraps around.
580  retry_counter_int <= 0;
581  else
583  end if;
584  rx_state <= ASSERT_ALL_RESETS;
585  end if;
586 
587  when MONITOR_DATA_VALID =>
588  reset_time_out <= '0';
589 
590  if (time_out_100us = '1' and (data_valid_sync = '0') and reset_time_out = '0') then
591  fsmCnt <= (others=>'0');
592  rx_state <= ASSERT_ALL_RESETS;
593  rx_fsm_reset_done_int <= '0';
594  elsif fsmCnt = x"FFFF" then
595  fsmCnt <= (others=>'0');
596  rx_state <= ASSERT_ALL_RESETS;
597  rx_fsm_reset_done_int <= '0';
598  elsif (data_valid_sync = '1') then
599  fsmCnt <= fsmCnt + 1;
600  rx_state <= FSM_DONE;
601  rx_fsm_reset_done_int <= '0';
602  reset_time_out <= '1';
603  end if;
604 
605  when FSM_DONE =>
606  reset_time_out <= '0';
607  if (data_valid_sync = '0') then
608  rx_fsm_reset_done_int <= '0';
609  reset_time_out <= '1';
610  rx_state <= MONITOR_DATA_VALID;
611  elsif (time_out_1us = '1') then
612  rx_fsm_reset_done_int <= '1';
613  end if;
614 
615  if(time_out_adapt = '1') then
616  if(lpmMode = '0') then
617  RXDFEAGCHOLD <= '1';
618  RXDFELFHOLD <= '1';
619  else
620  RXDFEAGCHOLD <= '0';
621  RXDFELFHOLD <= '0';
622  RXLPMHFHOLD <= '0';
623  RXLPMLFHOLD <= '0';
624  end if;
625  end if;
626 
627  end case;
628  end if;
629  end if;
630  end process;
631 
632 end RTL;
633 
634 
integer range 0 to WAIT_TIMEOUT_2ms:= 0 time_out_counter
INIT_Gslv := "0"
out RESET_PHALIGNMENTstd_logic := '0'
out RXDFEAGCHOLDstd_logic
in STABLE_CLOCKstd_logic
std_logic := '0' data_valid_sync
rx_rst_fsm_type := INIT rx_state
integer range 0 to MAX_RETRIES:= 0 retry_counter_int
in MMCM_LOCKstd_logic
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TLOCK_MAX
in lpmModestd_logic
integer range 0 to WAIT_MAX:= 0 init_wait_count
integer := 5000 MAX_WAIT_BYPASS
std_logic := '0' adapt_count_reset
EXAMPLE_SIMULATIONinteger := 0
in PLLREFCLKLOSTstd_logic
integer := 2** RETRY_COUNTER_BITWIDTH- 1 MAX_RETRIES
in RXUSERCLKstd_logic
in RECCLK_STABLEstd_logic
STAGES_Gpositive := 2
out RXDFELFHOLDstd_logic
integer := WAIT_CYCLES+ 10 WAIT_MAX
std_logic_vector( 15 downto 0) fsmCnt
std_logic := '0' rx_fsm_reset_done_int_s3
STABLE_CLOCK_PERIODinteger range 4 to 20:= 8
in RXRESETDONEstd_logic
integer range 0 to WAIT_TIME_ADAPT- 1 adapt_count
std_logic := '0' time_out_adapt
std_logic_vector( 3 downto 0) :=( others => '0') mmcm_lock_reclocked
std_logic := '0' time_out_500us
std_logic := '0' time_out_100us
out RXLPMLFHOLDstd_logic
RETRY_COUNTER_BITWIDTHinteger range 2 to 8:= 8
std_logic := '0' reset_time_out
out dataOutsl
in DATA_VALIDstd_logic
std_logic soft_reset_rise
GT_TYPEstring := "GTX"
std_logic := '0' check_tlock_max
integer := 1024 MMCM_LOCK_CNT_MAX
std_logic := '0' time_tlock_max
in RECCLK_MONITOR_RESTARTstd_logic := '0'
in PHALIGNMENT_DONEstd_logic
std_logic := '0' run_phase_alignment_int_s3
integer := 1000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_1us
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_100us
in PLLLOCKstd_logic
integer range 0 to MMCM_LOCK_CNT_MAX- 1:= 0 mmcm_lock_count
std_logic := '0' pll_reset_asserted
std_logic := '0' mmcm_lock_int
TPD_Gtime := 1 ns
std_logic soft_reset_sync
integer := STARTUP_DELAY/ STABLE_CLOCK_PERIOD WAIT_CYCLES
std_logic := '0' time_out_wait_bypass_s3
(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
integer range 0 to 3:= 0 recclk_mon_restart_count
std_logic := '0' run_phase_alignment_int
out RX_FSM_RESET_DONEstd_logic
std_logic soft_reset_fall
std_logic := '0' time_out_2ms
in TXUSERRDYstd_logic
out PLL_RESETstd_logic := '0'
integer := 500 STARTUP_DELAY
out MMCM_RESETstd_logic := '1'
std_logic := '0' time_out_1us
integer := 500000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_500us
out GTRXRESETstd_logic := '0'
integer := 3000000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_2ms
std_logic := '0' phalignment_done_sync
out RXUSERRDYstd_logic := '0'
integer :=( 37000000/ integer( 3.125))/ STABLE_CLOCK_PERIOD WAIT_TIME_ADAPT
std_logic := '0' recclk_mon_count_reset
TPD_Gtime := 1 ns
std_logic := '0' init_wait_done
out RUN_PHALIGNMENTstd_logic
std_logic := '0' rx_fsm_reset_done_int
std_logic := '0' plllock_sync
in SOFT_RESETstd_logic
out RETRY_COUNTERstd_logic_vector( RETRY_COUNTER_BITWIDTH- 1 downto 0) :=( others => '0')
out RXLPMHFHOLDstd_logic
std_logic := '0' time_out_wait_bypass
integer range 0 to MAX_WAIT_BYPASS- 1 wait_bypass_count
std_logic := '0' rxresetdone_s3