3 -------------------------------------------------------------------------------
6 -- /___/ \ / Vendor: Xilinx
7 -- \ \ \/ Version : 1.12
8 -- \ \ Application : Virtex-6 FPGA GTX Transceiver Wizard
9 -- / / Filename : tx_sync.vhd
16 -- Generated by Xilinx Virtex-6 FPGA GTX Transceiver Wizard
19 -- (c) Copyright 2009-2011 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;
92 --***********************************Parameter Declarations********************
94 constant DLY : := 1 ns;
96 --*******************************Register Declarations************************
107 --*******************************Wire Declarations****************************
118 --*******************************Main Body of Code****************************
120 --________________________________ State machine __________________________
121 -- This state machine manages the TX phase alignment procedure of the GTX.
122 -- The module is held in reset till TXRESETDONE is asserted. Once TXRESETDONE
123 -- is asserted, the state machine goes into the align_reset_r state, asserting
124 -- TXDLYALIGNRESET for 20 TXUSRCLK2 cycles. After this, it goes into the
125 -- wait_before_setphase_r state for 32 cycles. After asserting TXENPMAPHASEALIGN and
126 -- waiting 32 cycles, it goes into the phase_align_r state where the last
127 -- part of the alignment procedure is completed. This involves asserting
128 -- TXPMASETPHASE for 8192 (TXPLL_DIVSEL_OUT=1), 16384 (TXPLL_DIVSEL_OUT=2),
129 -- or 32768 (TXPLL_DIVSEL_OUT=4) clock cycles. After completion of the phase
130 -- alignment procedure, TXDLYALIGNDISABLE is deasserted.
137 begin_r <= '1' after DLY;
143 begin_r <= '0' after DLY;
165 --______ Counter for holding TXDLYALIGNRESET for 20 TXUSRCLK2 cycles ______
180 --______ Counter for waiting 32 clock cycles before TXPMASETPHASE _________
194 --_______________ Counter for holding SYNC for SYNC_CYCLES ________________
206 fast_simulation:
if(SIM_TXPMASETPHASE_SPEEDUP=1)
generate
207 -- 64 cycles of setphase for simulation
209 end generate fast_simulation;
212 -- 8192 cycles of setphase for output divider of 1
214 end generate no_fast_simulation;
216 --_______________ Assign the phase align ports into the GTX _______________
223 --_______________________ Assign the sync_done port _______________________
out TXDLYALIGNRESETstd_logic
std_logic next_phase_align_c
out TXENPMAPHASEALIGNstd_logic
unsigned (4 downto 0) align_reset_counter_r
out TXPMASETPHASEstd_logic
std_logic count_align_reset_complete_r
std_logic next_wait_before_setphase_c
std_logic count_32_complete_r
SIM_TXPMASETPHASE_SPEEDUPinteger :=0
unsigned (5 downto 0) wait_before_setphase_counter_r
std_logic wait_before_setphase_r
std_logic next_align_reset_c
std_logic count_setphase_complete_r
out TXDLYALIGNDISABLEstd_logic
unsigned (13 downto 0) sync_counter_r