1 |
4 |
DFC |
--////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
--// ____ ____
|
3 |
|
|
--// / /\/ /
|
4 |
|
|
--// /___/ \ / Vendor: Xilinx
|
5 |
|
|
--// \ \ \/ Version : 3.5
|
6 |
|
|
--// \ \ Application : 7 Series FPGAs Transceivers Wizard
|
7 |
|
|
--// / / Filename : rxaui_0_tx_sync_sync_pulse.vhd
|
8 |
|
|
--// /___/ /\
|
9 |
|
|
--// \ \ / \
|
10 |
|
|
--// \___\/\___\
|
11 |
|
|
--//
|
12 |
|
|
--//
|
13 |
|
|
--
|
14 |
|
|
-- Description: Used on signals crossing from faster clock domain
|
15 |
|
|
--
|
16 |
|
|
--
|
17 |
|
|
-- Module rxaui_0_tx_sync_sync_pulse
|
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 |
|
|
library IEEE;
|
67 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
68 |
|
|
use IEEE.NUMERIC_STD.ALL;
|
69 |
|
|
|
70 |
|
|
entity rxaui_0_tx_sync_sync_pulse is
|
71 |
|
|
Generic(
|
72 |
|
|
C_NUM_SRETCH_REGS : integer := 3;
|
73 |
|
|
C_NUM_SYNC_REGS : integer := 3
|
74 |
|
|
);
|
75 |
|
|
|
76 |
|
|
Port (
|
77 |
|
|
-- Clock and Reset
|
78 |
|
|
CLK : in STD_LOGIC;
|
79 |
|
|
-- User Interface
|
80 |
|
|
USER_DONE : out STD_LOGIC := '0';
|
81 |
|
|
-- GT Interface
|
82 |
|
|
GT_DONE : in STD_LOGIC
|
83 |
|
|
|
84 |
|
|
);
|
85 |
|
|
end rxaui_0_tx_sync_sync_pulse;
|
86 |
|
|
|
87 |
|
|
architecture RTL of rxaui_0_tx_sync_sync_pulse is
|
88 |
|
|
|
89 |
|
|
-- ---------------------------------------------------------------------------
|
90 |
|
|
-- Wire and Register Declaration
|
91 |
|
|
-- ---------------------------------------------------------------------------
|
92 |
|
|
signal stretch_r : std_logic_vector (C_NUM_SRETCH_REGS-1 downto 0):= (others=>'0');
|
93 |
|
|
signal sync1_r : std_logic_vector (C_NUM_SYNC_REGS-1 downto 0):= (others=>'0');
|
94 |
|
|
signal sync2_r : std_logic_vector (C_NUM_SYNC_REGS-1 downto 0):= (others=>'0');
|
95 |
|
|
|
96 |
|
|
-- These attributes will stop Vivado translating the desired flip-flops into an
|
97 |
|
|
-- SRL based shift register.
|
98 |
|
|
attribute ASYNC_REG : string;
|
99 |
|
|
attribute ASYNC_REG of sync1_r : signal is "TRUE";
|
100 |
|
|
attribute ASYNC_REG of sync2_r : signal is "TRUE";
|
101 |
|
|
|
102 |
|
|
-- These attributes will stop XST translating the desired flip-flops into an
|
103 |
|
|
-- SRL based shift register.
|
104 |
|
|
attribute shreg_extract : string;
|
105 |
|
|
attribute shreg_extract of sync1_r : signal is "no";
|
106 |
|
|
attribute shreg_extract of sync2_r : signal is "no";
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
begin
|
110 |
|
|
------------------------------------------------------------------------------
|
111 |
|
|
-- Stretch GT_DONE Signal
|
112 |
|
|
------------------------------------------------------------------------------
|
113 |
|
|
process (CLK,GT_DONE)
|
114 |
|
|
begin
|
115 |
|
|
if (GT_DONE = '0') then
|
116 |
|
|
stretch_r <= (others=>'0');
|
117 |
|
|
elsif (CLK'event and CLK = '1') then
|
118 |
|
|
stretch_r <= ('1' & stretch_r(C_NUM_SRETCH_REGS-1 downto 1));
|
119 |
|
|
end if;
|
120 |
|
|
end process;
|
121 |
|
|
|
122 |
|
|
------------------------------------------------------------------------------
|
123 |
|
|
-- Synchronizers
|
124 |
|
|
------------------------------------------------------------------------------
|
125 |
|
|
process (CLK)
|
126 |
|
|
begin
|
127 |
|
|
if (CLK'event and CLK = '1') then
|
128 |
|
|
sync1_r <= (stretch_r(0) & sync1_r(C_NUM_SYNC_REGS-1 downto 1));
|
129 |
|
|
end if;
|
130 |
|
|
end process;
|
131 |
|
|
|
132 |
|
|
process (CLK)
|
133 |
|
|
begin
|
134 |
|
|
if (CLK'event and CLK = '1') then
|
135 |
|
|
sync2_r <= (GT_DONE & sync2_r(C_NUM_SYNC_REGS-1 downto 1));
|
136 |
|
|
end if;
|
137 |
|
|
end process;
|
138 |
|
|
|
139 |
|
|
------------------------------------------------------------------------------
|
140 |
|
|
-- Final Flop Stage with AND of both synchronizers - keeps USER_DONE low
|
141 |
|
|
-- when input is low for many cycles...
|
142 |
|
|
------------------------------------------------------------------------------
|
143 |
|
|
process (CLK)
|
144 |
|
|
begin
|
145 |
|
|
if (CLK'event and CLK = '1') then
|
146 |
|
|
USER_DONE <= sync1_r(0) and sync2_r(0);
|
147 |
|
|
end if;
|
148 |
|
|
end process;
|
149 |
|
|
|
150 |
|
|
end RTL;
|
151 |
|
|
|
152 |
|
|
|