1 ------------------------------------------------------------------------------- 2 -- File : Gtx7CfgPkg.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-09-02 5 -- Last update: 2015-01-08 6 ------------------------------------------------------------------------------- 7 -- Description: Provides useful functions for generating GTX7 configurations. 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 ------------------------------------------------------------------------------- 20 use IEEE.STD_LOGIC_1164.
all;
21 use IEEE.STD_LOGIC_UNSIGNED.
all;
22 use IEEE.STD_LOGIC_ARITH.
all;
29 --! @ingroup xilinx_7Series_gtx7 34 ------------------------------------------------------------------------------------------------- 35 -- CPLL Config Types, Constants and Function declarations 36 ------------------------------------------------------------------------------------------------- 55 ------------------------------------------------------------------------------------------------- 57 ------------------------------------------------------------------------------------------------- 83 ------------------------------------------------------------------------------------------------- 85 ------------------------------------------------------------------------------------------------- 103 end package Gtx7CfgPkg;
107 ------------------------------------------------------------------------------------------------- 109 ------------------------------------------------------------------------------------------------- 121 -- Walk through all possible configs and look for one that works 141 -- report "Found GTX config: " & lf & 142 -- "refClkFreq: " & real'image(refClkFreq) & lf & 143 -- "lineRate: " & real'image(lineRate) & lf & 144 -- "CPLL_REFCLK_DIV_G: " & integer'image(ret.CPLL_REFCLK_DIV_G) & lf & 145 -- "CPLL_FBDIV_G: " & integer'image(ret.CPLL_FBDIV_G) & lf & 146 -- "CPLL_FBDIV_45_G: " & integer'image(ret.CPLL_FBDIV_45_G) & lf & 147 -- "OUT_DIV_G: " & integer'image(ret.RXOUT_DIV_G) & lf 157 assert (found
) report "getGtx7CPllCfg: no feasible configuration found for refClkFreq: " &
158 '
image(refClkFreq
) &
" and lineRate: " & '
image(lineRate
) severity failure;
163 ------------------------------------------------------------------------------------------------- 165 ------------------------------------------------------------------------------------------------- 167 variable ret :
(9 downto 0) :=
(others => '
0'
);
170 when 16 => ret :=
"0000100000";
171 when 20 => ret :=
"0000110000";
172 when 32 => ret :=
"0001100000";
173 when 40 => ret :=
"0010000000";
174 when 64 => ret :=
"0011100000";
175 when 66 => ret :=
"0101000000";
176 when 80 => ret :=
"0100100000";
177 when 100 => ret :=
"0101110000";
178 when others => ret :=
"0000000000";
--Added others ulegat 181 end function getQPllFbdiv;
195 -- Walk through all possible configs and look for one that works 202 pllClk := vcoClk /
2.
0;
207 -- "M: " & integer'image(QPLL_REFCLK_DIV_VALIDS_C(m)) & lf & 208 -- "N: " & integer'image(QPLL_FBDIV_INT_VALIDS_C(n)) & lf & 209 -- "D: " & integer'image(QPLL_OUT_DIV_VALIDS_C(d)) & lf & 210 -- "vcoClk: " & real'image(vcoClk) & lf & 211 -- "pllClk: " & real'image(pllClk) & lf & 212 -- "rate: " & real'image(rate) & lf 215 if ( rate = lineRate
) then 234 -- report "FOUND!!!" severity note; 242 assert (found
) report "getGtx7QPllCfg: no feasible configuration found for refClkFreq: " &
243 '
image(refClkFreq
) &
" and lineRate: " & '
image(lineRate
) severity failure;
248 ------------------------------------------------------------------------------------------------- 250 ------------------------------------------------------------------------------------------------- 263 if (txPll =
"CPLL") then 266 elsif (txPll =
"QPLL") then 270 assert (false
) report "Gtx7CfgPkg: getGtx7Cfg: Illegal TX PLL type: " & txPll
severity failure;
273 if (rxPll =
"CPLL") then 276 elsif (rxPll =
"QPLL") then 280 assert (false
) report "Gtx7CfgPkg: getGtx7Cfg: Illegal RX PLL type: " & rxPll
severity failure;
284 end function getGtx7Cfg;
287 end package body Gtx7CfgPkg;
real := 3.3E9 CPLL_HIGH_C
IntegerArray :=( 1, 2, 3, 4) QPLL_REFCLK_DIV_VALIDS_C
integer QPLL_REFCLK_DIV_G
IntegerArray :=( 1, 2, 4, 8, 16) QPLL_OUT_DIV_VALIDS_C
real := 8.0E9 QPLL_LOWER_BAND_HIGH_C
real := 12.5E9 QPLL_UPPER_BAND_HIGH_C
IntegerArray :=( 1, 2) CPLL_REFCLK_DIV_VALIDS_C
bit_vector := x"0680181" QPLL_CFG_VCO_UPPER_C
IntegerArray :=( 4, 5) CPLL_FBDIV_45_VALIDS_C
real := 5.93E9 QPLL_LOWER_BAND_LOW_C
bit_vector( 9 downto 0) QPLL_FBDIV_G
IntegerArray :=( 1, 2, 4, 8) CPLL_OUT_DIV_VALIDS_C
Gtx7CfgType getGtx7CfgtxPll,rxPll,cPllCfg,qPllCfg,
bit_vector getQPllFbdivfbdivInt,
integer CPLL_REFCLK_DIV_G
Gtx7CPllCfgType getGtx7CPllCfgrefClkFreq,lineRate,
Gtx7QPllCfgType getGtx7QPllCfgrefClkFreq,lineRate,
IntegerArray :=( 1, 2, 3, 4, 5) CPLL_FBDIV_VALIDS_C
bit_vector := x"06801C1" QPLL_CFG_VCO_LOWER_C
IntegerArray :=( 16, 20, 32, 40, 64, 66, 80, 100) QPLL_FBDIV_INT_VALIDS_C
array(natural range <> ) of integer IntegerArray
real := 9.8E9 QPLL_UPPER_BAND_LOW_C
bit_vector( 27 downto 0) QPLL_CFG_G