AMC13
Firmwares for the different applications of the AMC13 uTCA board made at Boston University
 All Classes Variables
amc_gtx5gpd_common.vhd
1 ---------------------------------------------------------------------------------------------------
2 -- ____ ____
3 -- / /\/ /
4 -- /___/ \ / Vendor: Xilinx
5 -- \ \ \/ Version : 3.6
6 -- \ \ Application : 7 Series FPGAs Transceivers Wizard
7 -- / / Filename : amc_gtx5gpd_common.vhd
8 -- /___/ /\
9 -- \ \ / \
10 -- \___\/\___\
11 --
12 --
13 -- Module amc_gtx5Gpd_common
14 -- Generated by Xilinx 7 Series FPGAs Transceivers Wizard
15 --
16 --
17 -- (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved.
18 --
19 -- This file contains confidential and proprietary information
20 -- of Xilinx, Inc. and is protected under U.S. and
21 -- international copyright and other intellectual property
22 -- laws.
23 --
24 -- DISCLAIMER
25 -- This disclaimer is not a license and does not grant any
26 -- rights to the materials distributed herewith. Except as
27 -- otherwise provided in a valid license issued to you by
28 -- Xilinx, and to the maximum extent permitted by applicable
29 -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
30 -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
31 -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
32 -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
33 -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
34 -- (2) Xilinx shall not be liable (whether in contract or tort,
35 -- including negligence, or under any other theory of
36 -- liability) for any loss or damage of any kind or nature
37 -- related to, arising under or in connection with these
38 -- materials, including for any direct, or any indirect,
39 -- special, incidental, or consequential loss or damage
40 -- (including loss of data, profits, goodwill, or any type of
41 -- loss or damage suffered as a result of any action brought
42 -- by a third party) even if such damage or loss was
43 -- reasonably foreseeable or Xilinx had been advised of the
44 -- possibility of the same.
45 --
46 -- CRITICAL APPLICATIONS
47 -- Xilinx products are not designed or intended to be fail-
48 -- safe, or for use in any application requiring fail-safe
49 -- performance, such as life-support or safety devices or
50 -- systems, Class III medical devices, nuclear facilities,
51 -- applications related to the deployment of airbags, or any
52 -- other applications that could lead to death, personal
53 -- injury, or severe property or environmental damage
54 -- (individually and collectively, "Critical
55 -- Applications"). Customer assumes the sole risk and
56 -- liability of any use of Xilinx products in Critical
57 -- Applications, subject only to applicable laws and
58 -- regulations governing limitations on product liability.
59 --
60 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
61 -- PART OF THIS FILE AT ALL TIMES.
62 
63 
64 library ieee;
65 use ieee.std_logic_1164.all;
66 use ieee.numeric_std.all;
67 library UNISIM;
68 use UNISIM.VCOMPONENTS.ALL;
69 
70 
71 --***************************** Entity Declaration ****************************
73 generic
74 (
75  -- Simulation attributes
76  WRAPPER_SIM_GTRESET_SPEEDUP : string := "TRUE"; -- Set to "true" to speed up sim reset
77  SIM_QPLLREFCLK_SEL : bit_vector := "001"
78 );
79 port
80 (
81  QPLLREFCLKSEL_IN : in std_logic_vector(2 downto 0);
82  GTREFCLK1_IN : in std_logic;
83  GTREFCLK0_IN : in std_logic;
84  QPLLLOCK_OUT : out std_logic;
85  QPLLLOCKDETCLK_IN : in std_logic;
86  QPLLOUTCLK_OUT : out std_logic;
87  QPLLOUTREFCLK_OUT : out std_logic;
88  QPLLREFCLKLOST_OUT : out std_logic;
89  QPLLRESET_IN : in std_logic
90 );
91 
92 end amc_gtx5Gpd_common;
93 
94 architecture RTL of amc_gtx5Gpd_common is
95 
96  attribute CORE_GENERATION_INFO : string;
97  attribute CORE_GENERATION_INFO of RTL : architecture is "amc_gtx5Gpd_common,gtwizard_v3_6_1,{protocol_file=Start_from_scratch}";
98 
99 
100 
101 --***********************************Parameter Declarations********************
102 
103  constant DLY : time := 1 ns;
104 
105 --*************************Logic to set Attribute QPLL_FB_DIV*****************************
106  impure function conv_qpll_fbdiv_top (qpllfbdiv_top : in integer) return bit_vector is
107  begin
108  if (qpllfbdiv_top = 16) then
109  return "0000100000";
110  elsif (qpllfbdiv_top = 20) then
111  return "0000110000" ;
112  elsif (qpllfbdiv_top = 32) then
113  return "0001100000" ;
114  elsif (qpllfbdiv_top = 40) then
115  return "0010000000" ;
116  elsif (qpllfbdiv_top = 64) then
117  return "0011100000" ;
118  elsif (qpllfbdiv_top = 66) then
119  return "0101000000" ;
120  elsif (qpllfbdiv_top = 80) then
121  return "0100100000" ;
122  elsif (qpllfbdiv_top = 100) then
123  return "0101110000" ;
124  else
125  return "0000000000" ;
126  end if;
127  end function;
128 
129  impure function conv_qpll_fbdiv_ratio (qpllfbdiv_top : in integer) return bit is
130  begin
131  if (qpllfbdiv_top = 16) then
132  return '1';
133  elsif (qpllfbdiv_top = 20) then
134  return '1' ;
135  elsif (qpllfbdiv_top = 32) then
136  return '1' ;
137  elsif (qpllfbdiv_top = 40) then
138  return '1' ;
139  elsif (qpllfbdiv_top = 64) then
140  return '1' ;
141  elsif (qpllfbdiv_top = 66) then
142  return '0' ;
143  elsif (qpllfbdiv_top = 80) then
144  return '1' ;
145  elsif (qpllfbdiv_top = 100) then
146  return '1' ;
147  else
148  return '1' ;
149  end if;
150  end function;
151 
152  constant QPLL_FBDIV_TOP : integer := 40;
153  constant QPLL_FBDIV_IN : bit_vector(9 downto 0) := conv_qpll_fbdiv_top(QPLL_FBDIV_TOP);
154  constant QPLL_FBDIV_RATIO : bit := conv_qpll_fbdiv_ratio(QPLL_FBDIV_TOP);
155 
156  -- ground and tied_to_vcc_i signals
157  signal tied_to_ground_i : std_logic;
158  signal tied_to_ground_vec_i : std_logic_vector(63 downto 0);
159  signal tied_to_vcc_i : std_logic;
160  signal tied_to_vcc_vec_i : std_logic_vector(63 downto 0);
161 
162 begin
163  tied_to_ground_i <= '0';
164  tied_to_ground_vec_i(63 downto 0) <= (others => '0');
165  tied_to_vcc_i <= '1';
166  tied_to_vcc_vec_i(63 downto 0) <= (others => '1');
167 
168  --_________________________________________________________________________
169  --_________________________________________________________________________
170  --_________________________GTXE2_COMMON____________________________________
171 
172  gtxe2_common_i : GTXE2_COMMON
173  generic map
174  (
175  -- Simulation attributes
176  SIM_RESET_SPEEDUP => WRAPPER_SIM_GTRESET_SPEEDUP ,
177  SIM_QPLLREFCLK_SEL => (SIM_QPLLREFCLK_SEL),
178  SIM_VERSION => "4.0",
179 
180 
181  ------------------COMMON BLOCK Attributes---------------
182  BIAS_CFG => (x"0000040000001000"),
183  COMMON_CFG => (x"00000000"),
184  QPLL_CFG => (x"0680181"),
185  QPLL_CLKOUT_CFG => ("0000"),
186  QPLL_COARSE_FREQ_OVRD => ("010000"),
187  QPLL_COARSE_FREQ_OVRD_EN => ('0'),
188  QPLL_CP => ("0000011111"),
189  QPLL_CP_MONITOR_EN => ('0'),
190  QPLL_DMONITOR_SEL => ('0'),
191  QPLL_FBDIV => (QPLL_FBDIV_IN),
192  QPLL_FBDIV_MONITOR_EN => ('0'),
193  QPLL_FBDIV_RATIO => (QPLL_FBDIV_RATIO),
194  QPLL_INIT_CFG => (x"000006"),
195  QPLL_LOCK_CFG => (x"21E8"),
196  QPLL_LPF => ("1111"),
197  QPLL_REFCLK_DIV => (1)
198 
199 
200  )
201  port map
202  (
203  ------------- Common Block - Dynamic Reconfiguration Port (DRP) -----------
204  DRPADDR => tied_to_ground_vec_i (7 downto 0),
205  DRPCLK => tied_to_ground_i,
206  DRPDI => tied_to_ground_vec_i (15 downto 0),
207  DRPDO => open,
208  DRPEN => tied_to_ground_i,
209  DRPRDY => open,
210  DRPWE => tied_to_ground_i,
211  ---------------------- Common Block - Ref Clock Ports ---------------------
212  GTGREFCLK => tied_to_ground_i,
213  GTNORTHREFCLK0 => tied_to_ground_i,
214  GTNORTHREFCLK1 => tied_to_ground_i,
215  GTREFCLK0 => GTREFCLK0_IN,
216  GTREFCLK1 => GTREFCLK1_IN,
217  GTSOUTHREFCLK0 => tied_to_ground_i,
218  GTSOUTHREFCLK1 => tied_to_ground_i,
219  ------------------------- Common Block - QPLL Ports -----------------------
220  QPLLDMONITOR => open,
221  ----------------------- Common Block - Clocking Ports ----------------------
222  QPLLOUTCLK => QPLLOUTCLK_OUT,
223  QPLLOUTREFCLK => QPLLOUTREFCLK_OUT,
224  REFCLKOUTMONITOR => open,
225  ------------------------- Common Block - QPLL Ports ------------------------
226  QPLLFBCLKLOST => open,
227  QPLLLOCK => QPLLLOCK_OUT,
228  QPLLLOCKDETCLK => QPLLLOCKDETCLK_IN,
229  QPLLLOCKEN => tied_to_vcc_i,
230  QPLLOUTRESET => tied_to_ground_i,
231  QPLLPD => tied_to_ground_i,
232  QPLLREFCLKLOST => QPLLREFCLKLOST_OUT,
233  QPLLREFCLKSEL => QPLLREFCLKSEL_IN,
234  QPLLRESET => QPLLRESET_IN,
235  QPLLRSVD1 => "0000000000000000",
236  QPLLRSVD2 => "11111",
237  --------------------------------- QPLL Ports -------------------------------
238  BGBYPASSB => tied_to_vcc_i,
239  BGMONITORENB => tied_to_vcc_i,
240  BGPDB => tied_to_vcc_i,
241  BGRCALOVRD => "11111",
242  PMARSVD => "00000000",
243  RCALENB => tied_to_vcc_i
244 
245  );
246 
247 end RTL;