37 use IEEE.STD_LOGIC_1164.
ALL;
38 use ieee.std_logic_unsigned.
all;
41 use IEEE.NUMERIC_STD.
ALL;
99 channel_num : STD_LOGIC_VECTOR (11 downto 0) := "000000000000";
100 lmem : STD_LOGIC_VECTOR (3 downto 0) := "0000";
101 max_packet_length : STD_LOGIC_VECTOR (15 downto 0) := x"02FF";
104 debug : integer := 1;
105 axi_fifo : integer := 0;
107 bp_width : integer := 64;
108 fifo_instr : integer := 0;
113 length_lsb : integer := 20;
114 length_msb : integer := 31
129 ipb_clk : in std_logic;
130 ipb_rst : in std_logic;
131 ipb_in : in ipb_wbus;
132 ipb_out : out ipb_rbus;
135 aurora_chan_stat : in STD_LOGIC_VECTOR (31 downto 0);
138 tob_fifo_busy_threshold : in STD_LOGIC_VECTOR (15 downto 0);
139 bulk_fifo_busy_threshold : in STD_LOGIC_VECTOR (15 downto 0);
140 tob_fifo_xoff_threshold : in STD_LOGIC_VECTOR (15 downto 0);
141 bulk_fifo_xoff_threshold : in STD_LOGIC_VECTOR (15 downto 0);
143 time_count : in STD_LOGIC_VECTOR (31 downto 0);
144 aurora_channel_control : out STD_LOGIC_VECTOR (31 downto 0);
145 backplane_control : in STD_LOGIC_VECTOR (31 downto 0);
146 chan_disable : in std_logic;
147 init_clk : in std_logic;
148 bp_reg_reset : in std_logic;
149 master_reset : in std_logic;
150 wdog_fifo_reset : in STD_LOGIC;
153 RESET : in std_logic;
154 clk_160 : in std_logic;
155 rt_clk : in std_logic;
156 aurora_user_clk : in std_logic;
157 pp_clock : in std_logic;
158 s_axis_tvalid : in std_logic;
159 s_axis_tlast : in std_logic;
160 tob_s_tready : out std_logic;
161 s_axis_tdata : in std_logic_vector((bp_width-1) downto 0);
165 poll_chan : in std_logic;
167 tob_m_tvalid : out std_logic;
168 tob_m_tlast : out std_logic;
169 tob_m_tready : in std_logic;
170 tob_m_tdata : out std_logic_vector((bp_width-1) downto 0);
173 tob_header_marker : out std_logic;
174 tob_tail_marker : out std_logic;
175 hdr_crc_tag : out std_logic;
176 comb_error_tag : out std_logic;
179 calo_poll_chan : in std_logic;
180 calo_m_tvalid : out std_logic;
181 calo_m_fifo_tlast : out std_logic;
182 calo_m_axis_tready : in std_logic;
183 calo_s_axis_tready : out std_logic;
185 calo_m_axis_tdata : out std_logic_vector((bp_width-1) downto 0);
186 calo_header_marker : out std_logic;
187 calo_tail_marker : out std_logic;
190 s_axi_ufc_rx_tdata : in std_logic_vector(63 downto 0);
191 s_axi_ufc_rx_tvalid : in std_logic;
192 s_axi_ufc_rx_tlast : in std_logic;
194 channel_busy : out std_logic;
195 timeout_err : in std_logic;
206 channel_num :
STD_LOGIC_VECTOR (
11 downto 0) := channel_num;
207 lmem :
STD_LOGIC_VECTOR (
3 downto 0) := lmem;
208 max_packet_length :
STD_LOGIC_VECTOR (
15 downto 0) := max_packet_length
210 Port ( pp_clock :
in STD_LOGIC;
211 aurora_user_clk :
in STD_LOGIC;
212 reset :
in STD_LOGIC;
213 aurora_chan_stat :
in STD_LOGIC_VECTOR (
31 downto 0);
214 s_axis_tvalid :
in STD_LOGIC;
215 s_axis_tlast :
in STD_LOGIC;
216 s_axis_tdata :
in STD_LOGIC_VECTOR (
63 downto 0);
217 m_axis_tvalid :
out STD_LOGIC;
218 m_axis_tlast :
out STD_LOGIC;
219 m_axis_tdata :
out STD_LOGIC_VECTOR (
63 downto 0);
220 m_first_cyc :
out STD_LOGIC;
221 crc_error :
out STD_LOGIC;
222 m_tval_tob :
out STD_LOGIC;
223 m_tval_calo :
out STD_LOGIC;
224 pkt_len_violation :
out STD_LOGIC;
225 comb_error :
in STD_LOGIC;
226 m_comb_error :
out std_logic
234 COMPONENT clock_cross_fifo
236 m_aclk :
IN STD_LOGIC;
237 s_aclk :
IN STD_LOGIC;
238 s_aresetn :
IN STD_LOGIC;
239 s_axis_tvalid :
IN STD_LOGIC;
240 s_axis_tready :
OUT STD_LOGIC;
241 s_axis_tdata :
IN STD_LOGIC_VECTOR(
63 DOWNTO 0);
242 s_axis_tlast :
IN STD_LOGIC;
243 s_axis_tuser :
IN STD_LOGIC_VECTOR(
3 DOWNTO 0);
244 m_axis_tvalid :
OUT STD_LOGIC;
245 m_axis_tready :
IN STD_LOGIC;
246 m_axis_tdata :
OUT STD_LOGIC_VECTOR(
63 DOWNTO 0);
247 m_axis_tlast :
OUT STD_LOGIC;
248 m_axis_tuser :
OUT STD_LOGIC_VECTOR(
3 DOWNTO 0);
249 axis_wr_data_count :
OUT STD_LOGIC_VECTOR(
11 DOWNTO 0);
250 axis_rd_data_count :
OUT STD_LOGIC_VECTOR(
11 DOWNTO 0)
255 COMPONENT dual_input_fifo_4K
257 m_aclk :
IN STD_LOGIC;
258 s_aclk :
IN STD_LOGIC;
259 s_aresetn :
IN STD_LOGIC;
260 s_axis_tvalid :
IN STD_LOGIC;
261 s_axis_tready :
OUT STD_LOGIC;
262 s_axis_tdata :
IN STD_LOGIC_VECTOR(
63 DOWNTO 0);
263 s_axis_tlast :
IN STD_LOGIC;
264 s_axis_tuser :
IN STD_LOGIC_VECTOR(
3 DOWNTO 0);
265 m_axis_tvalid :
OUT STD_LOGIC;
266 m_axis_tready :
IN STD_LOGIC;
267 m_axis_tdata :
OUT STD_LOGIC_VECTOR(
63 DOWNTO 0);
268 m_axis_tlast :
OUT STD_LOGIC;
269 m_axis_tuser :
OUT STD_LOGIC_VECTOR(
3 DOWNTO 0);
270 axis_wr_data_count :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0);
271 axis_rd_data_count :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0)
278 m_aclk :
IN STD_LOGIC;
279 s_aclk :
IN STD_LOGIC;
280 s_aresetn :
IN STD_LOGIC;
281 s_axis_tvalid :
IN STD_LOGIC;
282 s_axis_tready :
OUT STD_LOGIC;
283 s_axis_tdata :
IN STD_LOGIC_VECTOR(
63 DOWNTO 0);
284 s_axis_tlast :
IN STD_LOGIC;
285 s_axis_tuser :
IN STD_LOGIC_VECTOR(
3 DOWNTO 0);
286 m_axis_tvalid :
OUT STD_LOGIC;
287 m_axis_tready :
IN STD_LOGIC;
288 m_axis_tdata :
OUT STD_LOGIC_VECTOR(
63 DOWNTO 0);
289 m_axis_tlast :
OUT STD_LOGIC;
290 m_axis_tuser :
OUT STD_LOGIC_VECTOR(
3 DOWNTO 0);
291 axis_wr_data_count :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0);
292 axis_rd_data_count :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0);
293 timeout_err :
in std_logic
298 COMPONENT axis_input_fifo
300 s_axis_aresetn :
IN STD_LOGIC;
301 s_axis_aclk :
IN STD_LOGIC;
302 s_axis_tvalid :
IN STD_LOGIC;
303 s_axis_tready :
OUT STD_LOGIC;
304 s_axis_tdata :
IN STD_LOGIC_VECTOR(
63 DOWNTO 0);
305 s_axis_tlast :
IN STD_LOGIC;
306 s_axis_tuser :
IN STD_LOGIC_VECTOR(
3 DOWNTO 0);
307 m_axis_aclk :
IN STD_LOGIC;
308 m_axis_tvalid :
OUT STD_LOGIC;
309 m_axis_tready :
IN STD_LOGIC;
310 m_axis_tdata :
OUT STD_LOGIC_VECTOR(
63 DOWNTO 0);
311 m_axis_tlast :
OUT STD_LOGIC;
312 m_axis_tuser :
OUT STD_LOGIC_VECTOR(
3 DOWNTO 0);
313 axis_wr_data_count :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0);
314 axis_rd_data_count :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0)
332 COMPONENT aurora_fifo_in_ila
336 probe0 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
337 probe1 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
338 probe2 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
339 probe3 :
IN STD_LOGIC_VECTOR(
63 DOWNTO 0);
340 probe4 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
341 probe5 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
342 probe6 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
343 probe7 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
344 probe8 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
345 probe9 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
346 probe10 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
347 probe11 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
348 probe12 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
349 probe13 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
350 probe14 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
351 probe15 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
352 probe16 :
IN STD_LOGIC_VECTOR(
2 DOWNTO 0)
355 COMPONENT aurora_fifo_out_ila
360 probe0 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
361 probe1 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
362 probe2 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
363 probe3 :
IN STD_LOGIC_VECTOR(
63 DOWNTO 0);
364 probe4 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
365 probe5 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
366 probe6 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
367 probe7 :
IN STD_LOGIC_VECTOR(
10 DOWNTO 0);
368 probe8 :
IN STD_LOGIC_VECTOR(
10 DOWNTO 0);
369 probe9 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0)
373 COMPONENT data_fifo_vio
376 probe_in0 :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
377 probe_out0 :
OUT STD_LOGIC_VECTOR(
0 DOWNTO 0)
387 ipb_clk:
in std_logic;
388 ipb_rst:
in std_logic;
390 ipb_out:
out ipb_rbus;
392 pp_clock :
in std_logic;
393 clk_160 :
in std_logic;
394 rt_clk :
in std_logic;
396 aurora_user_clk :
in std_logic;
397 aurora_chan_stat :
in STD_LOGIC_VECTOR (
31 downto 0);
398 tob_fifo_level:
in STD_LOGIC_VECTOR (
15 downto 0);
399 bulk_fifo_level:
in STD_LOGIC_VECTOR (
15 downto 0);
400 time_count :
in STD_LOGIC_VECTOR (
31 downto 0);
403 tob_fifo_busy_threshold :
in STD_LOGIC_VECTOR (
15 downto 0);
405 bulk_fifo_busy_threshold :
in STD_LOGIC_VECTOR (
15 downto 0);
406 tob_fifo_xoff_threshold :
in STD_LOGIC_VECTOR (
15 downto 0);
407 bulk_fifo_xoff_threshold :
in STD_LOGIC_VECTOR (
15 downto 0);
409 hdr_crc_tag :
in std_logic;
411 aurora_channel_control :
out STD_LOGIC_VECTOR (
31 downto 0);
412 chan_disable :
in std_logic;
413 init_clk :
in std_logic;
414 bp_reg_reset :
in std_logic;
415 master_reset :
in std_logic;
417 pkt_len_violation :
in STD_LOGIC;
423 ufc_message :
in STD_LOGIC_Vector(
7 downto 0);
424 ufc_parity_error :
in STD_LOGIC;
425 ufc_channel_Busy :
in STD_LOgic;
426 ufc_parity_disable :
out std_logic;
427 channel_busy :
out std_logic;
430 s_tvalid :
in std_logic;
431 repeat_l1id_counter :
in STD_LOGIC_vector(
31 downto 0);
432 repeat_l1id_counter_reset :
out STD_LOGIC;
433 packets_read_counter :
in STD_LOGIC_vector(
31 downto 0);
434 packets_read_counter_reset:
out STD_LOGIC
447 Port ( clock :
in STD_LOGIC;
448 reset :
in STD_LOGIC;
449 axi_ufc_rx_tvalid :
in STD_LOGIC;
450 axi_ufc_rx_tlast :
in STD_LOGIC;
451 axi_ufc_rx_tdata :
in STD_LOGIC_Vector(
15 downto 0);
453 ufc_message :
out STD_LOGIC_Vector(
7 downto 0);
454 ufc_parity_error :
out STD_LOGIC;
455 ufc_parity_disable :
out std_logic;
456 ufc_channel_busy :
out STD_LOGIC
463 COUNTER_WIDTH :
integer :=
5
466 clock :
in STD_LOGIC;
467 reset :
in STD_LOGIC;
468 pulse_in :
in STD_LOGIC;
469 pulse_out :
out STD_LOGIC
475 signal m_axis_tready : STD_LOGIC;
476 signal tob_m_axis_tdata : STD_LOGIC_VECTOR ((bp_width-1) downto 0);
478 signal axis_data_count : STD_LOGIC_VECTOR (31 downto 0);
479 signal axis_wr_data_count : STD_LOGIC_VECTOR (10 downto 0);
480 signal axis_rd_data_count : STD_LOGIC_VECTOR (10 downto 0);
481 signal s_axis_aresetn : STD_LOGIC;
482 signal m_axis_aresetn : STD_LOGIC;
484 signal tvalid_prev : STD_LOGIC := '0';
485 signal first_cyc : STD_LOGIC;
488 signal poll_reg : STD_LOGIC := '0';
490 signal len_count : STD_LOGIC_VECTOR (11 downto 0);
491 signal frag_length : STD_LOGIC_VECTOR (11 downto 0);
492 signal t_last_delay : STD_LOGIC;
493 signal no_complete_frag : STD_LOGIC;
494 signal m_fifo_tlast : STD_LOGIC;
495 signal rd_len_fifo : STD_LOGIC;
496 signal hdr_length : STD_LOGIC_VECTOR ((length_msb - length_lsb) downto 0);
497 signal length_error : STD_LOGIC;
501 signal pipe_m_tval_tob : STD_LOGIC;
502 signal tob_fifo_en : STD_LOGIC;
504 signal pipe_m_tval_calo : STD_LOGIC;
505 signal calo_fifo_en : STD_LOGIC;
506 signal calo_fifo_tvalid : STD_LOGIC;
507 signal tob_fifo_tvalid : STD_LOGIC;
508 signal tob_axis_rd_data_count : STD_LOGIC_VECTOR (31 downto 0);
509 signal tob_axis_wr_data_count : STD_LOGIC_VECTOR (31 downto 0);
511 signal calo_axis_data_count : STD_LOGIC_VECTOR (31 downto 0);
512 signal calo_axis_wr_data_count : STD_LOGIC_VECTOR (31 downto 0);
513 signal calo_axis_rd_data_count : STD_LOGIC_VECTOR (31 downto 0);
515 signal calo_int_axis_tready : STD_LOGIC;
516 signal calo_poll_reg : STD_LOGIC := '0';
517 signal calo_header_marker_i : std_logic;
518 signal calo_tail_marker_i : std_logic;
521 signal cc_int_axis_tready_i : STD_LOGIC;
522 signal cc_poll_reg : STD_LOGIC := '0';
523 signal tob_header_marker_i : std_logic;
524 signal tob_tail_marker_i : std_logic;
526 signal cc_tob_fifo_en : std_logic;
528 signal s_axis_tready_i : std_logic;
529 signal m_tvalid_i : std_logic;
531 signal tob_trans : std_logic;
532 signal tob_buf_tvalid : std_logic;
534 signal calo_s_axis_tready_i : std_logic;
535 signal calo_m_tvalid_i : std_logic;
536 signal calo_m_fifo_tlast_i : std_logic;
537 signal calo_m_axis_tdata_i : std_logic_vector (63 downto 0);
539 signal fifo_vio_reset : std_logic;
540 signal reset_i : std_logic;
541 signal RESET_stretch_i : std_logic;
543 signal tob_fifo_reset : std_logic;
544 signal bulk_fifo_reset : std_logic;
545 signal n_tob_fifo_reset : std_logic;
546 signal n_bulk_fifo_reset : std_logic;
547 signal aurora_channel_control_i : STD_LOGIC_VECTOR (31 downto 0);
549 signal pipe_m_axis_tvalid : std_logic;
550 signal pipe_m_axis_tlast : std_logic;
551 signal pipe_m_axis_tdata : std_logic_vector (63 downto 0);
552 signal pipe_m_first_cyc : std_logic;
553 signal s_crc_error : std_logic;
554 signal m_crc_error : std_logic;
555 signal tob_m_axis_tuser : std_logic_vector (3 downto 0);
556 signal calo_m_axis_tuser : std_logic_vector (3 downto 0);
557 signal crc_tag : std_logic;
558 signal hdr_crc_tag_i : std_logic;
559 signal pkt_len_violation : STD_LOGIC;
561 signal ufc_message : STD_LOGIC_Vector(7 downto 0);
562 signal ufc_parity_error : STD_LOGIC;
563 signal ufc_channel_busy : STD_LOGIC;
564 signal ufc_parity_disable : std_logic;
565 signal test_signal : STD_LOGIC;
567 signal comb_error : STD_logic;
568 signal pipe_m_comb_error : STD_LOGIC;
570 signal last_l1id : STD_LOGIC_vector(31 downto 0);
571 signal current_l1id : STD_LOGIC_vector(31 downto 0);
572 signal first_event : STD_LOGIC;
573 signal repeat_l1id_counter : STD_LOGIC_vector(31 downto 0);
574 signal repeat_l1id_counter_reset : STD_LOGIC;
575 signal packets_read_counter : STD_LOGIC_vector(31 downto 0);
576 signal packets_read_counter_reset : STD_LOGIC;
581 aurora_channel_control <= aurora_channel_control_i;
583 tob_fifo_reset <= aurora_channel_control_i(3) or RESET;
584 bulk_fifo_reset <= aurora_channel_control_i(4) or RESET;
586 n_tob_fifo_reset <= not tob_fifo_reset;
587 n_bulk_fifo_reset <= not bulk_fifo_reset;
590 comb_error <= aurora_chan_stat(8) or aurora_chan_stat(9) or aurora_chan_stat(10) or aurora_chan_stat(11) or not aurora_chan_stat(0);
599 s_axis_aresetn <= not RESET_stretch_i;
600 m_axis_aresetn <= not RESET_stretch_i;
615 pulse_out => Reset_stretch_i
618 tob_s_tready <= s_axis_tready_i;
619 tob_m_tvalid <= m_tvalid_i;
623 channel_num => channel_num,
625 max_packet_length => max_packet_length
628 pp_clock => pp_clock,
629 aurora_user_clk => aurora_user_clk,
630 reset => reset_stretch_i,
631 aurora_chan_stat => aurora_chan_stat,
632 s_axis_tvalid => s_axis_tvalid,
633 s_axis_tlast => s_axis_tlast,
634 s_axis_tdata => s_axis_tdata,
635 m_axis_tvalid => pipe_m_axis_tvalid,
636 m_axis_tlast => pipe_m_axis_tlast,
637 m_first_cyc => pipe_m_first_cyc,
638 m_tval_tob => pipe_m_tval_tob,
639 m_tval_calo => pipe_m_tval_calo,
640 m_axis_tdata => pipe_m_axis_tdata,
641 crc_error => s_crc_error,
642 pkt_len_violation => pkt_len_violation,
643 comb_error => comb_error,
644 m_comb_error => pipe_m_comb_error
648 hdr_crc_tag_i <= tob_m_axis_tuser(2) AND tob_m_axis_tuser(0);
649 hdr_crc_tag <= hdr_crc_tag_i;
650 comb_error_tag <= tob_m_axis_tuser(3);
652 norm_fifo: if axi_fifo=0 generate
655 no_fifo_ila: if ((fifo_instr = 0) or (jfex = 0)) generate
662 s_aclk => aurora_user_clk,
663 s_aresetn => s_axis_aresetn,
665 s_axis_tvalid => tob_fifo_tvalid,
666 s_axis_tready => s_axis_tready_i,
667 s_axis_tdata => pipe_m_axis_tdata,
668 s_axis_tlast => pipe_m_axis_tlast,
669 s_axis_tuser
(0) => first_cyc,
670 s_axis_tuser
(1) => pipe_m_axis_tlast,
671 s_axis_tuser
(2) => s_crc_error,
672 s_axis_tuser
(3) => pipe_m_comb_error,
673 m_axis_tvalid => m_tvalid_i,
674 m_axis_tready => cc_int_axis_tready_i,
675 m_axis_tdata => tob_m_axis_tdata,
676 m_axis_tlast => m_fifo_tlast,
677 m_axis_tuser => tob_m_axis_tuser,
684 axis_wr_data_count => tob_axis_wr_data_count
(31 downto 0),
685 axis_rd_data_count => tob_axis_rd_data_count
(31 downto 0)
690 end generate no_fifo_ila;
692 fifo_ila: if ((fifo_instr = 1) and (jfex = 1)) generate
698 s_aclk => aurora_user_clk,
699 s_aresetn => s_axis_aresetn,
701 s_axis_tvalid => tob_fifo_tvalid,
702 s_axis_tready => s_axis_tready_i,
703 s_axis_tdata => pipe_m_axis_tdata,
704 s_axis_tlast => pipe_m_axis_tlast,
705 s_axis_tuser
(0) => first_cyc,
706 s_axis_tuser
(1) => pipe_m_axis_tlast,
707 s_axis_tuser
(2) => s_crc_error,
708 s_axis_tuser
(3) => pipe_m_comb_error,
709 m_axis_tvalid => m_tvalid_i,
710 m_axis_tready => cc_int_axis_tready_i,
711 m_axis_tdata => tob_m_axis_tdata,
712 m_axis_tlast => m_fifo_tlast,
713 m_axis_tuser => tob_m_axis_tuser,
720 axis_wr_data_count => tob_axis_wr_data_count
(31 downto 0),
721 axis_rd_data_count => tob_axis_rd_data_count
(31 downto 0),
723 timeout_err => timeout_err
726 end generate fifo_ila;
738 s_aclk => aurora_user_clk,
740 s_aresetn => s_axis_aresetn,
744 s_axis_tvalid => calo_fifo_tvalid,
745 s_axis_tready => calo_s_axis_tready_i,
746 s_axis_tdata => pipe_m_axis_tdata,
747 s_axis_tlast => pipe_m_axis_tlast,
749 s_axis_tuser
(0) => pipe_m_first_cyc,
750 s_axis_tuser
(1) => pipe_m_axis_tlast,
751 s_axis_tuser
(2) => '0',
752 s_axis_tuser
(3) => '0',
754 m_axis_tvalid => calo_m_tvalid_i,
755 m_axis_tready => calo_int_axis_tready,
756 m_axis_tdata => calo_m_axis_tdata_i,
757 m_axis_tlast => calo_m_fifo_tlast_i,
758 m_axis_tuser => calo_m_axis_tuser,
762 axis_wr_data_count => calo_axis_wr_data_count
(31 downto 0),
763 axis_rd_data_count => calo_axis_rd_data_count
(31 downto 0)
765 end generate norm_fifo;
767 axi_type_fifo: if axi_fifo=1 generate
769 clk_cross_tob_fifo : axis_input_fifo
771 s_axis_aresetn => s_axis_aresetn,
772 s_axis_aclk => aurora_user_clk,
773 s_axis_tvalid => tob_fifo_tvalid,
774 s_axis_tready => s_axis_tready_i,
775 s_axis_tdata => pipe_m_axis_tdata,
776 s_axis_tlast => pipe_m_axis_tlast,
777 s_axis_tuser
(0) => pipe_m_first_cyc,
778 s_axis_tuser
(1) => pipe_m_axis_tlast,
779 s_axis_tuser
(2) => s_crc_error,
780 s_axis_tuser
(3) => pipe_m_comb_error,
781 m_axis_aclk => pp_clock,
782 m_axis_tvalid => m_tvalid_i,
783 m_axis_tready => cc_int_axis_tready_i,
784 m_axis_tdata => tob_m_axis_tdata,
785 m_axis_tlast => m_fifo_tlast,
786 m_axis_tuser => tob_m_axis_tuser,
787 axis_wr_data_count => tob_axis_wr_data_count,
788 axis_rd_data_count => tob_axis_rd_data_count
792 calo_fifo : axis_input_fifo
794 s_axis_aresetn => s_axis_aresetn,
795 s_axis_aclk => aurora_user_clk,
796 s_axis_tvalid => calo_fifo_tvalid,
797 s_axis_tready => calo_s_axis_tready_i,
798 s_axis_tdata => pipe_m_axis_tdata,
799 s_axis_tlast => pipe_m_axis_tlast,
800 s_axis_tuser
(0) => pipe_m_first_cyc,
801 s_axis_tuser
(1) => pipe_m_axis_tlast,
802 s_axis_tuser
(2) => '0',
803 s_axis_tuser
(3) => '0',
804 m_axis_aclk => pp_clock,
805 m_axis_tvalid => calo_m_tvalid_i,
806 m_axis_tready => calo_int_axis_tready,
807 m_axis_tdata => calo_m_axis_tdata_i,
808 m_axis_tlast => calo_m_fifo_tlast_i,
809 m_axis_tuser => calo_m_axis_tuser,
810 axis_wr_data_count => calo_axis_wr_data_count,
811 axis_rd_data_count => calo_axis_rd_data_count
814 end generate axi_type_fifo;
816 tob_header_marker_i <= tob_m_axis_tuser(0);
817 tob_tail_marker_i <= tob_m_axis_tuser(1);
818 m_crc_error <= tob_m_axis_tuser(2);
822 chan_dbg: if debug=1 generate
823 tob_fifo_in_ila : aurora_fifo_in_ila
825 clk => aurora_user_clk,
827 probe0
(0) => pipe_m_axis_tvalid,
828 probe1
(0) => tob_fifo_tvalid,
829 probe2
(0) => pipe_m_axis_tlast,
831 probe3 => pipe_m_axis_tdata,
832 probe4
(0) => s_axis_tready_i,
833 probe5
(0) => pipe_m_first_cyc,
834 probe6
(0) => tob_trans,
835 probe7
(0) => pipe_m_tval_tob,
836 probe8
(0) => pipe_m_axis_tdata
(7),
837 probe9
(0) => first_cyc,
838 probe10
(0) => pipe_m_tval_calo,
839 probe11
(0) => calo_fifo_tvalid,
840 probe12
(0) => s_crc_error,
841 probe13 =>
(others => '0'
),
842 probe14 =>
(others => '0'
),
843 probe15 =>
(others => '0'
),
844 probe16 =>
(others => '0'
)
849 tob_fifo_out_ila : aurora_fifo_out_ila
852 probe0
(0) => m_tvalid_i,
853 probe1
(0) => m_fifo_tlast,
854 probe2
(0) => cc_int_axis_tready_i,
855 probe3 => tob_m_axis_tdata,
856 probe4
(0) => tob_header_marker_i,
857 probe5
(0) => tob_tail_marker_i,
858 probe6
(0) => s_axis_tready_i,
859 probe7 => tob_axis_rd_data_count
(10 downto 0),
860 probe8 => tob_axis_wr_data_count
(10 downto 0),
862 probe9
(0) => hdr_crc_tag_i
865 calo_fifo_out_ila : aurora_fifo_out_ila
868 probe0
(0) => calo_m_tvalid_i,
869 probe1
(0) => calo_m_fifo_tlast_i,
870 probe2
(0) => calo_int_axis_tready,
871 probe3 => calo_m_axis_tdata_i,
872 probe4
(0) => calo_header_marker_i,
873 probe5
(0) => calo_tail_marker_i,
874 probe6
(0) => calo_s_axis_tready_i,
875 probe7 => calo_axis_rd_data_count
(10 downto 0),
876 probe8 => calo_axis_wr_data_count
(10 downto 0),
877 probe9
(0) => hdr_crc_tag_i
883 channel_fifo_vio: data_fifo_vio
886 probe_in0
(0) => reset_stretch_i,
887 probe_out0
(0) => fifo_vio_reset
889 end generate chan_dbg;
891 chan_no_dbg: if debug=0 generate
892 fifo_vio_reset <= '0';
893 end generate chan_no_dbg;
898 reset_i <= reset or wdog_fifo_reset or fifo_vio_reset or aurora_channel_control(3) or aurora_channel_control(4) or backplane_control(5) or backplane_control(31);
902 calo_header_marker_i <= calo_m_axis_tuser(0);
903 calo_tail_marker_i <= calo_m_axis_tuser(1);
905 calo_m_tvalid <= calo_m_tvalid_i;
906 calo_s_axis_tready <= calo_s_axis_tready_i;
907 calo_m_fifo_tlast <= calo_m_fifo_tlast_i;
908 calo_m_axis_tdata <= calo_m_axis_tdata_i;
912 process (aurora_user_clk)
begin
913 if rising_edge (aurora_user_clk) then
914 tvalid_prev <= (not pipe_m_axis_tvalid) or (pipe_m_axis_tlast and pipe_m_axis_tvalid);
919 first_cyc <= pipe_m_axis_tvalid and tvalid_prev and not pipe_m_axis_tlast and not tob_trans and not calo_fifo_en;
936 process (aurora_user_clk)
begin
937 if rising_edge (aurora_user_clk) then
938 if (pipe_m_tval_tob = '1') and (pipe_m_axis_tlast = '0') and (RESET_stretch_i = '0') then
940 elsif (((pipe_m_axis_tvalid and pipe_m_axis_tlast) = '1') or (RESET_stretch_i = '1')) then
943 tob_trans <= tob_trans;
951 tob_fifo_tvalid <= (pipe_m_tval_tob OR tob_trans) AND pipe_m_axis_tvalid;
963 process (aurora_user_clk)
begin
964 if rising_edge (aurora_user_clk) then
965 if (pipe_m_tval_calo = '1') and (pipe_m_axis_tlast = '0')and (RESET_stretch_i = '0') then
967 elsif (((pipe_m_axis_tvalid and pipe_m_axis_tlast) = '1') or (RESET_stretch_i = '1')) then
970 calo_fifo_en <= calo_fifo_en;
976 calo_fifo_tvalid <= (calo_fifo_en or pipe_m_tval_calo) AND pipe_m_axis_tvalid;
982 process (pp_clock)
begin
983 if rising_edge (pp_clock) then
984 if (tob_header_marker_i = '1') and (poll_chan = '1') then
986 elsif (RESET_stretch_i = '1') or ((cc_poll_reg = '1') and (tob_tail_marker_i = '1')) then
994 process (pp_clock)
begin
995 if rising_edge (pp_clock) then
996 if (calo_header_marker_i = '1') and (calo_poll_chan = '1') then
997 calo_poll_reg <= '1';
998 elsif (RESET_stretch_i = '1') or ((calo_poll_reg = '1') and (calo_tail_marker_i = '1')) then
999 calo_poll_reg <= '0';
1011 process (aurora_user_clk)
begin
1012 if rising_edge (aurora_user_clk) then
1013 if (pipe_m_axis_tvalid = '1') and (pipe_m_axis_tlast = '1') and (reset_stretch_i ='0') then
1014 t_last_delay <= '1';
1016 t_last_delay <= '0';
1042 process (pp_clock)
begin
1043 if rising_edge (pp_clock) then
1044 if (reset_stretch_i = '1')or ((tob_header_marker_i = '1') and (frag_length = hdr_length) and (no_complete_frag = '0')) then
1045 length_error <= '0';
1046 elsif (tob_header_marker_i = '1') and (frag_length /= hdr_length) and (no_complete_frag = '0') then
1047 length_error <= '1';
1058 hdr_length <= tob_m_axis_tdata(length_msb downto length_lsb);
1059 current_l1id <= tob_m_axis_tdata(63 downto 32);
1061 tob_m_tlast <= m_fifo_tlast;
1062 tob_m_tdata <= tob_m_axis_tdata;
1064 calo_int_axis_tready <= (not (calo_header_marker_i and not calo_poll_reg)) and calo_m_axis_tready;
1066 calo_header_marker <= calo_header_marker_i;
1067 calo_tail_marker <= calo_tail_marker_i;
1070 cc_int_axis_tready_i <= (not (tob_header_marker_i and not cc_poll_reg)) and tob_m_tready;
1071 tob_header_marker <= tob_header_marker_i;
1072 tob_tail_marker <= tob_tail_marker_i;
1077 clock => aurora_user_clk,
1078 reset => reset_stretch_i,
1079 axi_ufc_rx_tvalid => s_axi_ufc_rx_tvalid,
1080 axi_ufc_rx_tlast => s_axi_ufc_rx_tlast,
1081 axi_ufc_rx_tdata => s_axi_ufc_rx_tdata
(15 downto 0),
1083 ufc_message => ufc_message,
1084 ufc_parity_error => ufc_parity_error,
1085 ufc_parity_disable => ufc_parity_disable,
1086 ufc_channel_Busy => ufc_channel_busy
1096 process (pp_clock)
begin
1097 if rising_edge (pp_clock) then
1099 last_l1id <= (others=> '0');
1100 elsif (poll_chan = '1') then
1101 last_l1id <= current_l1id;
1107 process (pp_clock)
begin
1108 if rising_edge (pp_clock) then
1111 elsif (poll_chan = '1') then
1118 process (pp_clock)
begin
1119 if rising_edge (pp_clock) then
1120 if (reset = '1') or (repeat_l1id_counter_reset = '1') then
1121 repeat_l1id_counter <= (others => '0');
1122 elsif (poll_chan = '1') and (current_L1id = last_l1id) and (first_event = '0') and (repeat_l1id_counter <= x"ffffffff") then
1123 repeat_l1id_counter <= (repeat_l1id_counter + '1');
1130 process (pp_clock)
begin
1131 if rising_edge (pp_clock) then
1132 if (reset = '1') or (packets_read_counter_reset = '1') then
1133 packets_read_counter <= (others => '0');
1134 elsif (poll_chan = '1') and (packets_read_counter <= x"ffffffff") then
1135 packets_read_counter <= (packets_read_counter + '1');
1145 gen_reg: if SIM=0 generate
1156 pp_clock => pp_clock,
1160 aurora_user_clk => aurora_user_clk,
1161 aurora_chan_stat => aurora_chan_stat,
1162 tob_fifo_level => tob_axis_rd_data_count
(15 downto 0),
1163 bulk_fifo_level => calo_axis_rd_data_count
(15 downto 0),
1165 time_count => time_count,
1166 tob_fifo_busy_threshold => tob_fifo_busy_threshold,
1167 bulk_fifo_busy_threshold => bulk_fifo_busy_threshold,
1168 tob_fifo_xoff_threshold => tob_fifo_xoff_threshold,
1169 bulk_fifo_xoff_threshold => bulk_fifo_xoff_threshold,
1171 hdr_crc_tag => hdr_crc_tag_i,
1173 aurora_channel_control => aurora_channel_control_i,
1174 chan_disable => chan_disable,
1175 init_clk => init_clk,
1176 bp_reg_reset => bp_reg_reset,
1177 master_reset => master_reset,
1178 pkt_len_violation => pkt_len_violation,
1184 ufc_message => ufc_message,
1185 ufc_parity_error => ufc_parity_error,
1186 ufc_channel_busy => ufc_channel_busy,
1187 ufc_parity_disable => ufc_parity_disable,
1188 channel_busy => channel_busy,
1192 s_tvalid => m_tvalid_i,
1194 repeat_l1id_counter => repeat_l1id_counter,
1195 repeat_l1id_counter_reset => repeat_l1id_counter_reset,
1196 packets_read_counter => packets_read_counter,
1197 packets_read_counter_reset => packets_read_counter_reset
1208 end generate gen_reg;
1210 gen_sim: if SIM=1 generate
1212 channel_busy <= ufc_channel_busy;
1216 end generate gen_sim;
--------------------------------------------------- Backplane Control Bus bit Definitions -----------...