Belle II KLM Scint Firmware  1
global_logic.vhd
1 -- (c) Copyright 2008 Xilinx, Inc. All rights reserved.
2 --
3 -- This file contains confidential and proprietary information
4 -- of Xilinx, Inc. and is protected under U.S. and
5 -- international copyright and other intellectual property
6 -- laws.
7 --
8 -- DISCLAIMER
9 -- This disclaimer is not a license and does not grant any
10 -- rights to the materials distributed herewith. Except as
11 -- otherwise provided in a valid license issued to you by
12 -- Xilinx, and to the maximum extent permitted by applicable
13 -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
14 -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
15 -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
16 -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
17 -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
18 -- (2) Xilinx shall not be liable (whether in contract or tort,
19 -- including negligence, or under any other theory of
20 -- liability) for any loss or damage of any kind or nature
21 -- related to, arising under or in connection with these
22 -- materials, including for any direct, or any indirect,
23 -- special, incidental, or consequential loss or damage
24 -- (including loss of data, profits, goodwill, or any type of
25 -- loss or damage suffered as a result of any action brought
26 -- by a third party) even if such damage or loss was
27 -- reasonably foreseeable or Xilinx had been advised of the
28 -- possibility of the same.
29 --
30 -- CRITICAL APPLICATIONS
31 -- Xilinx products are not designed or intended to be fail-
32 -- safe, or for use in any application requiring fail-safe
33 -- performance, such as life-support or safety devices or
34 -- systems, Class III medical devices, nuclear facilities,
35 -- applications related to the deployment of airbags, or any
36 -- other applications that could lead to death, personal
37 -- injury, or severe property or environmental damage
38 -- (individually and collectively, "Critical
39 -- Applications"). Customer assumes the sole risk and
40 -- liability of any use of Xilinx products in Critical
41 -- Applications, subject only to applicable laws and
42 -- regulations governing limitations on product liability.
43 --
44 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
45 -- PART OF THIS FILE AT ALL TIMES.
46 --
47 --
48 
49 --
50 -- GLOBAL_LOGIC
51 --
52 --
53 --
54 -- Description: The GLOBAL_LOGIC module handles channel bonding, channel
55 -- verification, channel error manangement and idle generation.
56 --
57 -- This module supports 1 2-byte lane designs
58 --
59 
60 library IEEE;
61 use IEEE.STD_LOGIC_1164.all;
62 
63 entity GLOBAL_LOGIC is
64 port(
65  -- GTP Interface
66  EN_CHAN_SYNC : out std_logic;
67  -- Aurora Lane Interface
68  LANE_UP : in std_logic;
69  SOFT_ERR : in std_logic;
70  HARD_ERR : in std_logic;
71  GOT_V : in std_logic;
72  GEN_A : out std_logic;
73  GEN_K : out std_logic_vector(0 to 1);
74  GEN_R : out std_logic_vector(0 to 1);
75  GEN_V : out std_logic_vector(0 to 1);
76  RESET_LANES : out std_logic;
77  -- System Interface
78  USER_CLK : in std_logic;
79  RESET : in std_logic;
80  POWER_DOWN : in std_logic;
81  CHANNEL_UP : out std_logic;
82  START_RX : out std_logic;
83  CHANNEL_SOFT_ERR : out std_logic;
84  CHANNEL_HARD_ERR : out std_logic);
85 end GLOBAL_LOGIC;
86 
87 architecture MAPPED of GLOBAL_LOGIC is
88 
89 -- External Register Declarations --
90 
91  signal EN_CHAN_SYNC_Buffer : std_logic;
92  signal GEN_A_Buffer : std_logic;
93  signal GEN_K_Buffer : std_logic_vector(0 to 1);
94  signal GEN_R_Buffer : std_logic_vector(0 to 1);
95  signal GEN_V_Buffer : std_logic_vector(0 to 1);
96  signal RESET_LANES_Buffer : std_logic;
97  signal CHANNEL_UP_Buffer : std_logic;
98  signal START_RX_Buffer : std_logic;
99  signal CHANNEL_SOFT_ERR_Buffer : std_logic;
100  signal CHANNEL_HARD_ERR_Buffer : std_logic;
101 
102 -- Wire Declarations --
103 
104  signal gen_ver_i : std_logic;
105  signal reset_channel_i : std_logic;
106  signal did_ver_i : std_logic;
107 
108 -- Component Declarations --
109 
110  component CHANNEL_INIT_SM
111 
112  port (
113 
114  -- GTP Interface
115 
116  EN_CHAN_SYNC : out std_logic;
117 
118  -- Aurora Lane Interface
119 
120  GOT_V : in std_logic;
121  RESET_LANES : out std_logic;
122 
123  -- System Interface
124 
125  USER_CLK : in std_logic;
126  RESET : in std_logic;
127  CHANNEL_UP : out std_logic;
128  START_RX : out std_logic;
129 
130  -- Idle and Verification Sequence Generator Interface
131 
132  DID_VER : in std_logic;
133  GEN_VER : out std_logic;
134 
135  -- Channel Init State Machine Interface
136 
137  RESET_CHANNEL : in std_logic
138 
139  );
140 
141  end component;
142 
143 
144  component IDLE_AND_VER_GEN
145 
146  port (
147 
148  -- Channel Init SM Interface
149 
150  GEN_VER : in std_logic;
151  DID_VER : out std_logic;
152 
153  -- Aurora Lane Interface
154 
155  GEN_A : out std_logic;
156  GEN_K : out std_logic_vector(0 to 1);
157  GEN_R : out std_logic_vector(0 to 1);
158  GEN_V : out std_logic_vector(0 to 1);
159 
160  -- System Interface
161 
162  RESET : in std_logic;
163  USER_CLK : in std_logic
164 
165  );
166 
167  end component;
168 
169 
170  component CHANNEL_ERR_DETECT
171 
172  port (
173 
174  -- Aurora Lane Interface
175 
176  SOFT_ERR : in std_logic;
177  HARD_ERR : in std_logic;
178  LANE_UP : in std_logic;
179 
180  -- System Interface
181 
182  USER_CLK : in std_logic;
183  POWER_DOWN : in std_logic;
184 
185  CHANNEL_SOFT_ERR : out std_logic;
186  CHANNEL_HARD_ERR : out std_logic;
187 
188  -- Channel Init SM Interface
189 
190  RESET_CHANNEL : out std_logic
191 
192  );
193 
194  end component;
195 
196 begin
197 
198  EN_CHAN_SYNC <= EN_CHAN_SYNC_Buffer;
199  GEN_A <= GEN_A_Buffer;
200  GEN_K <= GEN_K_Buffer;
201  GEN_R <= GEN_R_Buffer;
202  GEN_V <= GEN_V_Buffer;
203  RESET_LANES <= RESET_LANES_Buffer;
204  CHANNEL_UP <= CHANNEL_UP_Buffer;
205  START_RX <= START_RX_Buffer;
206  CHANNEL_SOFT_ERR <= CHANNEL_SOFT_ERR_Buffer;
207  CHANNEL_HARD_ERR <= CHANNEL_HARD_ERR_Buffer;
208 
209 -- Main Body of Code --
210 
211  -- State Machine for channel bonding and verification.
212 
213  channel_init_sm_i : CHANNEL_INIT_SM
214 
215  port map (
216 
217  -- GTP Interface
218  EN_CHAN_SYNC => EN_CHAN_SYNC_Buffer,
219 
220  -- Aurora Lane Interface
221  GOT_V => GOT_V,
222  RESET_LANES => RESET_LANES_Buffer,
223 
224  -- System Interface
225 
226  USER_CLK => USER_CLK,
227  RESET => RESET,
228  START_RX => START_RX_Buffer,
229  CHANNEL_UP => CHANNEL_UP_Buffer,
230 
231  -- Idle and Verification Sequence Generator Interface
232 
233  DID_VER => did_ver_i,
234  GEN_VER => gen_ver_i,
235 
236  -- Channel Error Management Module Interface
237 
238  RESET_CHANNEL => reset_channel_i
239 
240  );
241 
242 
243  -- Idle and verification sequence generator module.
244 
245  idle_and_ver_gen_i : IDLE_AND_VER_GEN
246 
247  port map (
248 
249  -- Channel Init SM Interface
250 
251  GEN_VER => gen_ver_i,
252  DID_VER => did_ver_i,
253 
254  -- Aurora Lane Interface
255 
256  GEN_A => GEN_A_Buffer,
257  GEN_K => GEN_K_Buffer,
258  GEN_R => GEN_R_Buffer,
259  GEN_V => GEN_V_Buffer,
260 
261  -- System Interface
262 
263  RESET => RESET,
264  USER_CLK => USER_CLK
265 
266  );
267 
268 
269 
270  -- Channel Error Management module.
271 
272  channel_err_detect_i : CHANNEL_ERR_DETECT
273 
274  port map (
275 
276  -- Aurora Lane Interface
277 
278  SOFT_ERR => SOFT_ERR,
279  HARD_ERR => HARD_ERR,
280  LANE_UP => LANE_UP,
281 
282  -- System Interface
283 
284  USER_CLK => USER_CLK,
285  POWER_DOWN => POWER_DOWN,
286  CHANNEL_SOFT_ERR => CHANNEL_SOFT_ERR_Buffer,
287  CHANNEL_HARD_ERR => CHANNEL_HARD_ERR_Buffer,
288 
289  -- Channel Init State Machine Interface
290 
291  RESET_CHANNEL => reset_channel_i
292 
293  );
294 
295 end MAPPED;