70 use IEEE.STD_LOGIC_1164.
all;
71 use ieee.numeric_std.
all;
73 use unisim.VComponents.
all;
78 use ipbus_lib.ipbus.
all;
80 library infrastructure_lib;
81 use infrastructure_lib.all;
88 library TOB_rdout_lib;
91 use tob_rdout_lib.tob_rdout_comp_pkg.
all;
93 use infrastructure_lib.
golden.
all;
110 TOP_SHA : std_logic_vector(31 downto 0) := x"00000000";
112 TOP_VER : std_logic_vector(31 downto 0) := x"00000000";
115 CON_SHA : std_logic_vector(31 downto 0) := x"00000000";
117 CON_VER : std_logic_vector(31 downto 0) := x"00000000";
120 XML_SHA : std_logic_vector(31 downto 0) := x"00000000";
123 XML_VER : std_logic_vector(31 downto 0) := x"00000000";
126 HOG_SHA : std_logic_vector(31 downto 0) := x"00000000";
128 HOG_VER : std_logic_vector(31 downto 0) := x"00000000";
151 READOUT_ENABLED : boolean := true;
152 INPUT_RAM_ENABLED : boolean := false;
153 OUTPUT_RAMS_ENABLED : boolean := false;
154 SORT_IN_RAM_ENABLED : boolean := false;
155 SORT_OUT_RAM_ENABLED : boolean := false;
156 MGT_ENABLED : boolean := true;
157 MERGE_ENABLED : boolean := true;
158 DATA_PATH_ENABLED : boolean := true;
160 TAU_ALGO_VERSION : std_logic_vector(1 downto 0) := "10";
161 EG_ALGO_VERSION : std_logic_vector(1 downto 0) := "01";
170 n_channels : natural := 64);
179 flash_csn : out std_logic;
180 flash_mosi : out std_logic;
181 flash_miso : in std_logic;
182 flash_led : out std_logic;
183 ttc_clk_p : in std_logic;
184 ttc_clk_n : in std_logic;
186 hardware_addr : in std_logic_vector (11 downto 0);
189 VAUXP, VAUXN : in std_logic;
190 Vp, Vn : in std_logic;
195 efex_in : in efex_processor_input;
196 efex_out : out efex_processor_output
209 SYS_W :
integer :=
16;
211 DEV_W :
integer :=
16);
215 data_in_from_pins_p :
in std_logic_vector(SYS_W
-1 downto 0);
216 data_in_from_pins_n :
in std_logic_vector(SYS_W
-1 downto 0);
217 data_in_to_device :
out std_logic_vector(DEV_W
-1 downto 0);
220 delay_clk :
in std_logic;
221 in_delay_reset :
in std_logic;
222 in_delay_data_ce :
in std_logic_vector(SYS_W
-1 downto 0);
223 in_delay_data_inc :
in std_logic_vector(SYS_W
-1 downto 0);
224 in_delay_tap_in :
in std_logic_vector(
5*SYS_W
-1 downto 0);
225 in_delay_tap_out :
out std_logic_vector(
5*SYS_W
-1 downto 0);
226 delay_locked :
out std_logic;
227 ref_clock :
in std_logic;
230 clk_in :
in std_logic;
231 io_reset :
in std_logic);
237 SYS_W :
integer :=
1;
239 DEV_W :
integer :=
1);
243 data_in_from_pins_p :
in std_logic_vector(SYS_W
-1 downto 0);
244 data_in_from_pins_n :
in std_logic_vector(SYS_W
-1 downto 0);
245 data_in_to_device :
out std_logic_vector(DEV_W
-1 downto 0);
248 delay_clk :
in std_logic;
249 in_delay_reset :
in std_logic;
250 in_delay_data_ce :
in std_logic_vector(SYS_W
-1 downto 0);
251 in_delay_data_inc :
in std_logic_vector(SYS_W
-1 downto 0);
252 in_delay_tap_in :
in std_logic_vector(
5*SYS_W
-1 downto 0);
253 in_delay_tap_out :
out std_logic_vector(
5*SYS_W
-1 downto 0);
254 delay_locked :
out std_logic;
255 ref_clock :
in std_logic;
258 clk_in :
in std_logic;
259 io_reset :
in std_logic);
279 signal rxn_IN : std_logic_vector (79 downto 0);
280 signal rxp_IN : std_logic_vector (79 downto 0);
295 signal txn_OUT : std_logic_vector (77 downto 0);
296 signal txp_OUT : std_logic_vector (77 downto 0);
303 signal MGT_QUAD_ENABLE : std_logic_vector(19 downto 0) := x"fffff";
304 signal MGT_USE_OTHER_CLK : std_logic_vector(19 downto 0) := x"00000";
305 signal MGT_TX_POWER : std_logic_vector(79 downto 0) := (others => '1');
306 signal MGT_RX_POWER : std_logic_vector(79 downto 0) := (others => '1');
309 signal clk200, clk_load, ipb_clk, mac_clk, clk40, clk40_rdout_i, clk280, clk280_90, clk200_iodelay : std_logic;
310 signal onehz, ipb_rst, rst_macclk, rst_ipb, start, reset, locked_40m_i : std_logic;
311 signal algo_ipb_in : ipb_rbus;
312 signal algo_ipb_out : ipb_wbus;
314 signal ipbw : ipb_wbus_array(N_SLAVES-1 downto 0);
315 signal ipbr : ipb_rbus_array(N_SLAVES-1 downto 0);
316 signal ipb_in : ipb_rbus;
317 signal ipb_out : ipb_wbus;
320 signal MGT_Commadet_int, rxdata, clk280_int : std_logic_vector (79 downto 0);
324 signal flash_clk : std_logic;
326 signal Module_ID, fpga_id, hw_position, fw_rev, fw_tag, datafmt_rev, status : std_logic_vector(31 downto 0);
327 signal trigger_reconfig, reconfig : std_logic;
329 signal control_reg, reconfig_reg : std_logic_vector (31 downto 0);
330 signal master_rx_data_int, master_tx_data_int : std_logic_vector (9 downto 0);
331 signal master_tx_pause_int : std_logic;
332 signal force_rx_error_buf : std_logic_vector(1 downto 0) := (Others => '0');
334 signal data_from_fpga_A, data_from_fpga_B, data_from_fpga_C : std_logic_vector(32 downto 0);
339 signal eg_tob_0, eg_tob_1, eg_tob_2, eg_tob_3, eg_tob_4, eg_tob_5, eg_tob_6, eg_tob_7 : std_logic_vector(31 downto 0);
342 signal OUT_eg_Sync, OUT_tau_Sync : std_logic;
343 signal OUT_eg_Valid, OUT_tau_Valid : std_logic_vector(OUTPUT_TOBS-1 downto 0);
344 signal sorted_eg_Valid, sorted_tau_start, sorted_eg_start : std_logic;
345 signal tau_tob_0, tau_tob_1, tau_tob_2, tau_tob_3, tau_tob_4, tau_tob_5, tau_tob_6, tau_tob_7 : std_logic_vector(31 downto 0);
348 signal data_merge_1, data_merge_2, data_merge_3, data_merge_4 : std_logic_vector(32 downto 0);
349 signal data_merge_i, data_merge_ii : AlgoTriggerObjects(3 downto 0) := (others => (others => '0'));
350 signal sorted_merged_Start, sorted_merged_Valid : std_logic := '0';
356 signal MGT_CLK_GTREFCLK_PAD_N_IN, MGT_CLK_GTREFCLK_PAD_P_IN, mgt_RXUSRCLK_OUT, rx_resetdone : std_logic_vector(79 downto 0);
357 signal mgt_SOFT_RESET_TX_IN, mgt_SOFT_RESET_RX_IN : std_logic_vector(19 downto 0);
358 signal tx_resetdone, mgt_TXUSRCLK_OUT : std_logic_vector(79 downto 0);
359 signal mgt_sel_tx_clk : std_logic_vector(11 downto 0);
361 signal MGT_RXN_IN, MGT_RXP_IN : mgt_rx_array (19 downto 0);
363 signal MGT_TXN_IN, MGT_TXP_IN : mgt_tx_array(19 downto 0);
364 signal rxdata_quad_array : mgt_rxdata_array (19 downto 0);
365 signal mgt_txdata : mgt_txdata_array(19 downto 0);
367 signal mgt_DATA_VALID_IN : std_logic_vector(79 downto 0);
368 signal mgt_loopback_in : mgt_loopback_array (19 downto 0);
370 signal mgt_rxchariscomma : mgt_rxchariskcomm_array(19 downto 0);
371 signal mgt_rxcharisk : mgt_rxcharisk_array(19 downto 0);
373 signal mgt_rxdisperr : mgt_rxdisperr_array(79 downto 0);
374 signal mgt_rxnotintable : mgt_rxnotintable_array(79 downto 0);
376 signal disperr_error_i, notable_error_i : std_logic_vector(79 downto 0);
378 signal mgt_rx_fsm_resetdone : std_logic_vector(79 downto 0);
379 signal mgt_tx_fsm_resetdone, qpll_fsm_reset_done : std_logic_vector(79 downto 0);
381 signal mgt_QPLLLOCK_OUT, mgt_QPLLREFCLKLOST_OUT : std_logic_vector(19 downto 0);
383 signal gt_rxpd : mgt_rxpd_array(19 downto 0);
384 signal gt_txpd : mgt_txpd_array(19 downto 0);
386 signal mgt_commdet : std_logic_vector(0 downto 0);
387 signal tx_bufstatus : std_logic_vector (159 downto 0);
388 signal rx_realign, error_counter_reset : std_logic_vector (79 downto 0);
390 signal mgt_loopback_reg : std_logic_vector (59 downto 0);
391 signal mgt_txbufstatus : mgt_txbufstatus_array(19 downto 0);
392 signal mgt_rxcommadet : mgt_rxcommadet_array (19 downto 0);
393 signal mgt_rxbyterealign : mgt_rxbyterealign_array(19 downto 0);
394 signal mgt_rx_resetdone : mgt_rxresetdone_array (19 downto 0);
395 signal mgt_rxbyteisaligned : mgt_rxbyteisaligned_array (19 downto 0);
396 signal mgt_tx_resetdone : mgt_txresetdone_array (19 downto 0);
397 signal mgt_txcharisk : mgt_txcharisk_array (19 downto 0);
399 signal rx_disperr_reg, encode_error_reg, mgt_DATA_VALID_IN_reg, rxbyteisaligned, rxdata_out : std_logic_vector (79 downto 0);
400 signal rx_disperr, txcharisk, encode_error, mgt_rxcharisk_reg : std_logic_vector (319 downto 0);
401 signal data_readout_0, data_readout_1, data_readout_2, data_readout_3 : std_logic_vector(223 downto 0);
403 signal bcn_cntr : std_logic_vector(11 downto 0);
404 signal enable_mgt, bcn_synch, crc_error_chan : std_logic_vector(79 downto 0);
405 signal sorted_tau_Valid : std_logic;
406 signal start_pulse_rst : std_logic;
407 signal BC_Reg_sel, mux_sel : std_logic_vector(319 downto 0);
409 signal reg224_latch, ttc_pipe, delay_latch : std_logic_vector(63 downto 0);
410 signal delay_num : std_logic_vector(319 downto 0);
411 signal reg224_latch_0, reg224_latch_1, reg224_latch_2, reg224_latch_3, rx_realign_0, rx_realign_1, rx_realign_2, rx_realign_3 : std_logic;
412 signal delay_latch_0, delay_latch_1, delay_latch_2, delay_latch_3, rx_resetdone_quad111 : std_logic;
413 signal delay_num_0, delay_num_1, delay_num_2, delay_num_3, rx_disperr_0, rx_disperr_1, rx_disperr_2, rx_disperr_3 : std_logic_vector(3 downto 0);
414 signal encode_error_0, encode_error_1, encode_error_2, encode_error_3 : std_logic_vector(3 downto 0);
415 signal bc_cntr_0, bc_cntr_1, bc_cntr_2, bc_cntr_3, bc_mux_cntr_0, bc_mux_cntr_1, bc_mux_cntr_2, bc_mux_cntr_3 : std_logic_vector(139 downto 0);
418 signal bcn_ref : std_logic_vector(4 downto 0);
420 signal pseudo_orbit : std_logic;
422 signal comma_0, comma_1, comma_2, comma_3, data_eq0, data_eq1, data_eq2, data_eq3 : std_logic;
423 signal data_out_0, data_out_1, data_out_2, data_out_3, phase_mux_i : std_logic_vector(31 downto 0);
424 signal test_data : std_logic_vector(33 downto 0);
425 signal rx_data_0, rx_data_1, rx_data_2, rx_data_3, rx_data_4, rx_data_5, rx_data_6, rx_data_7 : mgt_data;
426 signal txdatai_0, txdatai_1, txdatai_2, txdatai_3, txdatai_4, txdatai_5, txdatai_6, txdatai_7, txdatai_8, txdatai_9, txdatai_10, txdatai_11 : std_logic_vector (33 downto 0);
427 signal phase_mux : std_logic_vector(319 downto 0);
428 signal sorted_eg_TOB_i_gt0, sorted_eg_TOB_i_gt1, sorted_eg_TOB_i_gt2, sorted_eg_TOB_i_gt3 : std_logic_vector (33 downto 0);
429 signal sorted_eg_TOB_i_gt4, sorted_eg_TOB_i_gt5, sorted_eg_TOB_i_gt6, sorted_eg_TOB_i_gt7 : std_logic_vector (33 downto 0);
430 signal error_count_0, error_count_1, error_count_2, error_count_3, error_count_i, error_count_i_0 : unsigned(31 downto 0);
431 signal error_count_4, error_count_5, error_count_6, error_count_7 : unsigned(31 downto 0);
432 signal clear_error, comma_detect_ILA : std_logic;
433 signal error_counter : std_logic_vector(1279 downto 0);
435 attribute PRESERVE_SIGNAL : boolean;
436 signal Q210_SOFT_RESET_TX_IN_i, Q210_gt0_txresetdone_i, Q210_GT0_TX_FSM_RESET_DONE_i, Q210_GT0_RX_FSM_RESET_DONE_i : std_logic;
437 signal Q210_GT1_TX_FSM_RESET_DONE_i, Q210_GT1_RX_FSM_RESET_DONE_i, Q210_gt1_txresetdone_i, Q210_gt0_cplllock_i, Q210_gt1_cplllock_i : std_logic;
438 signal Q210_gt0_txcharisk, Q210_gt1_txcharisk, mgt210_tx_bufstatus_i : std_logic_vector(3 downto 0);
439 signal gt0_cpllfbclklost_i, gt1_cpllfbclklost_i : std_logic;
440 signal mgt210_tx_resetdone_i, mgt210_tx_fsm_resetdone_i, mgt210_txclk_i : std_logic_vector (1 downto 0);
443 signal T_TOB_sync_in_i : std_logic;
444 signal T_TOB_wr_in_i : std_logic;
445 signal TOB_BCN_sync, TOB_BCN_sync_i, TOB_BCN_sync_tau_i, TOB_BCN_sync_eg_i : std_logic;
446 signal TOB_BCN_sync_ii : std_logic;
447 signal data_merge_BCN_A_i, data_merge_BCN_B_i, data_merge_BCN_C_i : std_logic;
448 signal data_merge_BCN_A_ii, data_merge_BCN_B_ii, data_merge_BCN_C_ii : std_logic;
450 signal data_to_X_i, data_to_Y_i : std_logic_vector(32 downto 0);
454 signal arr_raw_data_in_i : RAW_data_227_type;
455 signal TOPO_TOB_out_char : std_logic;
456 signal TOPO_TOB_out : std_logic_vector(31 downto 0);
457 signal RAW_Data_out_char : std_logic;
458 signal RAW_Data_out : std_logic_vector(31 downto 0);
459 signal sorted_eg_TOB_1, sorted_tau_TOB_1 : std_logic_vector(32 downto 0);
460 signal tob_eg_in : std_logic_vector(511 downto 0);
461 signal tob_tau_in : std_logic_vector(511 downto 0);
462 signal TOB_TXOUTCLK_i, RAW_TXOUTCLK_i : std_logic;
463 signal ttc_inform : std_logic_vector (3 downto 0);
464 signal ECRID_i : std_logic_vector (7 downto 0);
465 signal L1ID_i : std_logic_vector (23 downto 0);
466 signal L1A_i, BCR_i, ECR_i, TTC_parity_i : std_logic;
467 signal privilege_read_i : std_logic;
468 signal ctrl_RAW_ready_i : std_logic;
469 signal ctrl_TOB_ready_i : std_logic;
470 signal sorted_TOB_BCN, sorted_TOB_BCN_i, sorted_TOB_BCN_ii, OUT_TOB_BCN_i : std_logic_vector (11 downto 0);
471 signal merged_TOB_BCN_i : std_logic_vector (11 downto 0);
472 signal OUT_XTOB_BCN_i : std_logic_vector (11 downto 0);
474 signal reset_tmp : std_logic;
480 signal mgt_sel_BC_Reg_sel : std_logic_vector(255 downto 0);
481 signal mgt_sel_mux_sel : std_logic_vector(255 downto 0);
482 signal mgt_sel_delay_num : std_logic_vector(255 downto 0);
483 signal mgt_sel_bc_cntr_0 : std_logic_vector(111 downto 0);
484 signal mgt_sel_bc_cntr_1 : std_logic_vector(111 downto 0);
485 signal mgt_sel_bc_cntr_2 : std_logic_vector(111 downto 0);
486 signal mgt_sel_bc_cntr_3 : std_logic_vector(111 downto 0);
487 signal mgt_sel_bc_mux_cntr_0 : std_logic_vector(111 downto 0);
488 signal mgt_sel_bc_mux_cntr_1 : std_logic_vector(111 downto 0);
489 signal mgt_sel_bc_mux_cntr_2 : std_logic_vector(111 downto 0);
490 signal mgt_sel_bc_mux_cntr_3 : std_logic_vector(111 downto 0);
491 signal mgt_sel_RXUSRCLK_OUT : std_logic_vector(63 downto 0);
492 signal mgt_sel_enable_mgt : std_logic_vector(63 downto 0);
493 signal mgt_sel_bcn_synch : std_logic_vector(63 downto 0);
494 signal mgt_sel_crc_error_chan : std_logic_vector(63 downto 0);
495 signal mgt_sel_disperr_error : std_logic_vector(63 downto 0);
496 signal mgt_sel_notable_error : std_logic_vector(63 downto 0);
497 signal mgt_sel_rx_resetdone : std_logic_vector(63 downto 0);
498 signal mgt_sel_Commadet : std_logic_vector(63 downto 0);
499 signal mgt_sel_Data : mgt_rxdata_array (15 downto 0);
502 signal kchar_mgt : std_logic_vector(79 downto 0);
503 signal align_frame_mgt : std_logic_vector(79 downto 0);
505 signal rxdata_mgt0 : std_logic_vector(639 downto 0);
506 signal ram_data_mgt0 : std_logic_vector(4559 downto 0);
507 signal rxdata_mgt1 : std_logic_vector(639 downto 0);
508 signal ram_data_mgt1 : std_logic_vector(4559 downto 0);
509 signal rxdata_mgt2 : std_logic_vector(639 downto 0);
510 signal ram_data_mgt2 : std_logic_vector(4559 downto 0);
511 signal rxdata_mgt3 : std_logic_vector(639 downto 0);
512 signal ram_data_mgt3 : std_logic_vector(4559 downto 0);
514 signal mgt_sel_rxdata_mgt0 : std_logic_vector(511 downto 0);
515 signal mgt_sel_rxdata_mgt1 : std_logic_vector(511 downto 0);
516 signal mgt_sel_rxdata_mgt2 : std_logic_vector(511 downto 0);
517 signal mgt_sel_rxdata_mgt3 : std_logic_vector(511 downto 0);
519 signal mgt_sel_ram_data_mgt0 : std_logic_vector(3647 downto 0);
520 signal mgt_sel_ram_data_mgt1 : std_logic_vector(3647 downto 0);
521 signal mgt_sel_ram_data_mgt2 : std_logic_vector(3647 downto 0);
522 signal mgt_sel_ram_data_mgt3 : std_logic_vector(3647 downto 0);
524 signal mgt_sel_kchar : std_logic_vector(63 downto 0);
525 signal mgt_sel_align_frame : std_logic_vector(63 downto 0);
526 signal fpga_number : integer;
528 signal sorted_Start_sel, sorted_Start_sel_1, sorted_Start_sel_i, sorted_Start_sel_ii : std_logic := '0';
529 signal sorted_Valid_sel, sorted_Valid_sel_1, sorted_Valid_sel_i : std_logic := '0';
530 signal sorted_TOB_sel : std_logic_vector (31 downto 0) := (others => '0');
531 signal TOB_BCN_sync_reg_i : std_logic_vector (31 downto 0) := (others => '0');
532 signal sorted_synch_int : std_logic;
533 signal sel_bcn_or_bc_cnt_i : std_logic;
534 signal tob_bc_reg, tob_bc_status : std_logic_vector (31 downto 0);
535 signal TOB_BCN_sync_internal : std_logic;
536 signal dummy1, dummy2, dummy3 : std_logic_vector(74 downto 0);
537 signal tob_delay_reg, tob_delay_status : std_logic_vector (31 downto 0);
539 signal VAUXP_i, VAUXN_i, Vp_i, Vn_i : std_logic;
541 signal golden: std_logic;
542 signal readout_en, mgt_en, data_path_en, input_ram_en, output_rams_en, merge_en, sort_in_ram_en, sort_out_ram_en : std_logic;
543 signal energy_encoding : std_logic_vector( 1 downto 0);
544 signal dynamic_mapping : std_logic;
545 signal bcmuxvalue_sych_reg_i,ttc_orbit_length_reg_i: std_logic_vector (31 downto 0);
547 signal probe0 : STD_LOGIC_VECTOR(34 DOWNTO 0);
549 signal latency_check_in : STD_LOGIC;
550 signal latency_check_out : STD_LOGIC;
553 attribute keep : string;
554 attribute max_fanout : integer;
555 attribute keep of data_merge_i : signal is "true";
556 attribute keep of sorted_eg_TOB : signal is "true";
557 attribute keep of sorted_tau_TOB : signal is "true";
558 attribute keep of sorted_eg_TOB_1 : signal is "true";
559 attribute keep of reset : signal is "true" ;
561 attribute ASYNC_REG : string;
562 attribute ASYNC_REG of force_rx_error_buf : signal is "TRUE";
572 record_in => efex_in,
573 record_out => efex_out,
602 reset_tmp <= not locked_40m_i;
603 mgt_DATA_VALID_IN <= (others => '1');
604 clear_error <= not control_reg(2);
605 sel_bcn_or_bc_cnt_i <= control_reg(31);
608 reset_bufg : BUFG --
use global routing
for RESET
to free up routing resources
615 reg224_latch_0 <= reg224_latch(0);
616 reg224_latch_1 <= reg224_latch(1);
617 reg224_latch_2 <= reg224_latch(2);
618 reg224_latch_3 <= reg224_latch(3);
620 delay_latch_0 <= delay_latch(0);
621 delay_latch_1 <= delay_latch(1);
622 delay_latch_2 <= delay_latch(2);
623 delay_latch_3 <= delay_latch(3);
625 delay_num_0 <= delay_num (3 downto 0);
626 delay_num_1 <= delay_num (7 downto 4);
627 delay_num_2 <= delay_num (11 downto 8);
628 delay_num_3 <= delay_num (15 downto 12);
630 rx_realign_0 <= rx_realign(0);
631 rx_realign_1 <= rx_realign(1);
632 rx_realign_2 <= rx_realign(2);
633 rx_realign_3 <= rx_realign(3);
635 rx_disperr_0 <= rx_disperr(3 downto 0);
636 rx_disperr_1 <= rx_disperr(7 downto 4);
637 rx_disperr_2 <= rx_disperr(11 downto 8);
638 rx_disperr_3 <= rx_disperr(15 downto 12);
640 encode_error_0 <= encode_error (3 downto 0);
641 encode_error_1 <= encode_error (7 downto 4);
642 encode_error_2 <= encode_error (11 downto 8);
643 encode_error_3 <= encode_error (15 downto 12);
652 rx_pwr_on_gen : for i in 0 to 19
654 gt_rxpd(i).gt0_rxpd <= not F_MGT_RX_POWER(FLAVOUR)(i*4+0) & not F_MGT_RX_POWER(FLAVOUR)(i*4+0);
655 gt_rxpd(i).gt1_rxpd <= not F_MGT_RX_POWER(FLAVOUR)(i*4+1) & not F_MGT_RX_POWER(FLAVOUR)(i*4+1);
656 gt_rxpd(i).gt2_rxpd <= not F_MGT_RX_POWER(FLAVOUR)(i*4+2) & not F_MGT_RX_POWER(FLAVOUR)(i*4+2);
657 gt_rxpd(i).gt3_rxpd <= not F_MGT_RX_POWER(FLAVOUR)(i*4+3) & not F_MGT_RX_POWER(FLAVOUR)(i*4+3);
658 gt_txpd(i).gt0_txpd <= not F_MGT_TX_POWER(FLAVOUR)(i*4+0) & not F_MGT_TX_POWER(FLAVOUR)(i*4+0);
659 gt_txpd(i).gt1_txpd <= not F_MGT_TX_POWER(FLAVOUR)(i*4+1) & not F_MGT_TX_POWER(FLAVOUR)(i*4+1);
660 gt_txpd(i).gt2_txpd <= not F_MGT_TX_POWER(FLAVOUR)(i*4+2) & not F_MGT_TX_POWER(FLAVOUR)(i*4+2);
661 gt_txpd(i).gt3_txpd <= not F_MGT_TX_POWER(FLAVOUR)(i*4+3) & not F_MGT_TX_POWER(FLAVOUR)(i*4+3);
666 golden <= '0' when DATA_PATH_ENABLED and MGT_ENABLED else '1';
668 data_path_en <= '1' when DATA_PATH_ENABLED else '0';
669 mgt_en <= '1' when MGT_ENABLED else '0';
670 input_ram_en <= '1' when INPUT_RAM_ENABLED else '0';
671 output_rams_en <= '1' when OUTPUT_RAMS_ENABLED else '0';
672 sort_in_ram_en <= '1' when SORT_IN_RAM_ENABLED else '0';
673 sort_out_ram_en <= '1' when SORT_OUT_RAM_ENABLED else '0';
677 readout_en <= '1' when READOUT_ENABLED else '0';
678 merge_en <= '1' when MERGE_ENABLED and (FLAVOUR = 1 or FLAVOUR = 2) else '0';
681 Module_ID <= (31 => not golden,
682 30 downto 28 => std_logic_vector(to_unsigned(FLAVOUR, 3)),
684 25 downto 20 => "000000",
685 19 downto 16 => hardware_addr(11 downto 8),
686 15 downto 12 => eFEX_mapping(to_integer(unsigned(hardware_addr(3 downto 0)))),
687 11 downto 0 => X"efe"
691 30 downto 29 => EG_ALGO_VERSION,
692 28 downto 27 => TAU_ALGO_VERSION,
693 26 => sort_out_ram_en,
694 25 => sort_in_ram_en,
695 24 => output_rams_en,
701 18 => dynamic_mapping,
702 17 downto 16 => energy_encoding,
703 15 downto 0 => delay_num_3 & delay_num_2 & delay_num_1 & delay_num_0,
706 start <= control_reg(0);
707 trigger_reconfig <= reconfig;
708 reconfig <= control_reg(30);
710 U_1 :
entity infrastructure_lib.proc_fpgas
711 generic map (IPBUSPORT => F_IPBUS_PORT_N
(FLAVOUR))
716 rst_macclk => rst_macclk,
720 force_rx_error => force_rx_error_buf
(1),
721 master_tx_pause => master_tx_pause_int,
726 force_rx_error:
process(mac_clk)
728 if rising_edge(mac_clk) then
729 force_rx_error_buf <= force_rx_error_buf(0) & trigger_reconfig;
735 if rising_edge(mac_clk) then
744 global_fabric :
entity ipbus_lib.ipbus_fabric_sel
745 generic map(NSLV => N_SLAVES,
746 SEL_WIDTH => ipbus_sel_width
)
750 sel => ipbus_sel_L1CaloEfexProcessor
(ipb_out.ipb_addr
),
751 ipb_to_slaves => ipbw,
752 ipb_from_slaves => ipbr
763 ipb_in => ipbw
(N_SLV_COMMON_ID_VERSION
),
764 ipb_out => ipbr
(N_SLV_COMMON_ID_VERSION
),
782 ipb_in => ipbw
(N_SLV_EFEX_LIB_VERSION
),
783 ipb_out => ipbr
(N_SLV_EFEX_LIB_VERSION
),
784 constraints_version =>
CON_VER,
802 vp_i <= '0' when flavour = 1 or flavour = 2 else vp;
803 vn_i <= '0' when flavour = 1 or flavour = 2 else vn;
805 VAUXP_i <= '0' when flavour = 1 or flavour = 2 else VAUXP;
806 VAUXN_i <= '0' when flavour = 1 or flavour = 2 else VAUXN;
808 slaves :
entity infrastructure_lib.
slaves
809 generic map (FPGA_FLAVOUR =>
FLAVOUR,
816 ipb_in => ipbw
(N_SLV_COMMON_INFRA
),
817 ipb_out => ipbr
(N_SLV_COMMON_INFRA
),
823 control_reg => control_reg,
844 cclk_o :
entity infrastructure_lib.
startup
846 flash_cclk => flash_clk
878 reset => control_reg
(3),
888 clk_proc :
process (clk280)
890 if clk280'event and clk280 = '1' then
891 T_TOB_32b_in_i <= sorted_merged_TOB;
892 T_TOB_sync_in_i <= sorted_merged_Start;
893 T_TOB_wr_in_i <= sorted_merged_Valid;
894 OUT_TOB_BCN_i <= merged_TOB_BCN_i;
901 input_f5_to_f1 : for i in 0 to 3 generate
912 synch_L1A_in :
process (clk40)
914 if clk40'event and clk40 = '0' then
915 L1A_i <= ttc_inform(0);
916 BCR_i <= ttc_inform(1);
917 ECR_i <= ttc_inform(2);
918 privilege_read_i <= ttc_inform(3);
928 READOUT_IF : if (READOUT_ENABLED) generate
936 IPb_in => ipbw
(N_SLV_EFEX_READOUT
),
937 IPb_out => ipbr
(N_SLV_EFEX_READOUT
),
990 inter_FPGA_io : for i in 0 to 32 generate
1006 end generate inter_FPGA_io;
1008 data_to_X_i <= (others => '0') when FLAVOUR = 1 else
1011 data_to_Y_i <= (others => '0') when FLAVOUR = 2 else
1016 io_reg_0 :
process(clk280)
1018 if clk280' event and clk280 = '1' then
1019 if TOB_BCN_sync_reg_i(31) = '1' then
1020 sorted_eg_TOB_1 <= TOB_BCN_sync_eg_i & X"00000" & sorted_TOB_BCN;
1022 sorted_eg_TOB_1 <= TOB_BCN_sync_eg_i & sorted_eg_TOB;
1027 io_reg_1 :
process(clk280)
1029 if clk280' event and clk280 = '1' then
1030 if TOB_BCN_sync_reg_i(31) = '1' then
1031 sorted_tau_TOB_1 <= TOB_BCN_sync_tau_i & X"00000" & sorted_TOB_BCN;
1033 sorted_tau_TOB_1 <= TOB_BCN_sync_tau_i & sorted_tau_TOB;
1039 TOB_BCN_sync_proc :
process (clk280)
1041 if clk280'event and clk280 = '1' then
1042 if (sorted_TOB_BCN = TOB_BCN_sync_reg_i(11 downto 0)) and (sorted_eg_start = '1') then
1043 TOB_BCN_sync_eg_i <= '1';
1045 TOB_BCN_sync_eg_i <= '0';
1048 if (sorted_TOB_BCN = TOB_BCN_sync_reg_i(11 downto 0)) and (sorted_tau_start = '1') then
1049 TOB_BCN_sync_tau_i <= '1';
1051 TOB_BCN_sync_tau_i <= '0';
1100 DATA_PATH_IF: if DATA_PATH_ENABLED generate
1102 generic map (ENABLE_INPUT_RAM => INPUT_RAM_ENABLED,
1103 ENABLE_OUTPUT_RAMS => OUTPUT_RAMS_ENABLED,
1106 ENABLE_SORTING_INPUT_RAM => SORT_IN_RAM_ENABLED,
1107 ENABLE_SORTING_OUTPUT_RAM => SORT_OUT_RAM_ENABLED,
1109 EG_ALGO_VERSION => EG_ALGO_VERSION,
1110 TAU_ALGO_VERSION => TAU_ALGO_VERSION
1118 in_Load => clk_load,
1121 start_pulse_rst => start_pulse_rst,
1134 bcmuxvalue_sych_reg => bcmuxvalue_sych_reg_i
(11 downto 0),
1135 ttc_orbit_length_reg => ttc_orbit_length_reg_i
(11 downto 0),
1137 delay_num => mgt_sel_delay_num,
1138 bc_cntr_0 => mgt_sel_bc_cntr_0,
1139 bc_cntr_1 => mgt_sel_bc_cntr_1,
1140 bc_cntr_2 => mgt_sel_bc_cntr_2,
1141 bc_cntr_3 => mgt_sel_bc_cntr_3,
1142 bc_mux_cntr_0 => mgt_sel_bc_mux_cntr_0,
1143 bc_mux_cntr_1 => mgt_sel_bc_mux_cntr_1,
1144 bc_mux_cntr_2 => mgt_sel_bc_mux_cntr_2,
1145 bc_mux_cntr_3 => mgt_sel_bc_mux_cntr_3,
1146 bcn_synch => mgt_sel_bcn_synch,
1147 crc_error_chan => mgt_sel_crc_error_chan,
1150 data_readout_0 => data_readout_0,
1151 data_readout_1 => data_readout_1,
1152 data_readout_2 => data_readout_2,
1153 data_readout_3 => data_readout_3,
1154 Reg224_latch => Reg224_latch,
1155 ttc_pipe => ttc_pipe,
1156 delay_latch => delay_latch,
1178 sel_data_in => control_reg
(4),
1179 ram_data_mgt0 => mgt_sel_ram_data_mgt0,
1180 ram_data_mgt1 => mgt_sel_ram_data_mgt1,
1181 ram_data_mgt2 => mgt_sel_ram_data_mgt2,
1182 ram_data_mgt3 => mgt_sel_ram_data_mgt3,
1185 MGT_Commadet => mgt_sel_Commadet,
1186 MGT_Data => mgt_sel_Data,
1187 align_frame => mgt_sel_align_frame,
1188 disperr_error => mgt_sel_disperr_error,
1189 notable_error => mgt_sel_notable_error
1194 MGT_IF: if MGT_ENABLED generate
1197 fpga_number => fpga_number,
1198 in_BC_Reg_sel => BC_Reg_sel,
1199 in_mux_sel => mux_sel,
1200 in_delay_num => delay_num,
1201 in_bc_cntr_0 => bc_cntr_0,
1202 in_bc_cntr_1 => bc_cntr_1,
1203 in_bc_cntr_2 => bc_cntr_2,
1204 in_bc_cntr_3 => bc_cntr_3,
1205 in_bc_mux_cntr_0 => bc_mux_cntr_0,
1206 in_bc_mux_cntr_1 => bc_mux_cntr_1,
1207 in_bc_mux_cntr_2 => bc_mux_cntr_2,
1208 in_bc_mux_cntr_3 => bc_mux_cntr_3,
1210 in_rxdata_mgt0 => rxdata_mgt0,
1211 in_rxdata_mgt1 => rxdata_mgt1,
1212 in_rxdata_mgt2 => rxdata_mgt2,
1213 in_rxdata_mgt3 => rxdata_mgt3,
1215 in_ram_data_mgt0 => ram_data_mgt0,
1216 in_ram_data_mgt1 => ram_data_mgt1,
1217 in_ram_data_mgt2 => ram_data_mgt2,
1218 in_ram_data_mgt3 => ram_data_mgt3,
1220 in_kchar => kchar_mgt,
1221 in_align_frame => align_frame_mgt,
1223 in_mgt_RXUSRCLK_OUT => mgt_RXUSRCLK_OUT,
1224 in_enable_mgt => enable_mgt,
1225 in_bcn_synch => bcn_synch,
1226 in_crc_error_chan => crc_error_chan,
1227 in_disperr_error => disperr_error_i,
1228 in_notable_error => notable_error_i,
1230 in_rx_resetdone => rx_resetdone,
1232 out_BC_Reg_sel => mgt_sel_BC_Reg_sel,
1233 out_mux_sel => mgt_sel_mux_sel,
1234 out_delay_num => mgt_sel_delay_num,
1235 out_bc_cntr_0 => mgt_sel_bc_cntr_0,
1236 out_bc_cntr_1 => mgt_sel_bc_cntr_1,
1237 out_bc_cntr_2 => mgt_sel_bc_cntr_2,
1238 out_bc_cntr_3 => mgt_sel_bc_cntr_3,
1239 out_bc_mux_cntr_0 => mgt_sel_bc_mux_cntr_0,
1240 out_bc_mux_cntr_1 => mgt_sel_bc_mux_cntr_1,
1241 out_bc_mux_cntr_2 => mgt_sel_bc_mux_cntr_2,
1242 out_bc_mux_cntr_3 => mgt_sel_bc_mux_cntr_3,
1243 out_mgt_RXUSRCLK_OUT => mgt_sel_RXUSRCLK_OUT,
1244 out_enable_mgt => mgt_sel_enable_mgt,
1245 out_bcn_synch => mgt_sel_bcn_synch,
1246 out_crc_error_chan => mgt_sel_crc_error_chan,
1247 out_disperr_error => mgt_sel_disperr_error,
1248 out_notable_error => mgt_sel_notable_error,
1250 out_rxdata_mgt0 => mgt_sel_rxdata_mgt0,
1251 out_rxdata_mgt1 => mgt_sel_rxdata_mgt1,
1252 out_rxdata_mgt2 => mgt_sel_rxdata_mgt2,
1253 out_rxdata_mgt3 => mgt_sel_rxdata_mgt3,
1255 out_ram_data_mgt0 => mgt_sel_ram_data_mgt0,
1256 out_ram_data_mgt1 => mgt_sel_ram_data_mgt1,
1257 out_ram_data_mgt2 => mgt_sel_ram_data_mgt2,
1258 out_ram_data_mgt3 => mgt_sel_ram_data_mgt3,
1260 out_kchar => mgt_sel_kchar,
1261 out_rx_resetdone => mgt_sel_rx_resetdone,
1262 out_align_frame => mgt_sel_align_frame,
1264 in_MGT_Commadet => MGT_Commadet_int,
1265 in_MGT_Data => rxdata_quad_array,
1267 out_MGT_Commadet => mgt_sel_Commadet,
1268 out_MGT_Data => mgt_sel_Data);
1273 fpga_number => fpga_number,
1274 in_txdata_0 => txdatai_0,
1275 in_txdata_1 => txdatai_1,
1276 in_txdata_2 => txdatai_2,
1277 in_txdata_3 => txdatai_3,
1278 in_txdata_4 => txdatai_4,
1279 in_txdata_5 => txdatai_5,
1280 in_txdata_6 => txdatai_6,
1281 in_txdata_7 => txdatai_7,
1282 in_txdata_8 => txdatai_8,
1283 in_txdata_9 => txdatai_9,
1284 in_txdata_10 => txdatai_10,
1285 in_txdata_11 => txdatai_11,
1286 in_mgt_usr_clk => mgt_TXUSRCLK_OUT,
1288 in_topo_k => TOPO_TOB_out_char,
1289 in_raw_k => RAW_Data_out_char,
1290 in_topo_data => TOPO_TOB_out,
1291 in_raw_data => RAW_Data_out,
1293 out_topo_tob_clk => TOB_TXOUTCLK_i,
1294 out_topo_raw_clk => RAW_TXOUTCLK_i,
1296 out_txcharisk_quad_array => mgt_txcharisk,
1297 out_txdata_quad_array => mgt_txdata,
1298 out_mgt_usr_clk => mgt_sel_tx_clk
1305 mgt_gen : for i in 0 to 19
1309 MGT_Commadet_int(0+4*i downto 0+4*i) <= mgt_rxchariscomma(i).gt0_rxchariscomma_out(0 downto 0);
1310 MGT_Commadet_int(1+4*i downto 1+4*i) <= mgt_rxchariscomma(i).gt1_rxchariscomma_out(0 downto 0);
1311 MGT_Commadet_int(2+4*i downto 2+4*i) <= mgt_rxchariscomma(i).gt2_rxchariscomma_out(0 downto 0);
1312 MGT_Commadet_int(3+4*i downto 3+4*i) <= mgt_rxchariscomma(i).gt3_rxchariscomma_out(0 downto 0);
1314 rx_realign(0+4*i) <= mgt_rxbyterealign(i).gt0_rxbyterealign;
1315 rx_realign(1+4*i) <= mgt_rxbyterealign(i).gt1_rxbyterealign;
1316 rx_realign(2+4*i) <= mgt_rxbyterealign(i).gt2_rxbyterealign;
1317 rx_realign(3+4*i) <= mgt_rxbyterealign(i).gt3_rxbyterealign;
1319 rx_resetdone(0+4*i) <= mgt_rx_resetdone(i).gt0_rxresetdone;
1320 rx_resetdone(1+4*i) <= mgt_rx_resetdone(i).gt1_rxresetdone;
1321 rx_resetdone(2+4*i) <= mgt_rx_resetdone(i).gt2_rxresetdone;
1322 rx_resetdone(3+4*i) <= mgt_rx_resetdone(i).gt3_rxresetdone;
1324 rxbyteisaligned(0+4*i) <= mgt_rxbyteisaligned(i).gt0_rxbyteisaligned;
1325 rxbyteisaligned(1+4*i) <= mgt_rxbyteisaligned(i).gt1_rxbyteisaligned;
1326 rxbyteisaligned(2+4*i) <= mgt_rxbyteisaligned(i).gt2_rxbyteisaligned;
1327 rxbyteisaligned(3+4*i) <= mgt_rxbyteisaligned(i).gt3_rxbyteisaligned;
1329 mgt_rxcharisk_reg(3+16*i downto 16*i) <= mgt_rxcharisk(i).gt0_rxcharisk_out;
1330 mgt_rxcharisk_reg(7+16*i downto 4+16*i) <= mgt_rxcharisk(i).gt1_rxcharisk_out;
1331 mgt_rxcharisk_reg(11+16*i downto 8+16*i) <= mgt_rxcharisk(i).gt2_rxcharisk_out;
1332 mgt_rxcharisk_reg(15+16*i downto 12+16*i) <= mgt_rxcharisk(i).gt3_rxcharisk_out;
1334 align_frame_mgt(0+4*i) <= mgt_rxcharisk(i).gt0_rxcharisk_out(1) and mgt_rxcharisk(i).gt0_rxcharisk_out(0);
1335 align_frame_mgt(1+4*i) <= mgt_rxcharisk(i).gt1_rxcharisk_out(1) and mgt_rxcharisk(i).gt1_rxcharisk_out(0);
1336 align_frame_mgt(2+4*i) <= mgt_rxcharisk(i).gt2_rxcharisk_out(1) and mgt_rxcharisk(i).gt2_rxcharisk_out(0);
1337 align_frame_mgt(3+4*i) <= mgt_rxcharisk(i).gt3_rxcharisk_out(1) and mgt_rxcharisk(i).gt3_rxcharisk_out(0);
1339 rx_disperr(3+16*i downto 16*i) <= mgt_rxdisperr(i).gt0_rxdisperr;
1340 rx_disperr(7+16*i downto 4+16*i) <= mgt_rxdisperr(i).gt1_rxdisperr;
1341 rx_disperr(11+16*i downto 8+16*i) <= mgt_rxdisperr(i).gt2_rxdisperr;
1342 rx_disperr(15+16*i downto 12+16*i) <= mgt_rxdisperr(i).gt3_rxdisperr;
1344 encode_error(3+16*i downto 16*i) <= mgt_rxnotintable(i).gt0_rxnotintable;
1345 encode_error(7+16*i downto 4+16*i) <= mgt_rxnotintable(i).gt1_rxnotintable;
1346 encode_error(11+16*i downto 8+16*i) <= mgt_rxnotintable(i).gt2_rxnotintable;
1347 encode_error(15+16*i downto 12+16*i) <= mgt_rxnotintable(i).gt3_rxnotintable;
1349 MGT_RXN_IN(i).RXN_IN <= RXN_IN(3+4*i downto 4*i);
1350 MGT_RXP_IN(i).RXP_IN <= RXP_IN(3+4*i downto 4*i);
1352 mgt_DATA_VALID_IN(i) <= mgt_DATA_VALID_IN_reg(i);
1354 end generate mgt_gen;
1360 internal_mgt_tx_gen : for i in 0 to 19
1362 tx_resetdone(0+4*i) <= mgt_tx_resetdone(i).gt0_txresetdone;
1363 tx_resetdone(1+4*i) <= mgt_tx_resetdone(i).gt1_txresetdone;
1364 tx_resetdone(2+4*i) <= mgt_tx_resetdone(i).gt2_txresetdone;
1365 tx_resetdone(3+4*i) <= mgt_tx_resetdone(i).gt3_txresetdone;
1367 txcharisk(03+16*i downto 00+16*i) <= mgt_txcharisk(i).gt0_txcharisk;
1368 txcharisk(07+16*i downto 04+16*i) <= mgt_txcharisk(i).gt1_txcharisk;
1369 txcharisk(11+16*i downto 08+16*i) <= mgt_txcharisk(i).gt2_txcharisk;
1370 txcharisk(15+16*i downto 12+16*i) <= mgt_txcharisk(i).gt3_txcharisk;
1372 mgt_loopback_in(i).gt0_loopback_in <= mgt_loopback_reg(2+3*i downto 3*i);
1375 external_mgt_tx_gen_1 : for i in 0 to F_MGT_USE_OTHER_CLK_N(FLAVOUR)-1
1377 TXN_OUT(3+4*i downto 4*i) <= MGT_TXN_IN(i).TXN_OUT;
1378 TXP_OUT(3+4*i downto 4*i) <= MGT_TXP_IN(i).TXP_OUT;
1381 TXN_OUT(77 downto 76) <= MGT_TXN_IN(F_MGT_USE_OTHER_CLK_N(FLAVOUR)).TXN_OUT(1 downto 0);
1382 TXP_OUT(77 downto 76) <= MGT_TXP_IN(F_MGT_USE_OTHER_CLK_N(FLAVOUR)).TXP_OUT(1 downto 0);
1384 external_mgt_tx_gen_2 : for i in F_MGT_USE_OTHER_CLK_N(FLAVOUR)+1 to 19
1386 TXN_OUT(3+4*(i-1) downto 4*(i-1)) <= MGT_TXN_IN(i).TXN_OUT;
1387 TXP_OUT(3+4*(i-1) downto 4*(i-1)) <= MGT_TXP_IN(i).TXP_OUT;
1394 generic map(QUAD_ENABLE => F_MGT_QUAD_ENABLE
(FLAVOUR))
1398 MGT_CLK_GTREFCLK_PAD_N_IN => Q_CLK_GTREFCLK_PAD_N_IN,
1399 MGT_CLK_GTREFCLK_PAD_P_IN => Q_CLK_GTREFCLK_PAD_P_IN,
1400 mgt_TXUSRCLK_OUT => mgt_TXUSRCLK_OUT,
1401 mgt_RXUSRCLK_OUT => mgt_RXUSRCLK_OUT,
1402 mgt_SOFT_RESET_TX_IN => mgt_SOFT_RESET_TX_IN,
1403 mgt_SOFT_RESET_RX_IN => mgt_SOFT_RESET_RX_IN,
1405 RXN_IN => MGT_RXN_IN,
1406 RXP_IN => MGT_RXP_IN,
1407 TXN_IN => MGT_TXN_IN,
1408 TXP_IN => MGT_TXP_IN,
1409 rxdata_quad_array => rxdata_quad_array,
1410 txdata_quad_array => mgt_txdata,
1412 gt_rxpd_array => gt_rxpd,
1413 gt_txpd_array => gt_txpd,
1414 mgt_DATA_VALID_IN => mgt_DATA_VALID_IN,
1415 mgt_TX_FSM_RESET_DONE => mgt_tx_fsm_resetdone,
1416 mgt_RX_FSM_RESET_DONE => mgt_rx_fsm_resetdone,
1417 rxbyteisaligned_quad_array => mgt_rxbyteisaligned,
1418 rxresetdone_quad_array => mgt_rx_resetdone,
1419 txresetdone_quad_array => mgt_tx_resetdone,
1420 loopback_quad_array => mgt_loopback_in,
1421 rxchariscomma_quad_array => mgt_rxchariscomma,
1422 rxcharisk_quad_array => mgt_rxcharisk,
1423 txcharisk_quad_array => mgt_txcharisk,
1424 txbufstatus_quad_array => mgt_txbufstatus,
1425 rxbyterealign_quad_array => mgt_rxbyterealign,
1426 rxcommadet_quad_array => mgt_rxcommadet,
1427 rxdisperr_quad_array => mgt_rxdisperr
(19 downto 0),
1428 rxnotintable_quad_array => mgt_rxnotintable
(19 downto 0),
1429 mgt_QPLLREFCLKLOST_OUT => mgt_QPLLREFCLKLOST_OUT,
1430 mgt_QPLLLOCK_OUT => mgt_QPLLLOCK_OUT
1438 MGT_ipb :
entity infrastructure_lib.
mgt_slaves
1453 ipb_in => ipbw
(N_SLV_EFEX_MGT_TOP
),
1454 ipb_out => ipbr
(N_SLV_EFEX_MGT_TOP
),
1469 bc_reg_sel => bc_reg_sel,
1487 ram_data_mgt1 => ram_data_mgt1,
1491 ram_data_mgt3 => ram_data_mgt3,
1520 GLOBAL_MERGE : if MERGE_ENABLED and (FLAVOUR = 1 or FLAVOUR = 2) generate
1522 TOB_BCN_sync <= TOB_BCN_sync_eg_i when FLAVOUR = 1 else TOB_BCN_sync_tau_i;
1523 sorted_Start_sel <= sorted_eg_Start when FLAVOUR = 1 else sorted_tau_Start;
1524 sorted_TOB_sel <= sorted_eg_TOB when FLAVOUR = 1 else sorted_tau_TOB;
1525 sorted_Valid_sel <= sorted_eg_Valid when FLAVOUR = 1 else sorted_tau_Valid;
1527 proc_clk_280 :
process (clk280)
1529 if rising_edge (clk280) then
1530 data_merge_BCN_A_i <= data_from_fpga_A(32);
1531 data_merge_BCN_B_i <= data_from_fpga_B(32);
1532 data_merge_BCN_C_i <= data_from_fpga_C(32);
1533 data_merge_i(0) <= sorted_TOB_sel;
1534 data_merge_i(1) <= data_from_fpga_A(31 downto 0);
1535 data_merge_i(2) <= data_from_fpga_B(31 downto 0);
1536 data_merge_i(3) <= data_from_fpga_C(31 downto 0);
1537 TOB_BCN_sync_i <= TOB_BCN_sync;
1538 sorted_Start_sel_i <= sorted_Start_sel;
1539 sorted_TOB_BCN_i <= sorted_TOB_BCN;
1541 data_merge_BCN_A_ii <= data_merge_BCN_A_i;
1542 data_merge_BCN_B_ii <= data_merge_BCN_B_i;
1543 data_merge_BCN_C_ii <= data_merge_BCN_C_i;
1544 data_merge_ii <= data_merge_i;
1545 TOB_BCN_sync_ii <= TOB_BCN_sync_i;
1546 sorted_Start_sel_ii <= sorted_Start_sel_i;
1547 sorted_TOB_BCN_ii <= sorted_TOB_BCN_i;
1557 IN_Data => data_merge_ii,
1558 IN_BCN_sync
(0) => data_merge_BCN_A_ii,
1559 IN_BCN_sync
(1) => data_merge_BCN_B_ii,
1560 IN_BCN_sync
(2) => data_merge_BCN_C_ii,
1561 IN_BCN_sync
(3) => TOB_BCN_sync_ii,
1562 IN_Sync => sorted_Start_sel_ii,
1563 IN_local_BCN => sorted_TOB_BCN_ii,
1565 OUT_merged_BCN => merged_TOB_BCN_i,
1570 ipb_in => ipbw
(N_SLV_EFEX_MERGING
),
1571 ipb_out => ipbr
(N_SLV_EFEX_MERGING
),
1572 OUT_Sync => sorted_merged_Start,
1573 OUT_Valid => sorted_merged_Valid,
1574 OUT_TOB => sorted_merged_TOB
1580 tx_phase_adjust :
entity infrastructure_lib.
efex_topo_tx --top_tx_alignment
1584 reset => control_reg
(5),
1587 bcn => merged_TOB_BCN_i
(3 downto 0),
1593 tx_datai_1 => txdatai_1,
1594 tx_datai_2 => txdatai_2,
1595 tx_datai_3 => txdatai_3,
1596 tx_datai_4 => txdatai_4,
1597 tx_datai_5 => txdatai_5,
1598 tx_datai_6 => txdatai_6,
1599 tx_datai_7 => txdatai_7,
1600 tx_datai_8 => txdatai_8,
1601 tx_datai_9 => txdatai_9,
1602 tx_datai_10 => txdatai_10,
1603 tx_datai_11 => txdatai_11
1646 ila_clk_proc :
process (clk280)
1648 if clk280'event AND clk280 = '1' then
1649 latency_check_in <= '1' when (rxdata_quad_array(4).gt2_rxdata_out(19 downto 0) = X"55400") else '0';
1650 latency_check_out <= '1' when (txdatai_0(11 downto 0) = X"062") else '0';
1654 IO_DELAY_A1 : io_delay
1659 data_in_to_device => data_from_fpga_A
(15 downto 0),
1661 delay_clk => clk280,
1662 in_delay_reset => tob_delay_reg
(24),
1663 in_delay_data_ce =>
(others => '0'
),
1664 in_delay_data_inc =>
(others => '0'
),
1665 in_delay_tap_in => tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&
1666 tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&
1667 tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&
1668 tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0),
1669 in_delay_tap_out
(4 downto 0) => tob_delay_status
(4 downto 0),
1670 in_delay_tap_out
(79 downto 5) => dummy1,
1671 delay_locked => tob_delay_status
(24),
1672 ref_clock => clk200_iodelay,
1674 io_reset => tob_delay_reg
(28)
1676 IO_DELAY_A2 : io_delay
1681 data_in_to_device => data_from_fpga_A
(31 downto 16),
1683 delay_clk => clk280,
1684 in_delay_reset => tob_delay_reg
(24),
1685 in_delay_data_ce =>
(others => '0'
),
1686 in_delay_data_inc =>
(others => '0'
),
1687 in_delay_tap_in => tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&
1688 tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&
1689 tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&
1690 tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0)&tob_delay_reg
(4 downto 0),
1691 in_delay_tap_out =>
open,
1693 delay_locked => tob_delay_status
(25),
1694 ref_clock => clk200_iodelay,
1696 io_reset => tob_delay_reg
(28)
1700 IO_DELAY_B1 : io_delay
1705 data_in_to_device => data_from_fpga_B
(15 downto 0),
1707 delay_clk => clk280,
1708 in_delay_reset => tob_delay_reg
(24),
1709 in_delay_data_ce =>
(others => '0'
),
1710 in_delay_data_inc =>
(others => '0'
),
1711 in_delay_tap_in => tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&
1712 tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&
1713 tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&
1714 tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8),
1715 in_delay_tap_out
(4 downto 0) => tob_delay_status
(12 downto 8),
1716 in_delay_tap_out
(79 downto 5) => dummy2,
1717 delay_locked => tob_delay_status
(26),
1718 ref_clock => clk200_iodelay,
1720 io_reset => tob_delay_reg
(28)
1722 IO_DELAY_B2 : io_delay
1727 data_in_to_device => data_from_fpga_B
(31 downto 16),
1729 delay_clk => clk280,
1730 in_delay_reset => tob_delay_reg
(24),
1731 in_delay_data_ce =>
(others => '0'
),
1732 in_delay_data_inc =>
(others => '0'
),
1733 in_delay_tap_in => tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&
1734 tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&
1735 tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&
1736 tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8)&tob_delay_reg
(12 downto 8),
1737 in_delay_tap_out =>
open,
1739 delay_locked => tob_delay_status
(27),
1740 ref_clock => clk200_iodelay,
1742 io_reset => tob_delay_reg
(28)
1746 IO_DELAY_C1 : io_delay
1751 data_in_to_device => data_from_fpga_C
(15 downto 0),
1753 delay_clk => clk280,
1754 in_delay_reset => tob_delay_reg
(24),
1755 in_delay_data_ce =>
(others => '0'
),
1756 in_delay_data_inc =>
(others => '0'
),
1757 in_delay_tap_in => tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&
1758 tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&
1759 tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&
1760 tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16),
1761 in_delay_tap_out
(4 downto 0) => tob_delay_status
(20 downto 16),
1762 in_delay_tap_out
(79 downto 5) => dummy3,
1764 delay_locked => tob_delay_status
(28),
1765 ref_clock => clk200_iodelay,
1767 io_reset => tob_delay_reg
(28)
1770 IO_DELAY_C2 : io_delay
1775 data_in_to_device => data_from_fpga_C
(31 downto 16),
1777 delay_clk => clk280,
1778 in_delay_reset => tob_delay_reg
(24),
1779 in_delay_data_ce =>
(others => '0'
),
1780 in_delay_data_inc =>
(others => '0'
),
1781 in_delay_tap_in => tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&
1782 tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&
1783 tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&
1784 tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16)&tob_delay_reg
(20 downto 16),
1785 in_delay_tap_out =>
open,
1787 delay_locked => tob_delay_status
(29),
1788 ref_clock => clk200_iodelay,
1790 io_reset => tob_delay_reg
(28)
1793 IO_DELAY_BC_A : io_delay2
1798 data_in_to_device
(0) => data_from_fpga_A
(32),
1800 delay_clk => clk280,
1801 in_delay_reset => tob_bc_reg
(24),
1802 in_delay_data_ce =>
(others => '0'
),
1803 in_delay_data_inc =>
(others => '0'
),
1804 in_delay_tap_in => tob_bc_reg
(4 downto 0),
1805 in_delay_tap_out => tob_bc_status
(4 downto 0),
1806 delay_locked => tob_bc_status
(24),
1807 ref_clock => clk200_iodelay,
1809 io_reset => tob_delay_reg
(28)
1812 IO_DELAY_BC_B : io_delay2
1817 data_in_to_device
(0) => data_from_fpga_B
(32),
1819 delay_clk => clk280,
1820 in_delay_reset => tob_bc_reg
(25),
1821 in_delay_data_ce =>
(others => '0'
),
1822 in_delay_data_inc =>
(others => '0'
),
1823 in_delay_tap_in => tob_bc_reg
(12 downto 8),
1824 in_delay_tap_out => tob_bc_status
(12 downto 8),
1825 delay_locked => tob_bc_status
(25),
1826 ref_clock => clk200_iodelay,
1828 io_reset => tob_delay_reg
(28)
1831 IO_DELAY_BC_C : io_delay2
1836 data_in_to_device
(0) => data_from_fpga_C
(32),
1838 delay_clk => clk280,
1839 in_delay_reset => tob_bc_reg
(26),
1840 in_delay_data_ce =>
(others => '0'
),
1841 in_delay_data_inc =>
(others => '0'
),
1842 in_delay_tap_in => tob_bc_reg
(20 downto 16),
1843 in_delay_tap_out => tob_bc_status
(20 downto 16),
1844 delay_locked => tob_bc_status
(26),
1845 ref_clock => clk200_iodelay,
1847 io_reset => tob_delay_reg
(28)
1850 ipbr(N_SLV_EFEX_MERGING) <= IPB_RBUS_NULL;
1852 end generate GLOBAL_MERGE;
External data-types and functions.
array(natural range <> ) of AlgoTriggerObject AlgoTriggerObjects
Algorithm OUTPUT port.
std_logic_vector( OUT_TOB_WIDTH- 1 downto 0) AlgoTriggerObject
Algorithm Trigger Object TOB.
( OUTPUT_TOBS- 1 downto 0) AlgoXTriggerObject AlgoXOutput
Algorithm XOUTPUT port.
Top of TOB merging module with IPBus interface.
Top Level of Readout Logic for process FPGA.
out RAW_data_out STD_LOGIC_VECTOR( 31 downto 0)
calorimeter data 32b out to MGT
in RST std_logic
Reset from 40MHz MMCM lock signal.
in TOB_TXOUTCLK STD_LOGIC
TOB TXOUTCLK to read XTOB/TOB data to MGT for transmission to control FPGA.
in ipb_rst std_logic
ipb_rst signal is input from master to slaves
in XTOB_tau_in AlgoXOutput
XTOBs tau 64b.
in TOB_ready_in std_logic
Ready signal from control FPGA to receive TOBs data.
in BCR_in STD_LOGIC
BCR signal input.
in XTOB_tau_Valid_flg_in STD_LOGIC_VECTOR( 7 downto 0)
8b XTOB tau has valid d
in mgt_enable_in STD_LOGIC_VECTOR( 48 downto 0)
out busy_tob std_logic
tob data busy out
in XTOB_eg_Valid_flg_in STD_LOGIC_VECTOR( 7 downto 0)
8b XTOB e/g has valid d
out IPb_out ipb_rbus
IPb_out signal going from slaves to master.
in XTOB_tau_sync_in STD_LOGIC
XTOB tau sync sig.
in TTC_L1A_ID_EXT_in STD_LOGIC_VECTOR( 7 downto 0)
Extended L1A ID provided by TTC - ECRID.
out TOB_out STD_LOGIC_VECTOR( 31 downto 0)
32b sorted XTOB/TOB out to MGT
in clk_load_in STD_LOGIC
40Mhz input signal at 20% duty cycle
in T_TOB_32b_in STD_LOGIC_VECTOR( 31 downto 0)
Sorted TOB data readout 32b * 7 in series, only 6 is used - F1 reads e/g TOBs and F2 reads tau TOBs.
in TTC_parity_in STD_LOGIC
Odd parity over ECR ID and L1A ID provided by TTC.
in T_TOB_sync_in STD_LOGIC
sorted TOB start signal
in L1A_in STD_LOGIC
L1A signal input.
in OUT_TOB_BCN std_logic_vector( 6 downto 0)
sorted TOB BC_ID with delay through ALGO/sorting block
in shelf_number STD_LOGIC_VECTOR( 3 downto 0)
shelf number input
out local_BCN_out STD_LOGIC_VECTOR( 11 downto 0)
Local BCN generated in Process FPGA.
in IPb_in ipb_wbus
IPb_in signal going from master to slaves.
in efex_slot_num STD_LOGIC_VECTOR( 3 downto 0)
eFEX slot number input
in ipb_clk std_logic
ipb_clk signal is input from master to slaves
in XTOB_eg_in AlgoXOutput
XTOBs e/g 64b * 8.
in TTC_L1A_ID_in STD_LOGIC_VECTOR( 23 downto 0)
L1A ID provided by TTC.
in clk_200M_in STD_LOGIC
200Mhz input signal
in OUT_XTOB_BCN std_logic_vector( 6 downto 0)
XTOB BC_ID with delay through ALGO/sorting block.
FPGA_NUMBER integer := 1
Integer used to distinguish different FPGAs having a slightly different firmware.
in TTC_read_all_in STD_LOGIC
Privilege Read signal input (previledge read)
out busy_raw std_logic
raw data busy out
in ECR_in STD_LOGIC
ECR signal input.
in RAW_ready_in std_logic
Ready signal from control FPGA to receive RAW calorimeter data.
in clk_40M_in STD_LOGIC
40Mhz input signal
in RAW_TXOUTCLK STD_LOGIC
Calorimeter TXOUTCLK to read Calorimeter data to MGT for transmission to control FPGA.
in hw_addr STD_LOGIC_VECTOR( 1 downto 0)
FPGA Hardware Address.
out TOB_out_is_char STD_LOGIC
32b data out to MGT is CHAR
in T_TOB_valid_in STD_LOGIC
sorted TOB valid signal
in RAW_data_in RAW_data_227_type
calorimeter data array 49 x 224b input frames
out RAW_out_is_char STD_LOGIC
calorimeter data 32b out to MGT is CHAR
in XTOB_eg_sync_in STD_LOGIC
XTOB e/g sync sig.
in clk_280M_in STD_LOGIC
280Mhz input signal
in clk_40M_rdout STD_LOGIC
40Mhz input signal used only for RAW data readout
in TTC_clk_p std_logic
TTC clock input 40MHz.
out rst_ipb std_logic
Reset output synchronised to ipbus clock.
out clk280 std_logic
280MHz clock output
in reset std_logic
Reset output generated from TTC clock MMCM.
in reset_clk125 std_logic
External reset signal for 125 MHz clock domain from Control FPGA.
out ipb_clk std_logic
31.25MHz clock output used for ipbus communication and accessing registers
out load std_logic
40MHz clock output with 12% duty cycle used in ALGO Block
out clk40_rdout std_logic
40MHz clock output dedicated to Readout Logic
in TTC_clk_n std_logic
TTC clock input 40MHz.
in gt_clk_p std_logic
Crystal clock input 125MHz.
out mac_clk std_logic
125MHz clock output for ipbus communication between FPGAs
out onehz std_logic
One Hz clock output.
out locked_40m std_logic
40MHz clock Locked output
out clk200 std_logic
200MHz clock output (TTC)
out clk200_iodelay std_logic
Pure 200MHz clock output.
out rst_macclk std_logic
Reset output synchronised to mac clock.
out clk40 std_logic
40MHz clock output
in gt_clk_n std_logic
Crystal clock input 125MHz.
in fw_version std_logic_vector( 31 downto 0)
Version of the repository (format: MMmmcccc in hex)
in xml_Gitsha std_logic_vector( 31 downto 0)
Short 7-digit git SHA of the XMLs.
in ipb_rst std_logic
ipbus reset
in fw_Gitsha std_logic_vector( 31 downto 0)
Short 7-digit git SHA of the repository.
in Module_ID std_logic_vector( 31 downto 0)
module id of the eFEX
in build_date std_logic_vector( 31 downto 0)
Date format DDMMYYYY in decimal.
in build_time std_logic_vector( 31 downto 0)
Time format 00HHMMSS in decimal.
in ipb_clk std_logic
ipbus clk of 31.25MHz
out ipb_out ipb_rbus
IPBus output bus going from slaves to m.
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
in xml_version std_logic_vector( 31 downto 0)
Version of the XMLs.
in ttc_clk std_logic
40 MHz clk
out OUT_sorted_eg_TOB AlgoTriggerObject
Sorted eg TOB 32bit.
out RAW_data RAW_data_227_type
RAW data to Readout.
in reset std_logic
syncronous reset used in data_alignment
in ipb_rst std_logic
ipbus reset
out OUT_TOB_BCN std_logic_vector( 11 downto 0)
BCN @280 MHZ referring to 7 TOBS in the BC.
out OUT_eg_Valid std_logic_vector( OUTPUT_TOBS- 1 downto 0)
Valid signal for eg XTOBS @200MHz.
in rx_clk280 std_logic_vector( n_channels- 1 downto 0)
MGT clocks.
out OUT_sorted_eg_Valid std_logic
Sorted TOB valid @280.
out OUT_sorted_tau_Valid std_logic
Sorted TOB valid @280.
in BC_Reg_sel std_logic_vector( 255 downto 0)
16-b BC MUX select for 16 Quads
out OUT_XTOB_BCN std_logic_vector( 11 downto 0)
XTOB BCN @200 MHZ referring to 5 TOBS in the BC.
out OUT_sorted_tau_Sync std_logic
Sorted TOB synch @280 marking first TOB of 7.
out OUT_sorted_tau_TOB AlgoTriggerObject
Sorted eg TOB 32bit.
in ipb_in_algo ipb_wbus
ipbus connection for algorithm
out ipb_out_algo ipb_rbus
ipbus connection for algorithm
out OUT_tau_XTOB AlgoXOutput
tau XTOBS 8 x 64bit @200MHz
in mux_sel std_logic_vector( 255 downto 0)
16-b 1st stage MUX select for 16 Quads
out OUT_eg_XTOB AlgoXOutput
eg XTOBS 8 x 64bit @200MHz
out OUT_eg_Sync std_logic
Sync signal for XTOBS @200MHz marking the first XTOB of 5.
in ipb_in_sorting ipb_wbus
ipbus connection for local TOB sorting
out OUT_tau_Valid std_logic_vector( OUTPUT_TOBS- 1 downto 0)
Valid signal for eg XTOBS @200MHz.
out OUT_tau_Sync std_logic
Sync signal for XTOBS @200MHz marking the first XTOB of 5.
in clk280 std_logic
Used in the output stage of the algorithm.
in rx_resetdone std_logic_vector( n_channels- 1 downto 0)
reset done from GMTs
in ipb_clk std_logic
ipbus clock
out ipb_out_sorting ipb_rbus
ipbus connection for local TOB sorting
out OUT_sorted_eg_Sync std_logic
Sorted TOB synch @280 marking first TOB of 7.
in sel_bcn_or_bc_cnt std_logic
selects between real data BC value (1) and BC delay counter (0) to ipbus
in enable_mgt std_logic_vector( n_channels- 1 downto 0)
MGT enable.
out pseudo_orbit std_logic
Pulse generated when 5-bit BCN is 00000.
in sorted_valid std_logic
Output data valid, high when correspondent output data are valid.
in sorted_sync std_logic
Output sync, high on the first clock cycle of the BC.
out tx_datai_0 std_logic_vector( 33 downto 0)
Output data to the mgt that transimits to the L1Topo.
in clk280 std_logic
clock 280MHz
NCOUNTERS integer := 12
number of tx mgts
in bcn std_logic_vector( 3 downto 0)
bcn from algo block
in tob_data std_logic_vector( 31 downto 0)
Algorithm external data structure, defined in AlgoDataTypes.vhd.
out sorted_synch_int std_logic
internally generated out put synch
in rst std_logic
input reset generated by the not locked 40MHz MMC
Version of the various firmware libraries.
out ram_data_mgt0 std_logic_vector( 4559 downto 0)
ram data from all channel 0 in the all channels
in delay_cntr std_logic_vector( 319 downto 0)
first stage delay counters
out kchar_mgt std_logic_vector( 79 downto 0)
kchar_mgt all MGTs
in rx_fsm_resetdone std_logic_vector( 79 downto 0)
rx_fsm_resetdone for all MGTs
in bc_mux_cntr_2 std_logic_vector( 139 downto 0)
bc_mux_cntr_2 for gt2 of the MGTs
in clk40 std_logic
fabric clock of 40MHz
in ipb_rst std_logic
ipbus reset
in rxdata_mgt1 std_logic_vector( 639 downto 0)
rx data from all gt1 in the all QAUDs
in BCR_in std_logic
BCR from TTC information.
in tx_fsm_resetdone std_logic_vector( 79 downto 0)
tx_fsm_resetdone for all MGTs
in qpll_refclklost std_logic_vector( 19 downto 0)
qpll_refclklost for the quads
in crc_error_chan std_logic_vector( 79 downto 0)
crc errors for all MGTs
in rxdata_mgt0 std_logic_vector( 639 downto 0)
rx data from all gt0 in the all QAUDs
in qpll_lock std_logic_vector( 19 downto 0)
qpllock for the quads
in rxdata_mgt3 std_logic_vector( 639 downto 0)
rx data from all gt3 in the all QAUDs
in clk280_rx std_logic_vector( 79 downto 0)
rx clock of the all the mgts
in rx_realign std_logic_vector( 79 downto 0)
rx_realign for all MGTs
in bc_cntr_3 std_logic_vector( 139 downto 0)
bc cntr for all the gt3 of the MGTs
out softreset_tx std_logic_vector( 19 downto 0)
softreset_tx for all the Quads
in bc_cntr_0 std_logic_vector( 139 downto 0)
bc cntr for all the gt0 of the MGTs
out ram_data_mgt2 std_logic_vector( 4559 downto 0)
ram data from all channel 2 in the all channels
MGT_RX_POWER std_logic_vector( 79 downto 0) :=( others => '0')
power down to rx
in rxdata_mgt2 std_logic_vector( 639 downto 0)
rx data from all gt2 in the all QAUDs
in bc_cntr_1 std_logic_vector( 139 downto 0)
bc cntr for all the gt1 of the MGTs
in bc_mux_cntr_1 std_logic_vector( 139 downto 0)
bc_mux_cntr_1 for gt1 of the MGTs
out loopback std_logic_vector( 59 downto 0)
loopback setting for all the MGTs
in rx_byteisaligned std_logic_vector( 79 downto 0)
rx_byteisaligned for all MGTs
in rx_resetdone std_logic_vector( 79 downto 0)
rx resetdone for all MGTs
in bc_cntr_2 std_logic_vector( 139 downto 0)
bc cntr for all the gt2 of the MGTs
out disperr_error std_logic_vector( 79 downto 0)
disperr_error in all the MGTs
out mgt_enable std_logic_vector( 79 downto 0)
mgt enable for the MGTs
out phase_mux std_logic_vector( 319 downto 0)
phase_mux
in tx_resetdone std_logic_vector( 79 downto 0)
tx resetdone for all MGTs
in tx_bufstatus std_logic_vector( 159 downto 0)
tx_bufstatus for all MGTs
in clk280_tx std_logic_vector( 79 downto 0)
tx clock of the all the mgts
in clk280 std_logic
fabric clock of clk280MHz
MGT_QUAD_ENABLE std_logic_vector( 19 downto 0) := x"00000"
enable the quad in the design
in ipb_clk std_logic
ipbus clock
in bc_mux_cntr_0 std_logic_vector( 139 downto 0)
bc_mux_cntr_0 for gt0 of the MGTs
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
out mux_sel std_logic_vector( 319 downto 0)
mux setting for the first stage mux
MGT_USE_OTHER_CLK std_logic_vector( 19 downto 0) := x"00000"
tx or rx clock selection
out notable_error std_logic_vector( 79 downto 0)
d notable_error in all the MGTs
in encode_error std_logic_vector( 319 downto 0)
encode_error for all MGTs
in rx_disperr std_logic_vector( 319 downto 0)
rx_disperr for all MGTs
in bc_mux_cntr_3 std_logic_vector( 139 downto 0)
bc_mux_cntr_3 for gt3 of the MGTs
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
out softreset_rx std_logic_vector( 19 downto 0)
softreset_rx for all the Quads
MGT_TX_POWER std_logic_vector( 79 downto 0) :=( others => '0')
power down to tx
process fpga common slaves
out tob_delay_reg std_logic_vector( 31 downto 0)
TOB delay register.
in ipb_rst std_logic
IPBus Reset input.
out flash_le std_logic
chip select
in tob_delay_status std_logic_vector( 31 downto 0) :=( others => '0')
TOB delay status register.
in flash_miso std_logic
serial input of the spi flash
in status std_logic_vector( 31 downto 0)
ststus register
in tob_bc_status std_logic_vector( 31 downto 0) :=( others => '0')
TOB BC delay stataus register.
out ttc_orbit_length_reg std_logic_vector( 31 downto 0)
ttc orbit length
in ipb_clk std_logic
IPBus clock.
out flash_clko std_logic
flash clock
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
out flash_mosi std_logic
serial out of the spi flash
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
out tob_bc_reg std_logic_vector( 31 downto 0)
TOB BC delay register.
out reconfig_reg std_logic_vector( 31 downto 0)
reconfigure address register
out TOB_BCN_sych_reg std_logic_vector( 31 downto 0)
TOB_BCN_sych regsiter.
out bcmuxvalue_sych_reg std_logic_vector( 31 downto 0)
bc mux value sync
std_logic_vector( 32 downto 0) data_to_fpga_Y_n
merging data from this fpga to another fpga --
std_logic_vector( 32 downto 0) data_from_fpga_B_p
merging data from another fpga
std_logic_vector( 3 downto 0) ttc_inform_p
ttc information that has L1A,BCR and ECR
std_logic busy_tob
tob data busy out
std_logic_vector( 77 downto 0) txp_OUT
mgts tx side outputs
std_logic_vector( 32 downto 0) data_from_fpga_B_n
merging data from another fpga
std_logic_vector( 77 downto 0) txn_OUT
mgts tx side outputs
std_logic ctrl_TOB_ready_in
Ready signal from control FPGA to receive TOB data.
std_logic_vector( 37 downto 0) ttc_info
ttc information ECR ID and L1ID (Phase-I), L0ID (Phase-II)
std_logic_vector( 3 downto 0) ttc_inform_n
ttc information that has L1A,BCR and ECR
std_logic_vector( 79 downto 0) rxn_IN
mgt rx side inputs
std_logic_vector( 32 downto 0) data_from_fpga_A_p
merging data from another fpga
std_logic_vector( 32 downto 0) data_from_fpga_A_n
merging data from another fpga
std_logic_vector( 32 downto 0) data_to_fpga_Y_p
merging data from this fpga to another fpga
std_logic_vector( 19 downto 0) q_clk_gtrefclk_pad_n_in
mgts reference clocks
std_logic_vector( 32 downto 0) data_from_fpga_C_p
merging data from another fpga
std_logic_vector( 19 downto 0) q_clk_gtrefclk_pad_p_in
mgts reference clocks
std_logic busy_raw
raw data busy out
std_logic_vector( 32 downto 0) data_from_fpga_C_n
merging data from another fpga
std_logic ctrl_RAW_ready_in
Ready signal from control FPGA to receive RAW calorimeter data.
std_logic_vector( 32 downto 0) data_to_fpga_X_n
merging data from this fpga to another fpga
std_logic_vector( 79 downto 0) rxp_IN
mgt rx side inputs
std_logic_vector( 32 downto 0) data_to_fpga_X_p
merging data from this fpga to another fpga
std_logic ttc_parity
Odd parity over ttc ECRID and L1ID.
INFRASTRUCTURE_LIB_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA.
in reset_clk125 std_logic
Reset signal for IPBus clock 125 from Control FPGA.
in master_tx_pause std_logic
ipbus interconnections signals
ALGOLIB_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git sha.
IPBUS_LIB_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the readout library (format: MMmmpppp in hex)
EFEX_POSITION integer := 0
Possible values: 0 dynamic mapping, 1-3 static mapping.
CON_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the tcl file.
in gt_clk125_n std_logic
125MHz ipbus clock
TOP_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the top folder, see TOP_SHA.
GLOBAL_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the repository.
TOP_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the tcl file.
GLOBAL_TIME std_logic_vector( 31 downto 0) := x"00000000"
Time format 00HHMMSS in decimal.
TOB_RDOUT_LIB_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the readout library (format: MMmmpppp in hex)
GLOBAL_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the repository (format: MMmmpppp in hex)
TOB_RDOUT_LIB_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA.
GLOBAL_DATE std_logic_vector( 31 downto 0) := x"00000000"
Date format DDMMYYYY in decimal.
HOG_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of Hog.
ENCODING_MODE integer := 2
Possible values: -2: Steve's multilinear, -1, Standard multilinear, 0-5 linear encoding shifted by th...
HOG_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the Hog submodule.
in fpga_geo_addr std_logic_vector( 1 downto 0)
geographical address of the fpga
in gt_clk125_p std_logic
125MHz ipbus clock
INFRASTRUCTURE_LIB_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of infrastructure library (format: MMmmpppp in hex)
XML_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the XMLs.
ALGOLIB_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of algolib library (format: MMmmpppp in hex)
out master_tx_data std_logic_vector( 9 downto 0)
ipbus interconnections signals
in master_rx_data std_logic_vector( 9 downto 0)
ipbus interconnections signals
FLAVOUR integer := 0
Integer used to distinguish different FPGAs having a slightly different firmware.
XML_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the XMLs.
CON_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the top folder, see TOP_SHA.
IPBUS_LIB_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the ipbus submodule.