1 --//////////////////////////////////////////////////////////////////////////////// 4 --// /___/ \ / Vendor: Xilinx 5 --// \ \ \/ Version : 2.2 6 --// \ \ Application : 7 Series FPGAs Transceivers Wizard 7 --// / / Filename : Gth7RxRst.vhd 13 -- Description : This module performs RX reset and initialization. 18 -- Generated by Xilinx 7 Series FPGAs Transceivers Wizard 21 -- (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved. 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 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. 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. 64 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS 65 -- PART OF THIS FILE AT ALL TIMES. 68 --***************************************************************************** 71 use ieee.std_logic_1164.
all;
73 use ieee.std_logic_unsigned.
all;
74 use ieee.std_logic_arith.
all;
77 --! @ingroup xilinx_7Series_gth7 83 EQ_MODE : := "DFE";
--RX Equalisation Mode; set to DFE or LPM 84 STABLE_CLOCK_PERIOD : range 4 to 20 := 8;
--Period of the stable clock driving this state-machine, unit is [ns] 88 STABLE_CLOCK : in ;
--Stable Clock, either a stable clock from the PCB 89 --or reference-clock present at startup. 93 PLLLOCK : in ;
--Lock Detect from the PLL of the GT 114 -- Retries it took to get the transceiver up and running 119 -- * Timing depends on the frequency of the stable clock. Hence counters-sizes 120 -- are calculated at design-time based on the Generics 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 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);
137 constant STARTUP_DELAY : := 500;
--AR43482: Transceiver needs to wait for 500 ns after configuration 168 signal time_out_2ms : := '0';
--\Flags that the various time-out points 182 constant MAX_WAIT_BYPASS : := 5000;
--5000 RXUSRCLK cycles is the max time for Multi lanes designs 207 attribute KEEP_HIERARCHY : ;
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";
221 --Alias section, signals used within this module mapped to output ports: 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. 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. 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. 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). 340 -- Clock Domain Crossing 341 Synchronizer_run_phase_alignment :
entity work.
Synchronizer 381 Synchronizer_time_out_wait_bypass :
entity work.
Synchronizer 391 Synchronizer_mmcm_lock_reclocked :
entity work.
Synchronizer 416 -- Phase aligner might run on rxusrclk in some cases 417 -- Synchronizer it just in case 418 Synchronizer_PHALIGNMENT_DONE :
entity work.
Synchronizer 443 -- Lock Detect Clock should be driven by STABLE_CLOCK, no need to synchronize 448 --FSM for resetting the GTX/GTH/GTP in the 7-series. 449 --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 462 -- 7) Reset-sequence has successfully run through. Signal this to the 463 -- rest of the design by asserting RX_FSM_RESET_DONE. 494 --Initial state after configuration. This state will be left after 495 --approx. 500 ns and not be re-entered. 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. 529 when RELEASE_PLL_RESET => 530 --PLL-Reset of the GTX gets released and the time-out counter 545 -- If too many retries are performed compared to what is specified in 546 -- the generic, the counter simply wraps around. 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 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. 579 when RELEASE_MMCM_RESET => 580 --Release of the MMCM-reset. Waiting for the MMCM to lock. 592 -- If too many retries are performed compared to what is specified in 593 -- the generic, the counter simply wraps around. 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' 615 -- If too many retries are performed compared to what is specified in 616 -- the generic, the counter simply wraps around. 624 when DO_PHASE_ALIGNMENT => 625 --The direct handling of the signals for the Phase Alignment is done outside 626 --this state-machine. 638 -- If too many retries are performed compared to what is specified in 639 -- the generic, the counter simply wraps around. 647 when MONITOR_DATA_VALID => 654 elsif fsmCnt = x"FFFF" then
std_logic := '0' rx_fsm_reset_done_int
integer := 5000 MAX_WAIT_BYPASS
rx_rst_fsm_type := INIT rx_state
(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
integer range 0 to MAX_RETRIES:= 0 retry_counter_int
out PLL_RESETstd_logic := '0'
integer := 500 STARTUP_DELAY
STABLE_CLOCK_PERIODinteger range 4 to 20:= 8
integer range 0 to MAX_WAIT_BYPASS- 1 wait_bypass_count
integer := 1000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_1us
std_logic := '0' phalignment_done_sync
out RX_FSM_RESET_DONEstd_logic
out RXDFEAGCHOLDstd_logic
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_100us
std_logic := '0' run_phase_alignment_int_s3
out RESET_PHALIGNMENTstd_logic := '0'
std_logic := '0' time_tlock_max
integer := 2** RETRY_COUNTER_BITWIDTH- 1 MAX_RETRIES
integer := 100000/ STABLE_CLOCK_PERIOD WAIT_TLOCK_MAX
std_logic := '0' recclk_mon_count_reset
std_logic := '0' pll_reset_asserted
std_logic := '0' reset_time_out
std_logic := '0' plllock_sync
in PLLREFCLKLOSTstd_logic
integer := WAIT_CYCLES+ 10 WAIT_MAX
out RXUSERRDYstd_logic := '0'
std_logic := '0' check_tlock_max
std_logic := '0' time_out_2ms
std_logic_vector( 15 downto 0) fsmCnt
in RECCLK_MONITOR_RESTARTstd_logic := '0'
std_logic := '0' init_wait_done
integer range 0 to WAIT_TIME_ADAPT- 1 adapt_count
std_logic soft_reset_sync
std_logic soft_reset_fall
integer := STARTUP_DELAY/ STABLE_CLOCK_PERIOD WAIT_CYCLES
std_logic soft_reset_rise
std_logic := '0' time_out_wait_bypass
integer := 500000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_500us
std_logic := '0' rxresetdone_s3
integer range 0 to WAIT_MAX:= 0 init_wait_count
std_logic := '0' run_phase_alignment_int
std_logic := '0' rx_fsm_reset_done_int_s3
out MMCM_RESETstd_logic := '1'
in RECCLK_STABLEstd_logic
integer :=( 37000000/ integer( 3.125))/ STABLE_CLOCK_PERIOD WAIT_TIME_ADAPT
std_logic := '0' time_out_wait_bypass_s3
RETRY_COUNTER_BITWIDTHinteger range 2 to 8:= 8
std_logic_vector( 3 downto 0) :=( others => '0') mmcm_lock_reclocked
integer := 3000000/ STABLE_CLOCK_PERIOD WAIT_TIMEOUT_2ms
out GTRXRESETstd_logic := '0'
EXAMPLE_SIMULATIONinteger := 0
std_logic := '0' time_out_adapt
out RUN_PHALIGNMENTstd_logic
integer range 0 to MMCM_LOCK_CNT_MAX- 1:= 0 mmcm_lock_count
std_logic := '0' time_out_100us
integer := 1024 MMCM_LOCK_CNT_MAX
std_logic := '0' data_valid_sync
std_logic := '0' time_out_500us
std_logic := '0' time_out_1us
std_logic := '0' mmcm_lock_int
out RETRY_COUNTERstd_logic_vector( RETRY_COUNTER_BITWIDTH- 1 downto 0) :=( others => '0')
std_logic := '0' adapt_count_reset
in PHALIGNMENT_DONEstd_logic
integer range 0 to WAIT_TIMEOUT_2ms:= 0 time_out_counter