SURF  1.0
TenGigEthRst.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : TenGigEthRst.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2015-03-30
5 -- Last update: 2015-10-20
6 -------------------------------------------------------------------------------
7 -- Description: 10GbE Reset Module
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 -------------------------------------------------------------------------------
17 
18 library ieee;
19 use ieee.std_logic_1164.all;
20 use ieee.std_logic_unsigned.all;
21 use ieee.std_logic_arith.all;
22 
23 use work.StdRtlPkg.all;
24 
25 library unisim;
26 use unisim.vcomponents.all;
27 
28 --! @see entity
29  --! @ingroup ethernet_TenGigEthCore_core
30 entity TenGigEthRst is
31  generic (
32  TPD_G : time := 1 ns);
33  port (
34  -- Clocks and Resets
35  extRst : in sl; -- async reset
36  gtPowerGood : in sl := '1';
37  phyClk : in sl;
38  phyRst : in sl;
39  txClk322 : in sl;
40  txUsrClk : out sl;
41  txUsrClk2 : out sl;
42  gtTxRst : out sl;
43  gtRxRst : out sl;
44  txUsrRdy : out sl;
45  rstCntDone : out sl;
46  -- Quad PLL Ports
47  qplllock : in sl;
48  qpllRst : out sl);
49 end TenGigEthRst;
50 
51 architecture rtl of TenGigEthRst is
52 
53  signal txClock : sl;
54  signal txReset : sl;
55  signal txReady : sl;
56 
57  signal rstCnt : slv(8 downto 0) := "000000000";
58  signal rstPulse : slv(3 downto 0) := "1110";
59 
60 begin
61 
62  txUsrClk <= txClock;
63  txUsrClk2 <= txClock;
64 
65  rstCntDone <= rstCnt(8);
66  gtTxRst <= rstPulse(0);
67  gtRxRst <= rstPulse(0);
68  qpllRst <= rstPulse(0) and not(gtPowerGood);
69 
70  CLK312_BUFG : BUFG
71  port map (
72  I => txClk322,
73  O => txClock);
74 
75  Synchronizer_1 : entity work.Synchronizer
76  generic map(
77  TPD_G => TPD_G,
78  RST_ASYNC_G => true,
79  RST_POLARITY_G => '0',
80  STAGES_G => 5,
81  INIT_G => "00000")
82  port map (
83  clk => txClock,
84  rst => qPllLock,
85  dataIn => '1',
86  dataOut => txReady);
87 
88  Synchronizer_2 : entity work.Synchronizer
89  generic map(
90  TPD_G => TPD_G,
91  RST_ASYNC_G => true,
92  RST_POLARITY_G => '1',
93  STAGES_G => 5,
94  INIT_G => "11111")
95  port map (
96  clk => txClock,
97  rst => rstPulse(0),
98  dataIn => '0',
99  dataOut => txReset);
100 
101  process(phyClk)
102  begin
103  if rising_edge(phyClk) then
104  -- Hold off release the GT resets until 500ns after configuration.
105  -- 256 ticks at the minimum possible 2.56ns period (390MHz) will be >> 500 ns.
106  if rstCnt(8) = '0' then
107  rstCnt <= rstCnt + 1 after TPD_G;
108  else
109  rstCnt <= rstCnt after TPD_G;
110  end if;
111  -- Check for reset
112  if phyRst = '1' then
113  rstPulse <= "1110" after TPD_G;
114  elsif rstCnt(8) = '1' then
115  rstPulse(3) <= '0' after TPD_G;
116  rstPulse(2 downto 0) <= rstPulse(3 downto 1) after TPD_G;
117  end if;
118  end if;
119  end process;
120 
121  process(txClock)
122  begin
123  if rising_edge(txClock) then
124  if txReset = '1' then
125  txUsrRdy <= '0' after TPD_G;
126  else
127  txUsrRdy <= txReady after TPD_G;
128  end if;
129  end if;
130  end process;
131 
132 end rtl;
INIT_Gslv := "0"
_library_ ieeeieee
out rstCntDonesl
std_logic sl
Definition: StdRtlPkg.vhd:28
in rstsl :=not RST_POLARITY_G
out txUsrClksl
STAGES_Gpositive := 2
RST_POLARITY_Gsl := '1'
out gtRxRstsl
out txUsrRdysl
out dataOutsl
TPD_Gtime := 1 ns
in gtPowerGoodsl := '1'
out gtTxRstsl
out qpllRstsl
TPD_Gtime := 1 ns
RST_ASYNC_Gboolean := false
out txUsrClk2sl
std_logic_vector slv
Definition: StdRtlPkg.vhd:29