25 use IEEE.STD_LOGIC_1164.
ALL;
27 use work.ipbus_decode_L1CaloHubRodTobProc.
all;
42 CRC20_G_Poly : std_logic_vector(19 downto 0) := x"8349f";
43 timeout_1_default : std_logic_vector(15 downto 0) := x"0600";
44 timeout_n_default : std_logic_vector(15 downto 0) := x"0030";
45 wdog_thresh_default : std_logic_vector(15 downto 0) := x"2000";
48 C_S_AXI_DATA_WIDTH : integer := 32;
50 C_S_AXI_ADDR_WIDTH : integer := 9;
53 bp_width : integer := 64;
56 header_width : integer := 64;
59 event_width : integer := 64
63 ipb_clk: in std_logic;
64 ipb_rst: in std_logic;
66 ipb_out: out ipb_rbus;
68 geo_location : in STD_LOGIC_VECTOR (7 downto 0);
69 event_sel : in STD_LOGIC_VECTOR (1 downto 0);
70 rod_slot : in std_logic;
72 full_mode_ctrl : out STD_LOGIC_VECTOR (31 downto 0);
73 full_mode_stat : in STD_LOGIC_VECTOR (31 downto 0);
74 FM_L1id_stat : in std_logic_vector(31 downto 0);
75 stage_fifo_level : in std_logic_vector (15 downto 0);
77 stage_fifo_busy : out STD_LOGIC;
78 stage_fifo_xoff : out STD_LOGIC;
79 stage_fifo_full : in STD_LOGIC;
81 flx_backpressure : in STD_LOGIC_vector (11 downto 0);
82 flx_backpressure_tob : out STD_LOGIC;
85 pp_clock : in STD_LOGIC;
86 rt_clk : in std_logic;
88 system_reset : in STD_LOGIC;
89 proc_reset : in STD_LOGIC;
90 wdog_fifo_reset : out STD_LOGIC;
91 first_chan : in STD_LOGIC_VECTOR (4 downto 0);
92 last_chan : in STD_LOGIC_VECTOR (4 downto 0);
93 TTC_ignore : in STD_LOGIC;
95 master_header : in STD_LOGIC_VECTOR (63 downto 0);
96 header_fifo_valid : in STD_LOGIC;
97 header_read_en : out std_logic;
98 header_sequence : in STD_LOGIC_VECTOR (11 downto 0);
99 header_type : in STD_LOGIC_VECTOR (3 downto 0);
100 timeout_err_out : out std_logic;
104 m_tvalid : out STD_LOGIC;
105 m_tlast : out STD_LOGIC;
106 m_tdata : out STD_LOGIC_VECTOR (bp_width-1 downto 0);
107 m_header_marker : out STD_LOGIC;
108 m_tail_marker : out STD_LOGIC;
109 m_tready : in STD_LOGIC;
110 ttc_rollover : out std_logic;
112 l1id_mis_stretch : out std_logic;
114 s_tdata_0 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
115 s_tvalid_0 : in STD_LOGIC;
116 s_tlast_0 : in STD_LOGIC;
117 s_tready_0 : out STD_LOGIC;
118 s_header_mark_0 : in STD_LOGIC;
119 s_trailer_mark_0 : in STD_LOGIC;
120 s_hdr_crc_tag_0 : in STD_LOGIC;
121 s_poll_chan_0 : out STD_LOGIC;
122 s_chan_enable_0 : in STD_LOGIC;
124 s_tdata_1 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
125 s_tvalid_1 : in STD_LOGIC;
126 s_tlast_1 : in STD_LOGIC;
127 s_tready_1 : out STD_LOGIC;
128 s_header_mark_1 : in STD_LOGIC;
129 s_trailer_mark_1 : in STD_LOGIC;
130 s_hdr_crc_tag_1 : in STD_LOGIC;
131 s_poll_chan_1 : out STD_LOGIC;
132 s_chan_enable_1 : in STD_LOGIC;
134 s_tdata_2 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
135 s_tvalid_2 : in STD_LOGIC;
136 s_tlast_2 : in STD_LOGIC;
137 s_tready_2 : out STD_LOGIC;
138 s_header_mark_2 : in STD_LOGIC;
139 s_trailer_mark_2 : in STD_LOGIC;
140 s_hdr_crc_tag_2 : in STD_LOGIC;
141 s_poll_chan_2 : out STD_LOGIC;
142 s_chan_enable_2 : in STD_LOGIC;
144 s_tdata_3 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
145 s_tvalid_3 : in STD_LOGIC;
146 s_tlast_3 : in STD_LOGIC;
147 s_tready_3 : out STD_LOGIC;
148 s_header_mark_3 : in STD_LOGIC;
149 s_trailer_mark_3 : in STD_LOGIC;
150 s_hdr_crc_tag_3 : in STD_LOGIC;
151 s_poll_chan_3 : out STD_LOGIC;
152 s_chan_enable_3 : in STD_LOGIC;
154 s_tdata_4 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
155 s_tvalid_4 : in STD_LOGIC;
156 s_tlast_4 : in STD_LOGIC;
157 s_tready_4 : out STD_LOGIC;
158 s_header_mark_4 : in STD_LOGIC;
159 s_trailer_mark_4 : in STD_LOGIC;
160 s_hdr_crc_tag_4 : in STD_LOGIC;
161 s_poll_chan_4 : out STD_LOGIC;
162 s_chan_enable_4 : in STD_LOGIC;
164 s_tdata_5 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
165 s_tvalid_5 : in STD_LOGIC;
166 s_tlast_5 : in STD_LOGIC;
167 s_tready_5 : out STD_LOGIC;
168 s_header_mark_5 : in STD_LOGIC;
169 s_trailer_mark_5 : in STD_LOGIC;
170 s_hdr_crc_tag_5 : in STD_LOGIC;
171 s_poll_chan_5 : out STD_LOGIC;
172 s_chan_enable_5 : in STD_LOGIC;
174 s_tdata_6 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
175 s_tvalid_6 : in STD_LOGIC;
176 s_tlast_6 : in STD_LOGIC;
177 s_tready_6 : out STD_LOGIC;
178 s_header_mark_6 : in STD_LOGIC;
179 s_trailer_mark_6 : in STD_LOGIC;
180 s_hdr_crc_tag_6 : in STD_LOGIC;
181 s_poll_chan_6 : out STD_LOGIC;
182 s_chan_enable_6 : in STD_LOGIC;
184 s_tdata_7 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
185 s_tvalid_7 : in STD_LOGIC;
186 s_tlast_7 : in STD_LOGIC;
187 s_tready_7 : out STD_LOGIC;
188 s_header_mark_7 : in STD_LOGIC;
189 s_trailer_mark_7 : in STD_LOGIC;
190 s_hdr_crc_tag_7 : in STD_LOGIC;
191 s_poll_chan_7 : out STD_LOGIC;
192 s_chan_enable_7 : in STD_LOGIC;
194 s_tdata_8 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
195 s_tvalid_8 : in STD_LOGIC;
196 s_tlast_8 : in STD_LOGIC;
197 s_tready_8 : out STD_LOGIC;
198 s_header_mark_8 : in STD_LOGIC;
199 s_trailer_mark_8 : in STD_LOGIC;
200 s_hdr_crc_tag_8 : in STD_LOGIC;
201 s_poll_chan_8 : out STD_LOGIC;
202 s_chan_enable_8 : in STD_LOGIC;
204 s_tdata_9 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
205 s_tvalid_9 : in STD_LOGIC;
206 s_tlast_9 : in STD_LOGIC;
207 s_tready_9 : out STD_LOGIC;
208 s_header_mark_9 : in STD_LOGIC;
209 s_trailer_mark_9 : in STD_LOGIC;
210 s_hdr_crc_tag_9 : in STD_LOGIC;
211 s_poll_chan_9 : out STD_LOGIC;
212 s_chan_enable_9 : in STD_LOGIC;
214 s_tdata_10 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
215 s_tvalid_10 : in STD_LOGIC;
216 s_tlast_10 : in STD_LOGIC;
217 s_tready_10 : out STD_LOGIC;
218 s_header_mark_10 : in STD_LOGIC;
219 s_trailer_mark_10 : in STD_LOGIC;
220 s_hdr_crc_tag_10 : in STD_LOGIC;
221 s_poll_chan_10 : out STD_LOGIC;
222 s_chan_enable_10 : in STD_LOGIC;
228 s_tdata_11 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
229 s_tvalid_11 : in STD_LOGIC;
230 s_tlast_11 : in STD_LOGIC;
231 s_tready_11 : out STD_LOGIC;
232 s_header_mark_11 : in STD_LOGIC;
233 s_trailer_mark_11 : in STD_LOGIC;
234 s_hdr_crc_tag_11 : in STD_LOGIC;
235 s_poll_chan_11 : out STD_LOGIC;
236 s_chan_enable_11 : in STD_LOGIC;
240 s_tdata_12 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
241 s_tvalid_12 : in STD_LOGIC;
242 s_tlast_12 : in STD_LOGIC;
243 s_tready_12 : out STD_LOGIC;
244 s_header_mark_12 : in STD_LOGIC;
245 s_trailer_mark_12 : in STD_LOGIC;
246 s_hdr_crc_tag_12 : in STD_LOGIC;
247 s_poll_chan_12 : out STD_LOGIC;
248 s_chan_enable_12 : in STD_LOGIC;
250 s_tdata_13 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
251 s_tvalid_13 : in STD_LOGIC;
252 s_tlast_13 : in STD_LOGIC;
253 s_tready_13 : out STD_LOGIC;
254 s_header_mark_13 : in STD_LOGIC;
255 s_trailer_mark_13 : in STD_LOGIC;
256 s_hdr_crc_tag_13 : in STD_LOGIC;
257 s_poll_chan_13 : out STD_LOGIC;
258 s_chan_enable_13 : in STD_LOGIC;
261 s_tdata_14 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
262 s_tvalid_14 : in STD_LOGIC;
263 s_tlast_14 : in STD_LOGIC;
264 s_tready_14 : out STD_LOGIC;
265 s_header_mark_14 : in STD_LOGIC;
266 s_trailer_mark_14 : in STD_LOGIC;
267 s_hdr_crc_tag_14 : in STD_LOGIC;
268 s_poll_chan_14 : out STD_LOGIC;
269 s_chan_enable_14 : in STD_LOGIC;
272 s_tdata_15 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
273 s_tvalid_15 : in STD_LOGIC;
274 s_tlast_15 : in STD_LOGIC;
275 s_tready_15 : out STD_LOGIC;
276 s_header_mark_15 : in STD_LOGIC;
277 s_trailer_mark_15 : in STD_LOGIC;
278 s_hdr_crc_tag_15 : in STD_LOGIC;
279 s_poll_chan_15 : out STD_LOGIC;
280 s_chan_enable_15 : in STD_LOGIC;
282 s_tdata_16 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
283 s_tvalid_16 : in STD_LOGIC;
284 s_tlast_16 : in STD_LOGIC;
285 s_tready_16 : out STD_LOGIC;
286 s_header_mark_16 : in STD_LOGIC;
287 s_trailer_mark_16 : in STD_LOGIC;
288 s_hdr_crc_tag_16 : in STD_LOGIC;
289 s_poll_chan_16 : out STD_LOGIC;
290 s_chan_enable_16 : in STD_LOGIC;
292 s_tdata_17 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
293 s_tvalid_17 : in STD_LOGIC;
294 s_tlast_17 : in STD_LOGIC;
295 s_tready_17 : out STD_LOGIC;
296 s_header_mark_17 : in STD_LOGIC;
297 s_trailer_mark_17 : in STD_LOGIC;
298 s_hdr_crc_tag_17 : in STD_LOGIC;
299 s_poll_chan_17 : out STD_LOGIC;
300 s_chan_enable_17 : in STD_LOGIC;
302 s_tdata_18 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
303 s_tvalid_18 : in STD_LOGIC;
304 s_tlast_18 : in STD_LOGIC;
305 s_tready_18 : out STD_LOGIC;
306 s_header_mark_18 : in STD_LOGIC;
307 s_trailer_mark_18 : in STD_LOGIC;
308 s_hdr_crc_tag_18 : in STD_LOGIC;
309 s_poll_chan_18 : out STD_LOGIC;
310 s_chan_enable_18 : in STD_LOGIC;
312 s_tdata_19 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
313 s_tvalid_19 : in STD_LOGIC;
314 s_tlast_19 : in STD_LOGIC;
315 s_tready_19 : out STD_LOGIC;
316 s_header_mark_19 : in STD_LOGIC;
317 s_trailer_mark_19 : in STD_LOGIC;
318 s_hdr_crc_tag_19 : in STD_LOGIC;
319 s_poll_chan_19 : out STD_LOGIC;
320 s_chan_enable_19 : in STD_LOGIC;
322 s_tdata_20 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
323 s_tvalid_20 : in STD_LOGIC;
324 s_tlast_20 : in STD_LOGIC;
325 s_tready_20 : out STD_LOGIC;
326 s_header_mark_20 : in STD_LOGIC;
327 s_trailer_mark_20 : in STD_LOGIC;
328 s_hdr_crc_tag_20 : in STD_LOGIC;
329 s_poll_chan_20 : out STD_LOGIC;
330 s_chan_enable_20 : in STD_LOGIC;
332 s_tdata_21 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
333 s_tvalid_21 : in STD_LOGIC;
334 s_tlast_21 : in STD_LOGIC;
335 s_tready_21 : out STD_LOGIC;
336 s_header_mark_21 : in STD_LOGIC;
337 s_trailer_mark_21 : in STD_LOGIC;
338 s_hdr_crc_tag_21 : in STD_LOGIC;
339 s_poll_chan_21 : out STD_LOGIC;
340 s_chan_enable_21 : in STD_LOGIC;
342 s_tdata_22 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
343 s_tvalid_22 : in STD_LOGIC;
344 s_tlast_22 : in STD_LOGIC;
345 s_tready_22 : out STD_LOGIC;
346 s_header_mark_22 : in STD_LOGIC;
347 s_trailer_mark_22 : in STD_LOGIC;
348 s_hdr_crc_tag_22 : in STD_LOGIC;
349 s_poll_chan_22 : out STD_LOGIC;
350 s_chan_enable_22 : in STD_LOGIC;
352 s_tdata_23 : in STD_LOGIC_VECTOR (bp_width-1 downto 0);
353 s_tvalid_23 : in STD_LOGIC;
354 s_tlast_23 : in STD_LOGIC;
355 s_tready_23 : out STD_LOGIC;
356 s_header_mark_23 : in STD_LOGIC;
357 s_trailer_mark_23 : in STD_LOGIC;
358 s_hdr_crc_tag_23 : in STD_LOGIC;
359 s_poll_chan_23 : out STD_LOGIC;
360 s_chan_enable_23 : in STD_LOGIC
372 Port (clock :
in STD_LOGIC;
373 reset :
in STD_LOGIC;
374 chan_pointer_reset :
in STD_LOGIC;
375 s_tdata_0 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
376 s_tvalid_0 :
in STD_LOGIC;
377 s_tlast_0 :
in STD_LOGIC;
378 s_tready_0 :
out STD_LOGIC;
379 s_header_mark_0 :
in STD_LOGIC;
380 s_trailer_mark_0 :
in STD_LOGIC;
381 s_hdr_crc_tag_0 :
in STD_LOGIC;
382 s_poll_chan_0 :
out STD_LOGIC;
383 s_chan_enable_0 :
in STD_LOGIC;
385 s_tdata_1 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
386 s_tvalid_1 :
in STD_LOGIC;
387 s_tlast_1 :
in STD_LOGIC;
388 s_tready_1 :
out STD_LOGIC;
389 s_header_mark_1 :
in STD_LOGIC;
390 s_trailer_mark_1 :
in STD_LOGIC;
391 s_hdr_crc_tag_1 :
in STD_LOGIC;
392 s_poll_chan_1 :
out STD_LOGIC;
393 s_chan_enable_1 :
in STD_LOGIC;
395 s_tdata_2 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
396 s_tvalid_2 :
in STD_LOGIC;
397 s_tlast_2 :
in STD_LOGIC;
398 s_tready_2 :
out STD_LOGIC;
399 s_header_mark_2 :
in STD_LOGIC;
400 s_trailer_mark_2 :
in STD_LOGIC;
401 s_hdr_crc_tag_2 :
in STD_LOGIC;
402 s_poll_chan_2 :
out STD_LOGIC;
403 s_chan_enable_2 :
in STD_LOGIC;
405 s_tdata_3 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
406 s_tvalid_3 :
in STD_LOGIC;
407 s_tlast_3 :
in STD_LOGIC;
408 s_tready_3 :
out STD_LOGIC;
409 s_header_mark_3 :
in STD_LOGIC;
410 s_trailer_mark_3 :
in STD_LOGIC;
411 s_hdr_crc_tag_3 :
in STD_LOGIC;
412 s_poll_chan_3 :
out STD_LOGIC;
413 s_chan_enable_3 :
in STD_LOGIC;
415 s_tdata_4 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
416 s_tvalid_4 :
in STD_LOGIC;
417 s_tlast_4 :
in STD_LOGIC;
418 s_tready_4 :
out STD_LOGIC;
419 s_header_mark_4 :
in STD_LOGIC;
420 s_trailer_mark_4 :
in STD_LOGIC;
421 s_hdr_crc_tag_4 :
in STD_LOGIC;
422 s_poll_chan_4 :
out STD_LOGIC;
423 s_chan_enable_4 :
in STD_LOGIC;
425 s_tdata_5 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
426 s_tvalid_5 :
in STD_LOGIC;
427 s_tlast_5 :
in STD_LOGIC;
428 s_tready_5 :
out STD_LOGIC;
429 s_header_mark_5 :
in STD_LOGIC;
430 s_trailer_mark_5 :
in STD_LOGIC;
431 s_hdr_crc_tag_5 :
in STD_LOGIC;
432 s_poll_chan_5 :
out STD_LOGIC;
433 s_chan_enable_5 :
in STD_LOGIC;
435 s_tdata_6 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
436 s_tvalid_6 :
in STD_LOGIC;
437 s_tlast_6 :
in STD_LOGIC;
438 s_tready_6 :
out STD_LOGIC;
439 s_header_mark_6 :
in STD_LOGIC;
440 s_trailer_mark_6 :
in STD_LOGIC;
441 s_hdr_crc_tag_6 :
in STD_LOGIC;
442 s_poll_chan_6 :
out STD_LOGIC;
443 s_chan_enable_6 :
in STD_LOGIC;
445 s_tdata_7 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
446 s_tvalid_7 :
in STD_LOGIC;
447 s_tlast_7 :
in STD_LOGIC;
448 s_tready_7 :
out STD_LOGIC;
449 s_header_mark_7 :
in STD_LOGIC;
450 s_trailer_mark_7 :
in STD_LOGIC;
451 s_hdr_crc_tag_7 :
in STD_LOGIC;
452 s_poll_chan_7 :
out STD_LOGIC;
453 s_chan_enable_7 :
in STD_LOGIC;
455 s_tdata_8 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
456 s_tvalid_8 :
in STD_LOGIC;
457 s_tlast_8 :
in STD_LOGIC;
458 s_tready_8 :
out STD_LOGIC;
459 s_header_mark_8 :
in STD_LOGIC;
460 s_trailer_mark_8 :
in STD_LOGIC;
461 s_hdr_crc_tag_8 :
in STD_LOGIC;
462 s_poll_chan_8 :
out STD_LOGIC;
463 s_chan_enable_8 :
in STD_LOGIC;
465 s_tdata_9 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
466 s_tvalid_9 :
in STD_LOGIC;
467 s_tlast_9 :
in STD_LOGIC;
468 s_tready_9 :
out STD_LOGIC;
469 s_header_mark_9 :
in STD_LOGIC;
470 s_trailer_mark_9 :
in STD_LOGIC;
471 s_hdr_crc_tag_9 :
in STD_LOGIC;
472 s_poll_chan_9 :
out STD_LOGIC;
473 s_chan_enable_9 :
in STD_LOGIC;
475 s_tdata_10 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
476 s_tvalid_10 :
in STD_LOGIC;
477 s_tlast_10 :
in STD_LOGIC;
478 s_tready_10 :
out STD_LOGIC;
479 s_header_mark_10 :
in STD_LOGIC;
480 s_trailer_mark_10 :
in STD_LOGIC;
481 s_hdr_crc_tag_10 :
in STD_LOGIC;
482 s_poll_chan_10 :
out STD_LOGIC;
483 s_chan_enable_10 :
in STD_LOGIC;
485 s_tdata_11 :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
486 s_tvalid_11 :
in STD_LOGIC;
487 s_tlast_11 :
in STD_LOGIC;
488 s_tready_11 :
out STD_LOGIC;
489 s_header_mark_11 :
in STD_LOGIC;
490 s_trailer_mark_11 :
in STD_LOGIC;
491 s_hdr_crc_tag_11 :
in STD_LOGIC;
492 s_poll_chan_11 :
out STD_LOGIC;
493 s_chan_enable_11 :
in STD_LOGIC;
498 s_tdata_12 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
499 s_tvalid_12 :
in STD_LOGIC;
500 s_tlast_12 :
in STD_LOGIC;
501 s_tready_12 :
out STD_LOGIC;
502 s_header_mark_12 :
in STD_LOGIC;
503 s_trailer_mark_12 :
in STD_LOGIC;
504 s_hdr_crc_tag_12 :
in STD_LOGIC;
505 s_poll_chan_12 :
out STD_LOGIC;
506 s_chan_enable_12 :
in STD_LOGIC;
509 s_tdata_13 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
510 s_tvalid_13 :
in STD_LOGIC;
511 s_tlast_13 :
in STD_LOGIC;
512 s_tready_13 :
out STD_LOGIC;
513 s_header_mark_13 :
in STD_LOGIC;
514 s_trailer_mark_13 :
in STD_LOGIC;
515 s_hdr_crc_tag_13 :
in STD_LOGIC;
516 s_poll_chan_13 :
out STD_LOGIC;
517 s_chan_enable_13 :
in STD_LOGIC;
519 s_tdata_14 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
520 s_tvalid_14 :
in STD_LOGIC;
521 s_tlast_14 :
in STD_LOGIC;
522 s_tready_14 :
out STD_LOGIC;
523 s_header_mark_14 :
in STD_LOGIC;
524 s_trailer_mark_14 :
in STD_LOGIC;
525 s_hdr_crc_tag_14 :
in STD_LOGIC;
526 s_poll_chan_14 :
out STD_LOGIC;
527 s_chan_enable_14 :
in STD_LOGIC;
529 s_tdata_15 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
530 s_tvalid_15 :
in STD_LOGIC;
531 s_tlast_15 :
in STD_LOGIC;
532 s_tready_15 :
out STD_LOGIC;
533 s_header_mark_15 :
in STD_LOGIC;
534 s_trailer_mark_15 :
in STD_LOGIC;
535 s_hdr_crc_tag_15 :
in STD_LOGIC;
536 s_poll_chan_15 :
out STD_LOGIC;
537 s_chan_enable_15 :
in STD_LOGIC;
540 s_tdata_16 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
541 s_tvalid_16 :
in STD_LOGIC;
542 s_tlast_16 :
in STD_LOGIC;
543 s_tready_16 :
out STD_LOGIC;
544 s_header_mark_16 :
in STD_LOGIC;
545 s_trailer_mark_16 :
in STD_LOGIC;
546 s_hdr_crc_tag_16 :
in STD_LOGIC;
547 s_poll_chan_16 :
out STD_LOGIC;
548 s_chan_enable_16 :
in STD_LOGIC;
550 s_tdata_17 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
551 s_tvalid_17 :
in STD_LOGIC;
552 s_tlast_17 :
in STD_LOGIC;
553 s_tready_17 :
out STD_LOGIC;
554 s_header_mark_17 :
in STD_LOGIC;
555 s_trailer_mark_17 :
in STD_LOGIC;
556 s_hdr_crc_tag_17 :
in STD_LOGIC;
557 s_poll_chan_17 :
out STD_LOGIC;
558 s_chan_enable_17 :
in STD_LOGIC;
561 s_tdata_18 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
562 s_tvalid_18 :
in STD_LOGIC;
563 s_tlast_18 :
in STD_LOGIC;
564 s_tready_18 :
out STD_LOGIC;
565 s_header_mark_18 :
in STD_LOGIC;
566 s_trailer_mark_18 :
in STD_LOGIC;
567 s_hdr_crc_tag_18 :
in STD_LOGIC;
568 s_poll_chan_18 :
out STD_LOGIC;
569 s_chan_enable_18 :
in STD_LOGIC;
572 s_tdata_19 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
573 s_tvalid_19 :
in STD_LOGIC;
574 s_tlast_19 :
in STD_LOGIC;
575 s_tready_19 :
out STD_LOGIC;
576 s_header_mark_19 :
in STD_LOGIC;
577 s_trailer_mark_19 :
in STD_LOGIC;
578 s_hdr_crc_tag_19 :
in STD_LOGIC;
579 s_poll_chan_19 :
out STD_LOGIC;
580 s_chan_enable_19 :
in STD_LOGIC;
583 s_tdata_20 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
584 s_tvalid_20 :
in STD_LOGIC;
585 s_tlast_20 :
in STD_LOGIC;
586 s_tready_20 :
out STD_LOGIC;
587 s_header_mark_20 :
in STD_LOGIC;
588 s_trailer_mark_20 :
in STD_LOGIC;
589 s_hdr_crc_tag_20 :
in STD_LOGIC;
590 s_poll_chan_20 :
out STD_LOGIC;
591 s_chan_enable_20 :
in STD_LOGIC;
595 s_tdata_21 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
596 s_tvalid_21 :
in STD_LOGIC;
597 s_tlast_21 :
in STD_LOGIC;
598 s_tready_21 :
out STD_LOGIC;
599 s_header_mark_21 :
in STD_LOGIC;
600 s_trailer_mark_21 :
in STD_LOGIC;
601 s_hdr_crc_tag_21 :
in STD_LOGIC;
602 s_poll_chan_21 :
out STD_LOGIC;
603 s_chan_enable_21 :
in STD_LOGIC;
606 s_tdata_22 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
607 s_tvalid_22 :
in STD_LOGIC;
608 s_tlast_22 :
in STD_LOGIC;
609 s_tready_22 :
out STD_LOGIC;
610 s_header_mark_22 :
in STD_LOGIC;
611 s_trailer_mark_22 :
in STD_LOGIC;
612 s_hdr_crc_tag_22 :
in STD_LOGIC;
613 s_poll_chan_22 :
out STD_LOGIC;
614 s_chan_enable_22 :
in STD_LOGIC;
616 s_tdata_23 :
in STD_LOGIC_VECTOR ((bp_width
-1)
downto 0);
617 s_tvalid_23 :
in STD_LOGIC;
618 s_tlast_23 :
in STD_LOGIC;
619 s_tready_23 :
out STD_LOGIC;
620 s_header_mark_23 :
in STD_LOGIC;
621 s_trailer_mark_23 :
in STD_LOGIC;
622 s_hdr_crc_tag_23 :
in STD_LOGIC;
623 s_poll_chan_23 :
out STD_LOGIC;
624 s_chan_enable_23 :
in STD_LOGIC;
632 m_tdata :
out STD_LOGIC_VECTOR (bp_width
-1 downto 0);
633 m_tvalid :
out STD_LOGIC;
634 m_tlast :
out STD_LOGIC;
635 m_tready :
in STD_LOGIC;
636 m_header_mark :
out STD_LOGIC;
637 m_trailer_mark :
out STD_LOGIC;
638 m_hdr_crc_tag :
out STD_LOGIC;
639 m_poll_chan_0 :
in STD_LOGIC;
640 m_chan_enable :
out STD_LOGIC;
642 nxt_chan_0 :
in STD_LOGIC;
643 nxt_chan_1 :
in STD_LOGIC;
644 nxt_chan_2 :
in STD_LOGIC;
645 nxt_chan_3 :
in STD_LOGIC;
646 current_chan :
out STD_LOGIC_VECTOR (
4 downto 0);
647 first_chan :
in STD_LOGIC_VECTOR (
4 downto 0);
648 last_chan :
in STD_LOGIC_VECTOR (
4 downto 0)
656 reset :
in STD_LOGIC;
657 pp_clk :
in STD_LOGIC;
658 cttc_user_clk :
in STD_LOGIC;
659 seq :
in STD_LOGIC_VECTOR (
1 downto 0);
661 ttc_word_0 :
in STD_LOGIC_VECTOR (
31 downto 0);
662 ttc_word_1 :
in STD_LOGIC_VECTOR (
31 downto 0);
663 ttc_word_2 :
in STD_LOGIC_VECTOR (
31 downto 0);
664 ttc_word_3 :
in STD_LOGIC_VECTOR (
31 downto 0);
666 L1ID_error :
out STD_LOGIC;
667 CTTC_CRC_error :
out STD_LOGIC;
668 header_read_en :
in STD_LOGIC;
669 header_fifo_valid :
out STD_LOGIC;
670 header_fifo_full :
out STD_LOGIC;
671 header_fifo_empty :
out STD_LOGIC;
672 header_fifo_level :
out STD_LOGIC_VECTOR (
8 downto 0);
674 master_header :
out STD_LOGIC_VECTOR (
63 downto 0)
680 CRC20_G_Poly :
std_logic_vector(
19 downto 0) := x"
8349f";
682 bp_width :
integer :=
64;
683 event_width :
integer :=
64;
684 header_width :
integer :=
64
686 Port ( clock :
in STD_LOGIC;
687 reset :
in STD_LOGIC;
688 geo_location :
in STD_LOGIC_VECTOR (
7 downto 0);
689 s_tdata :
in STD_LOGIC_VECTOR (bp_width
-1 downto 0);
690 s_tvalid :
in STD_LOGIC;
691 s_tlast :
in STD_LOGIC;
692 s_header_mark :
in STD_LOGIC;
693 s_trailer_mark :
in STD_LOGIC;
694 s_hdr_crc_tag :
in STD_LOGIC;
695 s_tready :
out STD_LOGIC;
696 nxt_chan :
out STD_LOGIC;
697 empty_0 :
in STD_LOGIC;
698 empty_1 :
in STD_LOGIC;
699 empty_2 :
in STD_LOGIC;
700 empty_3 :
in STD_LOGIC;
702 match_0 :
in STD_LOGIC;
703 match_1 :
in STD_LOGIC;
704 match_2 :
in STD_LOGIC;
705 match_3 :
in STD_LOGIC;
706 hdr_match :
out STD_LOGIC;
707 current_chan :
in STD_LOGIC_VECTOR (
4 downto 0);
708 num_chan :
in STD_LOGIC_VECTOR (
4 downto 0);
709 chan_in :
in STD_LOGIC_VECTOR (
4 downto 0);
710 chan_enable :
in STD_LOGIC;
713 poll_chan :
out std_logic;
715 lead_follow_b :
in STD_LOGIC;
716 comb_error :
in STD_LOGIC;
719 master_header :
in STD_LOGIC_VECTOR (
63 downto 0);
720 header_fifo_empty :
in STD_LOGIC;
721 L1ID_error :
in STD_LOGIC;
722 CTTC_CRC_error :
in STD_LOGIC;
723 header_read_en :
out STD_LOGIC;
724 header_fifo_valid :
in STD_LOGIC;
725 header_fifo_full :
in STD_LOGIC;
726 header_sequence :
in STD_LOGIC_VECTOR (
11 downto 0);
727 header_type :
in STD_LOGIC_VECTOR (
3 downto 0);
729 m_tvalid :
out STD_LOGIC;
730 m_tlast :
out STD_LOGIC;
731 m_tdata :
out STD_LOGIC_VECTOR (bp_width
-1 downto 0);
732 m_header_marker :
out STD_LOGIC;
733 m_tail_marker :
out STD_LOGIC;
734 m_tready :
in STD_LOGIC;
736 first_chan :
in STD_LOGIC_vector (
4 downto 0);
737 last_chan :
in STD_LOGIC_vector (
4 downto 0);
739 chan_pointer_reset :
out STD_LOGIC;
740 any_chan_active :
in std_logic;
742 event_sel :
in STD_LOGIC_VECTOR (
1 downto 0);
743 rod_slot :
in std_logic;
744 flx_backpressure :
in STD_LOGIC;
745 flx_bp_enable :
in STD_LOGIC;
747 TTC_ignore :
in STD_LOGIC;
749 state_out :
out STD_LOGIC_VECTOR(
5 DOWNTO 0);
750 event_fifo_level :
out STD_LOGIC_VECTOR(
31 DOWNTO 0);
751 debug_fifo_level :
out STD_LOGIC_VECTOR(
31 DOWNTO 0);
752 crc20_err :
out STD_LOGIC;
753 crc20_err_chan :
out STD_LOGIC_VECTOR (
4 downto 0);
754 crc9_err :
out STD_LOGIC;
755 BCID_mismatch :
out STD_LOGIC;
756 L1ID_mismatch :
out STD_LOGIC;
757 timeout_err :
out STD_LOGIC;
758 timeout_1_val :
in STD_LOGIC_VECTOR (
15 downto 0);
759 timeout_n_val :
in STD_LOGIC_VECTOR (
15 downto 0);
760 wdog_overflow :
out STD_LOGIC;
761 wdog_threshold :
in STD_LOGIC_VECTOR (
15 downto 0);
762 wdog_disable :
in STD_LOGIC;
763 l1id_resync_enable:
in STD_LOGIC;
765 tob_timeout_1_disable :
in STD_LOGIC;
766 tob_timeout_n_disable :
in STD_LOGIC;
768 ttc_rollover :
out std_logic;
770 dbg_pkt_count :
out std_logic_VECTOR (
31 downto 0);
771 dbg_pkt_count_reset :
in STD_LOGIC;
772 L1ID_ttc_32_reg_out :
out std_logic_VECTOR (
31 downto 0);
773 stop_proc :
in std_logic;
775 l1id_max_l1id_o :
out std_logic_VECTOR (
31 downto 0);
776 l1id_measure_max_o :
out std_logic_VECTOR (
31 downto 0);
777 l1id_measure_last_o :
out std_logic_VECTOR (
31 downto 0);
778 clr_pkt_wait_timer :
in STD_LOGIC;
779 timeout_counter_max :
out std_logic_VECTOR (
15 downto 0);
780 max_chan :
out std_logic_VECTOR (
4 downto 0);
781 clr_max_timeout :
in STD_LOGIC
790 timeout_1_default :
std_logic_vector(
15 downto 0) := x"
0600";
791 timeout_n_default :
std_logic_vector(
15 downto 0) := x"
0030";
792 wdog_thresh_default :
std_logic_vector(
15 downto 0) := x"
2000"
797 ipb_clk :
in std_logic;
798 ipb_rst :
in std_logic;
799 ipb_in :
in ipb_wbus;
800 ipb_out :
out ipb_rbus;
802 pp_clock :
in std_logic;
803 rt_clk :
in std_logic;
804 reset :
in std_logic;
805 event_fifo_level :
in STD_LOGIC_VECTOR (
15 downto 0);
806 debug_fifo_level :
in STD_LOGIC_VECTOR (
15 downto 0);
807 stage_fifo_level :
in std_logic_vector (
15 downto 0);
809 first_chan :
in STD_LOGIC_vector (
4 downto 0);
810 current_state :
in STD_LOGIC_VECTOR (
7 downto 0);
811 header_mark :
in std_logic;
812 header_fifo_valid :
in std_logic;
813 hdr_crc_error :
in std_logic;
814 ttc_crc_error :
in std_logic;
815 full_mode_ctrl :
out STD_LOGIC_VECTOR (
31 downto 0);
816 full_mode_stat :
in STD_LOGIC_VECTOR (
31 downto 0);
817 FM_L1id_stat :
in std_logic_vector(
31 downto 0);
818 m_tdata :
in STD_LOGIC_VECTOR (
63 downto 0);
819 m_tvalid :
in std_logic;
820 m_tlast :
in std_logic;
821 m_header_marker :
in std_logic;
823 L1ID_ttc_32_reg :
in STD_LOGIC_VECTOR (
31 downto 0);
824 s_tdata :
in STD_LOGIC_VECTOR (
63 downto 0);
825 s_tvalid :
in std_logic;
826 s_tlast :
in std_logic;
827 s_header_mark :
in std_logic;
828 poll_chan :
in std_logic;
830 crc20_err :
in STD_LOGIC;
831 crc9_err :
in STD_LOGIC;
832 BCID_mismatch :
in STD_LOGIC;
833 L1ID_mismatch :
in STD_LOGIC;
834 timeout_err :
in STD_LOGIC;
835 crc20_err_chan :
in STD_LOGIC_VECTOR (
4 downto 0);
837 stage_fifo_busy :
out STD_LOGIC;
838 stage_fifo_xoff :
out STD_LOGIC;
839 stage_fifo_full :
in STD_LOGIC;
840 timeout_1_val :
out STD_LOGIC_VECTOR (
15 downto 0);
841 timeout_n_val :
out STD_LOGIC_VECTOR (
15 downto 0);
843 wdog_overflow :
in STD_LOGIC;
844 wdog_threshold :
out STD_LOGIC_VECTOR (
15 downto 0);
845 wdog_disable :
out STD_LOGIC;
846 wdog_fifo_reset :
out STD_LOGIC;
847 l1id_resync_enable:
out STD_LOGIC;
849 tob_timeout_1_disable :
out STD_LOGIC;
850 tob_timeout_n_disable :
out STD_LOGIC;
852 dbg_pkt_count :
in STD_LOGIC_VECTOR (
31 downto 0);
853 dbg_pkt_count_reset :
out STD_LOGIC;
854 flx_backpressure :
in STD_LOGIC_vector(
11 downto 0);
855 flx_backpressure_bit :
out STD_LOGIC;
856 stop_proc :
out STD_LOGIC;
858 l1id_max_l1id :
in std_logic_VECTOR (
31 downto 0);
859 l1id_measure_max :
in std_logic_VECTOR (
31 downto 0);
860 l1id_measure_last :
in std_logic_VECTOR (
31 downto 0);
861 clr_pkt_wait_timer :
out STD_LOGIC;
862 timeout_counter_max :
in std_logic_VECTOR (
15 downto 0);
863 max_chan :
in std_logic_VECTOR (
4 downto 0);
864 clr_max_timeout :
out STD_LOGIC;
866 last_chan :
in STD_LOGIC_vector (
4 downto 0);
867 nxt_chan_0 :
in STD_LOGIC;
868 chan_pointer_reset :
in STD_LOGIC
878 probe0 :
IN STD_LOGIC_VECTOR(
4 DOWNTO 0);
879 probe1 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
880 probe2 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
881 probe3 :
IN STD_LOGIC_VECTOR(
63 DOWNTO 0);
882 probe4 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
883 probe5 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
884 probe6 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
885 probe7 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
886 probe8 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
887 probe9 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0)
893 COUNTER_WIDTH :
integer :=
4
896 clock :
in STD_LOGIC;
897 reset :
in STD_LOGIC;
898 pulse_in :
in STD_LOGIC;
899 pulse_out :
out STD_LOGIC
906 Port ( current_chan :
in STD_LOGIC_VECTOR (
4 downto 0);
907 chan_out :
out STD_LOGIC_VECTOR (
4 downto 0);
908 num_chan :
in STD_LOGIC_VECTOR (
4 downto 0);
909 clock :
in STD_LOGIC;
914 signal ev_in_tdata : STD_LOGIC_VECTOR (bp_width-1 downto 0);
915 signal ev_in_tvalid : std_logic;
916 signal ev_in_tlast : std_logic;
917 signal ev_in_tready : std_logic;
918 signal ev_in_header_mark : std_logic;
919 signal ev_in_trailer_mark : std_logic;
920 signal ev_in_hdr_crc_tag : std_logic;
922 signal nxt_chan_0 : std_logic;
923 signal nxt_chan_1 : std_logic;
924 signal nxt_chan_2 : std_logic;
925 signal nxt_chan_3 : std_logic;
927 signal current_chan : STD_LOGIC_VECTOR (4 downto 0);
928 signal m_poll_chan_0 : std_logic;
929 signal dum_chin : STD_LOGIC_VECTOR (4 downto 0);
930 signal reset : std_logic;
931 signal crc20_err : STD_LOGIC;
932 signal crc9_err : STD_LOGIC;
933 signal BCID_mismatch : STD_LOGIC;
934 signal L1ID_mismatch : STD_LOGIC;
935 signal timeout_err : STD_LOGIC;
936 signal crc20_err_chan : STD_LOGIC_VECTOR (4 downto 0);
938 signal wdog_fifo_reset_i : STD_LOGIC;
945 signal header_fifo_empty : STD_LOGIC;
946 signal L1ID_error : STD_LOGIC;
947 signal CTTC_CRC_error : STD_LOGIC;
948 signal header_fifo_full : STD_LOGIC;
950 signal ev_chan_enable : STD_LOGIC;
953 signal current_state : STD_LOGIC_VECTOR (5 downto 0);
954 signal event_fifo_level : STD_LOGIC_VECTOR(31 DOWNTO 0);
955 signal debug_fifo_level : STD_LOGIC_VECTOR(31 DOWNTO 0);
957 signal m_tvalid_i : STD_LOGIC;
958 signal m_tlast_i : STD_LOGIC;
959 signal m_tdata_i : STD_LOGIC_VECTOR(63 DOWNTO 0);
960 signal m_header_marker_i : STD_LOGIC;
961 signal timeout_1_val : STD_LOGIC_VECTOR(15 DOWNTO 0);
962 signal timeout_n_val : STD_LOGIC_VECTOR(15 DOWNTO 0);
963 signal tob_timeout_1_disable : STD_LOGIC;
964 signal tob_timeout_n_disable : STD_LOGIC;
966 signal chan_pointer_reset : STD_LOGIC;
967 signal any_chan_active : std_logic;
969 signal full_mode_ctrl_i : std_logic_vector(31 downto 0);
970 signal flx_bp_enable : std_logic;
971 signal flx_backpressure_bit : std_logic;
973 signal wdog_overflow : STD_LOGIC;
974 signal wdog_threshold : STD_LOGIC_VECTOR (15 downto 0);
975 signal wdog_disable : STD_LOGIC;
976 signal l1id_resync_enable : STD_LOGIC;
978 signal dbg_pkt_count : STD_LOGIC_VECTOR (31 downto 0);
979 signal dbg_pkt_count_reset : STD_LOGIC;
981 signal L1ID_ttc_32_reg : STD_LOGIC_VECTOR (31 downto 0);
983 signal stop_proc : std_logic;
985 signal l1id_max_l1id : std_logic_VECTOR (31 downto 0);
986 signal l1id_measure_max : std_logic_VECTOR (31 downto 0);
987 signal l1id_measure_last : std_logic_VECTOR (31 downto 0);
988 signal clr_pkt_wait_timer : std_logic;
990 signal timeout_counter_max : std_logic_VECTOR (15 downto 0);
991 signal max_chan : std_logic_VECTOR (4 downto 0);
992 signal clr_max_timeout : STD_LOGIC;
996 reset <= proc_reset or system_reset or wdog_overflow;
1000 port map (clock => pp_clock,
1002 chan_pointer_reset => chan_pointer_reset,
1003 s_tdata_0 => s_tdata_0,
1004 s_tvalid_0 => s_tvalid_0,
1005 s_tlast_0 => s_tlast_0,
1006 s_tready_0 => s_tready_0,
1007 s_header_mark_0 => s_header_mark_0,
1008 s_trailer_mark_0 => s_trailer_mark_0,
1009 s_hdr_crc_tag_0 => s_hdr_crc_tag_0,
1010 s_poll_chan_0 => s_poll_chan_0,
1011 s_chan_enable_0 => s_chan_enable_0,
1013 s_tdata_1 => s_tdata_1,
1014 s_tvalid_1 => s_tvalid_1,
1015 s_tlast_1 => s_tlast_1,
1016 s_tready_1 => s_tready_1,
1017 s_header_mark_1 => s_header_mark_1,
1018 s_trailer_mark_1 => s_trailer_mark_1,
1019 s_hdr_crc_tag_1 => s_hdr_crc_tag_1,
1020 s_poll_chan_1 => s_poll_chan_1,
1021 s_chan_enable_1 => s_chan_enable_1,
1023 s_tdata_2 => s_tdata_2,
1024 s_tvalid_2 => s_tvalid_2,
1025 s_tlast_2 => s_tlast_2,
1026 s_tready_2 => s_tready_2,
1027 s_header_mark_2 => s_header_mark_2,
1028 s_trailer_mark_2 => s_trailer_mark_2,
1029 s_hdr_crc_tag_2 => s_hdr_crc_tag_2,
1030 s_poll_chan_2 => s_poll_chan_2,
1031 s_chan_enable_2 => s_chan_enable_2,
1033 s_tdata_3 => s_tdata_3,
1034 s_tvalid_3 => s_tvalid_3,
1035 s_tlast_3 => s_tlast_3,
1036 s_tready_3 => s_tready_3,
1037 s_header_mark_3 => s_header_mark_3,
1038 s_trailer_mark_3 => s_trailer_mark_3,
1039 s_hdr_crc_tag_3 => s_hdr_crc_tag_3,
1040 s_poll_chan_3 => s_poll_chan_3,
1041 s_chan_enable_3 => s_chan_enable_3,
1043 s_tdata_4 => s_tdata_4,
1044 s_tvalid_4 => s_tvalid_4,
1045 s_tlast_4 => s_tlast_4,
1046 s_tready_4 => s_tready_4,
1047 s_header_mark_4 => s_header_mark_4,
1048 s_trailer_mark_4 => s_trailer_mark_4,
1049 s_hdr_crc_tag_4 => s_hdr_crc_tag_4,
1050 s_poll_chan_4 => s_poll_chan_4,
1051 s_chan_enable_4 => s_chan_enable_4,
1053 s_tdata_5 => s_tdata_5,
1054 s_tvalid_5 => s_tvalid_5,
1055 s_tlast_5 => s_tlast_5,
1056 s_tready_5 => s_tready_5,
1057 s_header_mark_5 => s_header_mark_5,
1058 s_trailer_mark_5 => s_trailer_mark_5,
1059 s_hdr_crc_tag_5 => s_hdr_crc_tag_5,
1060 s_poll_chan_5 => s_poll_chan_5,
1061 s_chan_enable_5 => s_chan_enable_5,
1063 s_tdata_6 => s_tdata_6,
1064 s_tvalid_6 => s_tvalid_6,
1065 s_tlast_6 => s_tlast_6,
1066 s_tready_6 => s_tready_6,
1067 s_header_mark_6 => s_header_mark_6,
1068 s_trailer_mark_6 => s_trailer_mark_6,
1069 s_hdr_crc_tag_6 => s_hdr_crc_tag_6,
1070 s_poll_chan_6 => s_poll_chan_6,
1071 s_chan_enable_6 => s_chan_enable_6,
1073 s_tdata_7 => s_tdata_7,
1074 s_tvalid_7 => s_tvalid_7,
1075 s_tlast_7 => s_tlast_7,
1076 s_tready_7 => s_tready_7,
1077 s_header_mark_7 => s_header_mark_7,
1078 s_trailer_mark_7 => s_trailer_mark_7,
1079 s_hdr_crc_tag_7 => s_hdr_crc_tag_7,
1080 s_poll_chan_7 => s_poll_chan_7,
1081 s_chan_enable_7 => s_chan_enable_7,
1083 s_tdata_8 => s_tdata_8,
1084 s_tvalid_8 => s_tvalid_8,
1085 s_tlast_8 => s_tlast_8,
1086 s_tready_8 => s_tready_8,
1087 s_header_mark_8 => s_header_mark_8,
1088 s_trailer_mark_8 => s_trailer_mark_8,
1089 s_hdr_crc_tag_8 => s_hdr_crc_tag_8,
1090 s_poll_chan_8 => s_poll_chan_8,
1091 s_chan_enable_8 => s_chan_enable_8,
1093 s_tdata_9 => s_tdata_9,
1094 s_tvalid_9 => s_tvalid_9,
1095 s_tlast_9 => s_tlast_9,
1096 s_tready_9 => s_tready_9,
1097 s_header_mark_9 => s_header_mark_9,
1098 s_trailer_mark_9 => s_trailer_mark_9,
1099 s_hdr_crc_tag_9 => s_hdr_crc_tag_9,
1100 s_poll_chan_9 => s_poll_chan_9,
1101 s_chan_enable_9 => s_chan_enable_9,
1103 s_tdata_10 => s_tdata_10,
1104 s_tvalid_10 => s_tvalid_10,
1105 s_tlast_10 => s_tlast_10,
1106 s_tready_10 => s_tready_10,
1107 s_header_mark_10 => s_header_mark_10,
1108 s_trailer_mark_10 => s_trailer_mark_10,
1109 s_hdr_crc_tag_10 => s_hdr_crc_tag_10,
1110 s_poll_chan_10 => s_poll_chan_10,
1111 s_chan_enable_10 => s_chan_enable_10,
1116 s_tdata_11 => s_tdata_11,
1117 s_tvalid_11 => s_tvalid_11,
1118 s_tlast_11 => s_tlast_11,
1119 s_tready_11 => s_tready_11,
1120 s_header_mark_11 => s_header_mark_11,
1121 s_trailer_mark_11 => s_trailer_mark_11,
1122 s_hdr_crc_tag_11 => s_hdr_crc_tag_11,
1123 s_poll_chan_11 => s_poll_chan_11,
1124 s_chan_enable_11 => s_chan_enable_11,
1126 s_tdata_12 => s_tdata_12,
1127 s_tvalid_12 => s_tvalid_12,
1128 s_tlast_12 => s_tlast_12,
1129 s_tready_12 => s_tready_12,
1130 s_header_mark_12 => s_header_mark_12,
1131 s_trailer_mark_12 => s_trailer_mark_12,
1132 s_hdr_crc_tag_12 => s_hdr_crc_tag_12,
1133 s_poll_chan_12 => s_poll_chan_12,
1134 s_chan_enable_12 => s_chan_enable_12,
1136 s_tdata_13 => s_tdata_13,
1137 s_tvalid_13 => s_tvalid_13,
1138 s_tlast_13 => s_tlast_13,
1139 s_tready_13 => s_tready_13,
1140 s_header_mark_13 => s_header_mark_13,
1141 s_trailer_mark_13 => s_trailer_mark_13,
1142 s_hdr_crc_tag_13 => s_hdr_crc_tag_13,
1143 s_poll_chan_13 => s_poll_chan_13,
1144 s_chan_enable_13 => s_chan_enable_13,
1146 s_tdata_14 => s_tdata_14,
1147 s_tvalid_14 => s_tvalid_14,
1148 s_tlast_14 => s_tlast_14,
1149 s_tready_14 => s_tready_14,
1150 s_header_mark_14 => s_header_mark_14,
1151 s_trailer_mark_14 => s_trailer_mark_14,
1152 s_hdr_crc_tag_14 => s_hdr_crc_tag_14,
1153 s_poll_chan_14 => s_poll_chan_14,
1154 s_chan_enable_14 => s_chan_enable_14,
1159 s_tdata_15 => s_tdata_15,
1160 s_tvalid_15 => s_tvalid_15,
1161 s_tlast_15 => s_tlast_15,
1162 s_tready_15 => s_tready_15,
1163 s_header_mark_15 => s_header_mark_15,
1164 s_trailer_mark_15 => s_trailer_mark_15,
1165 s_hdr_crc_tag_15 => s_hdr_crc_tag_15,
1166 s_poll_chan_15 => s_poll_chan_15,
1167 s_chan_enable_15 => s_chan_enable_15,
1172 s_tdata_16 => s_tdata_16,
1173 s_tvalid_16 => s_tvalid_16,
1174 s_tlast_16 => s_tlast_16,
1175 s_tready_16 => s_tready_16,
1176 s_header_mark_16 => s_header_mark_16,
1177 s_trailer_mark_16 => s_trailer_mark_16,
1178 s_hdr_crc_tag_16 => s_hdr_crc_tag_16,
1179 s_poll_chan_16 => s_poll_chan_16,
1180 s_chan_enable_16 => s_chan_enable_16,
1185 s_tdata_17 => s_tdata_17,
1186 s_tvalid_17 => s_tvalid_17,
1187 s_tlast_17 => s_tlast_17,
1188 s_tready_17 => s_tready_17,
1189 s_header_mark_17 => s_header_mark_17,
1190 s_trailer_mark_17 => s_trailer_mark_17,
1191 s_hdr_crc_tag_17 => s_hdr_crc_tag_17,
1192 s_poll_chan_17 => s_poll_chan_17,
1193 s_chan_enable_17 => s_chan_enable_17,
1198 s_tdata_18 => s_tdata_18,
1199 s_tvalid_18 => s_tvalid_18,
1200 s_tlast_18 => s_tlast_18,
1201 s_tready_18 => s_tready_18,
1202 s_header_mark_18 => s_header_mark_18,
1203 s_trailer_mark_18 => s_trailer_mark_18,
1204 s_hdr_crc_tag_18 => s_hdr_crc_tag_18,
1205 s_poll_chan_18 => s_poll_chan_18,
1206 s_chan_enable_18 => s_chan_enable_18,
1211 s_tdata_19 => s_tdata_19,
1212 s_tvalid_19 => s_tvalid_19,
1213 s_tlast_19 => s_tlast_19,
1214 s_tready_19 => s_tready_19,
1215 s_header_mark_19 => s_header_mark_19,
1216 s_trailer_mark_19 => s_trailer_mark_19,
1217 s_hdr_crc_tag_19 => s_hdr_crc_tag_19,
1218 s_poll_chan_19 => s_poll_chan_19,
1219 s_chan_enable_19 => s_chan_enable_19,
1224 s_tdata_20 => s_tdata_20,
1225 s_tvalid_20 => s_tvalid_20,
1226 s_tlast_20 => s_tlast_20,
1227 s_tready_20 => s_tready_20,
1228 s_header_mark_20 => s_header_mark_20,
1229 s_trailer_mark_20 => s_trailer_mark_20,
1230 s_hdr_crc_tag_20 => s_hdr_crc_tag_20,
1231 s_poll_chan_20 => s_poll_chan_20,
1232 s_chan_enable_20 => s_chan_enable_20,
1237 s_tdata_21 => s_tdata_21,
1238 s_tvalid_21 => s_tvalid_21,
1239 s_tlast_21 => s_tlast_21,
1240 s_tready_21 => s_tready_21,
1241 s_header_mark_21 => s_header_mark_21,
1242 s_trailer_mark_21 => s_trailer_mark_21,
1243 s_hdr_crc_tag_21 => s_hdr_crc_tag_21,
1244 s_poll_chan_21 => s_poll_chan_21,
1245 s_chan_enable_21 => s_chan_enable_21,
1250 s_tdata_22 => s_tdata_22,
1251 s_tvalid_22 => s_tvalid_22,
1252 s_tlast_22 => s_tlast_22,
1253 s_tready_22 => s_tready_22,
1254 s_header_mark_22 => s_header_mark_22,
1255 s_trailer_mark_22 => s_trailer_mark_22,
1256 s_hdr_crc_tag_22 => s_hdr_crc_tag_22,
1257 s_poll_chan_22 => s_poll_chan_22,
1258 s_chan_enable_22 => s_chan_enable_22,
1262 s_tdata_23 => s_tdata_23,
1263 s_tvalid_23 => s_tvalid_23,
1264 s_tlast_23 => s_tlast_23,
1265 s_tready_23 => s_tready_23,
1266 s_header_mark_23 => s_header_mark_23,
1267 s_trailer_mark_23 => s_trailer_mark_23,
1268 s_hdr_crc_tag_23 => s_hdr_crc_tag_23,
1269 s_poll_chan_23 => s_poll_chan_23,
1270 s_chan_enable_23 => s_chan_enable_23,
1274 m_tdata => ev_in_tdata,
1275 m_tvalid => ev_in_tvalid,
1276 m_tlast => ev_in_tlast,
1278 m_header_mark => ev_in_header_mark,
1279 m_trailer_mark => ev_in_trailer_mark,
1280 m_hdr_crc_tag => ev_in_hdr_crc_tag,
1281 m_poll_chan_0 => m_poll_chan_0,
1282 m_chan_enable => ev_chan_enable,
1287 nxt_chan_0 => nxt_chan_0,
1292 current_chan => current_chan,
1293 first_chan => first_chan
(4 downto 0),
1294 last_chan => last_chan
(4 downto 0)
1301 CRC20_G_Poly => CRC20_G_Poly
1303 port map (clock => pp_clock,
1305 geo_location => geo_location,
1306 s_tdata => ev_in_tdata,
1307 s_tvalid => ev_in_tvalid,
1308 s_tlast => ev_in_tlast,
1309 s_header_mark => ev_in_header_mark,
1310 s_trailer_mark => ev_in_trailer_mark,
1311 s_hdr_crc_tag => ev_in_hdr_crc_tag,
1313 s_tready => ev_in_tready,
1314 nxt_chan => nxt_chan_0,
1326 current_chan => current_chan,
1328 num_chan => last_chan
(4 downto 0),
1329 chan_in => dum_chin,
1331 chan_enable => ev_chan_enable,
1332 first_chan => first_chan
(4 downto 0),
1333 last_chan => last_chan
(4 downto 0),
1334 chan_pointer_reset => chan_pointer_reset,
1335 any_chan_active => any_chan_active,
1336 event_sel => event_sel,
1337 rod_slot => rod_slot,
1339 flx_backpressure => flx_backpressure_bit,
1340 flx_bp_enable => flx_bp_enable,
1342 TTC_ignore => TTC_ignore,
1344 poll_chan => m_poll_chan_0,
1346 lead_follow_b => '1',
1348 master_header => master_header,
1349 header_fifo_empty => header_fifo_empty,
1350 L1ID_error => L1ID_error,
1351 CTTC_CRC_error => CTTC_CRC_error,
1352 header_read_en => header_read_en,
1353 header_fifo_valid => header_fifo_valid,
1354 header_fifo_full => header_fifo_full,
1355 header_sequence => header_sequence,
1356 header_type => header_type,
1358 m_tvalid => m_tvalid_i,
1359 m_tlast => m_tlast_i,
1360 m_tdata => m_tdata_i,
1361 m_header_marker => m_header_marker_i,
1362 m_tail_marker => m_tail_marker,
1364 state_out => current_state,
1365 event_fifo_level => event_fifo_level,
1366 debug_fifo_level => debug_fifo_level,
1367 crc20_err => crc20_err,
1368 crc20_err_chan => crc20_err_chan,
1369 crc9_err => crc9_err,
1370 BCID_mismatch => BCID_mismatch,
1371 L1ID_mismatch => L1ID_mismatch,
1372 timeout_err => timeout_err,
1373 timeout_1_val => timeout_1_val,
1374 timeout_n_val => timeout_n_val,
1376 tob_timeout_1_disable => tob_timeout_1_disable,
1377 tob_timeout_n_disable => tob_timeout_n_disable,
1379 wdog_overflow => wdog_overflow,
1380 wdog_threshold => wdog_threshold,
1381 wdog_disable => wdog_disable,
1382 l1id_resync_enable => l1id_resync_enable,
1383 ttc_rollover => ttc_rollover,
1385 dbg_pkt_count => dbg_pkt_count,
1386 dbg_pkt_count_reset=> dbg_pkt_count_reset,
1387 L1ID_ttc_32_reg_out => L1ID_ttc_32_reg,
1388 stop_proc => stop_proc,
1390 l1id_max_l1id_o => l1id_max_l1id,
1391 l1id_measure_max_o => l1id_measure_max,
1392 l1id_measure_last_o => l1id_measure_last,
1393 clr_pkt_wait_timer => clr_pkt_wait_timer,
1394 timeout_counter_max => timeout_counter_max,
1395 max_chan => max_chan,
1396 clr_max_timeout => clr_max_timeout
1399 timeout_err_out <= timeout_err;
1400 m_tvalid <= m_tvalid_i;
1401 m_tlast <= m_tlast_i;
1402 m_tdata <= m_tdata_i;
1403 m_header_marker <= m_header_marker_i;
1412 reset => system_reset,
1413 pulse_in => l1id_mismatch,
1414 pulse_out => l1id_mis_stretch
1418 gen_reg: if SIM=0 generate
1422 timeout_1_default => timeout_1_default,
1423 timeout_n_default => timeout_n_default
1430 pp_clock => pp_clock,
1432 reset => system_reset,
1433 event_fifo_level => event_fifo_level
(15 downto 0),
1434 debug_fifo_level => debug_fifo_level
(15 downto 0),
1435 stage_fifo_level => stage_fifo_level,
1438 first_chan => first_chan
(4 downto 0),
1439 current_state
(5 downto 0) => current_state,
1440 current_state
(7 downto 6) => "
00",
1441 header_mark => ev_in_header_mark,
1442 header_fifo_valid => header_fifo_valid,
1443 hdr_crc_error => ev_in_hdr_crc_tag,
1444 ttc_crc_error => CTTC_CRC_error,
1445 full_mode_ctrl => full_mode_ctrl_i,
1446 full_mode_stat => full_mode_stat,
1447 FM_L1id_stat => FM_L1id_stat,
1448 m_tdata => m_tdata_i,
1449 m_tvalid => m_tvalid_i,
1450 m_tlast => m_tlast_i,
1451 m_header_marker => m_header_marker_i,
1453 L1ID_ttc_32_reg => L1ID_ttc_32_reg,
1455 s_tdata => ev_in_tdata,
1456 s_tvalid => ev_in_tvalid,
1457 s_tlast => ev_in_tlast,
1458 s_header_mark => ev_in_header_mark,
1459 poll_chan => m_poll_chan_0,
1461 crc20_err => crc20_err,
1462 crc20_err_chan => crc20_err_chan,
1463 crc9_err => crc9_err,
1464 BCID_mismatch => BCID_mismatch,
1465 L1ID_mismatch => L1ID_mismatch,
1466 timeout_err => timeout_err,
1467 stage_fifo_busy => stage_fifo_busy,
1468 stage_fifo_xoff => stage_fifo_xoff,
1469 stage_fifo_full => stage_fifo_full,
1470 timeout_1_val => timeout_1_val,
1471 timeout_n_val => timeout_n_val,
1473 tob_timeout_1_disable => tob_timeout_1_disable,
1474 tob_timeout_n_disable => tob_timeout_n_disable,
1476 wdog_overflow => wdog_overflow,
1477 wdog_threshold => wdog_threshold,
1478 wdog_disable => wdog_disable,
1479 l1id_resync_enable => l1id_resync_enable,
1480 wdog_fifo_reset => wdog_fifo_reset_i,
1482 dbg_pkt_count => dbg_pkt_count,
1483 dbg_pkt_count_reset => dbg_pkt_count_reset,
1484 flx_backpressure => flx_backpressure,
1485 flx_backpressure_bit => flx_backpressure_bit,
1486 stop_proc => stop_proc,
1487 l1id_max_l1id => l1id_max_l1id,
1488 l1id_measure_max => l1id_measure_max,
1489 l1id_measure_last => l1id_measure_last,
1490 clr_pkt_wait_timer => clr_pkt_wait_timer,
1492 timeout_counter_max => timeout_counter_max,
1493 max_chan => max_chan,
1494 clr_max_timeout => clr_max_timeout,
1496 last_chan => last_chan,
1497 nxt_chan_0 => nxt_chan_0,
1498 chan_pointer_reset => chan_pointer_reset
1501 end generate gen_reg;
1503 full_mode_ctrl <= full_mode_ctrl_i;
1504 flx_bp_enable <= full_mode_ctrl_i(4);
1505 wdog_fifo_reset <= wdog_fifo_reset_i;
1511 flx_backpressure_tob <= flx_backpressure_bit;
1517 current_chan => current_chan,
1518 chan_out => dum_chin,
1520 num_chan => last_chan
(4 downto 0),