55 use ieee.std_logic_1164.
all;
56 use ieee.numeric_std.
all;
58 use ipbus_lib.ipbus.
all;
60 use unisim.VComponents.
all;
61 library infrastructure_lib;
62 use infrastructure_lib.all;
67 use infrastructure_lib.
golden.
all;
79 GLOBAL_SHA : std_logic_vector(31 downto 0) := x"00000000";
81 GLOBAL_VER : std_logic_vector(31 downto 0) := x"00000000";
84 XML_SHA : std_logic_vector(31 downto 0) := x"00000000";
86 XML_VER : std_logic_vector(31 downto 0) := x"00000000";
89 TOP_SHA : std_logic_vector(31 downto 0) := x"00000000";
91 TOP_VER : std_logic_vector(31 downto 0) := x"00000000";
94 HOG_SHA : std_logic_vector(31 downto 0) := x"00000000";
95 HOG_VER : std_logic_vector(31 downto 0) := x"00000000";
98 CON_SHA : std_logic_vector(31 downto 0) := x"00000000";
99 CON_VER : std_logic_vector(31 downto 0) := x"00000000";
111 GOLDEN : boolean := false
115 gt_clk125_p : in std_logic;
116 gt_clk125_n : in std_logic;
117 gmii_gtx_clk : out std_logic;
118 gmii_tx_en : out std_logic;
119 gmii_tx_er : out std_logic;
120 gmii_txd : out std_logic_vector(7 downto 0);
121 gmii_rx_clk : in std_logic;
122 gmii_rx_dv : in std_logic;
123 gmii_rx_er : in std_logic;
124 gmii_rxd : in std_logic_vector(7 downto 0);
125 phy_rstb : out std_logic;
126 clk_40_n : in std_logic;
127 clk_40_p : in std_logic;
129 i2c_scl : out std_logic;
130 i2c_sda : inout std_logic;
131 i2c_rst_0 : out std_logic;
133 pll_miso : in std_logic;
134 pll_le_1 : out std_logic;
135 pll_le_3 : out std_logic;
136 pll_clko : out std_logic;
137 pll_mosi : out std_logic;
138 pll_lock_1 : in std_logic;
139 pll_lock_3 : in std_logic;
141 flash_csn : out std_logic;
142 flash_mosi : out std_logic;
143 flash_miso : in std_logic;
144 xtal_ttc_clk_sel : out std_logic;
145 SYNC_B_CDCE : out std_logic;
146 POWERDN_B_CDCE : out std_logic;
148 master_tx_data1 : in std_logic_vector (9 downto 0);
149 master_tx_data2 : in std_logic_vector (9 downto 0);
150 master_tx_data3 : in std_logic_vector (9 downto 0);
151 master_tx_data4 : in std_logic_vector (9 downto 0);
153 master_rx_data1 : out std_logic_vector (9 downto 0);
154 master_rx_data2 : out std_logic_vector (9 downto 0);
155 master_rx_data3 : out std_logic_vector (9 downto 0);
156 master_rx_data4 : out std_logic_vector (9 downto 0);
157 master_tx_pause1 : out std_logic;
158 master_tx_pause2 : out std_logic;
159 master_tx_pause3 : out std_logic;
160 master_tx_pause4 : out std_logic;
161 hardware_addr : in std_logic_vector(11 downto 0);
163 f5_ipbus_access_led : out std_logic;
164 f5_user_led_1 : out std_logic;
165 f5_ttc_clk_sel : out std_logic;
166 fifos_full : out std_logic := '0';
167 l1a_stretch : out std_logic := '0';
168 fpga1_done : in std_logic;
169 fpga2_done : in std_logic;
170 fpga3_done : in std_logic;
171 fpga4_done : in std_logic;
172 serial_number : in std_logic_vector(5 downto 0);
173 reset_clk125 : out std_logic_vector (3 downto 0);
174 VAUXP, VAUXN : in std_logic_vector (5 downto 0);
175 Vp, Vn : in std_logic;
176 ctrl_out : out efex_control_output;
177 ctrl_in : in efex_control_input
187 probe0 :
in std_logic_vector(
69 downto 0)
194 probe0 :
in std_logic_vector(
34 downto 0)
200 clk40 :
out std_logic;
201 clk320 :
out std_logic;
202 clk160 :
out std_logic;
203 locked :
out std_logic;
204 clk_in1_p :
in std_logic;
205 clk_in1_n :
in std_logic
208 end component clk_ttc;
210 component axi_stream_fifo
is
212 wr_rst_busy :
out std_logic;
213 rd_rst_busy :
out std_logic;
214 m_aclk :
in std_logic;
215 s_aclk :
in std_logic;
216 s_aresetn :
in std_logic;
217 s_axis_tvalid :
in std_logic;
218 s_axis_tready :
out std_logic;
219 s_axis_tdata :
in std_logic_vector (
63 downto 0);
220 s_axis_tkeep :
in std_logic_vector (
7 downto 0);
221 s_axis_tlast :
in std_logic;
222 s_axis_tuser :
in std_logic_vector (
3 downto 0);
223 m_axis_tvalid :
out std_logic;
224 m_axis_tready :
in std_logic;
225 m_axis_tdata :
out std_logic_vector (
63 downto 0);
226 m_axis_tkeep :
out std_logic_vector (
7 downto 0);
227 m_axis_tlast :
out std_logic;
228 m_axis_tuser :
out std_logic_vector (
3 downto 0)
230 end component axi_stream_fifo;
237 type ttc_delay_array is array(natural range <>) of std_logic_vector(40 downto 0);
239 signal efex_number : std_logic_vector(3 downto 0);
241 signal clk125_fr, clk200, clk320, clk160, clko_p40, ipb_clk, mac_clk, clk_locked, eth_locked, clk40, clk280 : std_logic;
242 signal rx_clk280 : std_logic_vector(7 downto 0);
243 signal rst_125, rst_ipb, rst_eth, rst_macclk, sys_rst, soft_rst, rsto_eth, enable_pll_rst : std_logic;
244 signal reset_phy: std_logic := '1';
245 signal pseudo_orbit : std_logic;
246 signal mac_rx_data : std_logic_vector(7 downto 0);
247 signal mac_rx_error, mac_rx_valid, mac_rx_last, my_rx_error : std_logic;
248 signal force_rx_error_buf : std_logic_vector(1 downto 0) := (Others => '0');
249 signal mac_tx_data : std_logic_vector(7 downto 0);
250 signal mac_tx_error, mac_tx_last, mac_tx_ready, mac_tx_valid : std_logic;
251 signal onehz, nuke, rst_ipb_ctrl, got_ip_address : std_logic;
252 signal ipb_master_out : ipb_wbus;
253 signal ipb_master_in : ipb_rbus;
254 signal ipbw : ipb_wbus_array(N_SLAVES-1 downto 0);
255 signal ipbr, ipbr_d : ipb_rbus_array(N_SLAVES-1 downto 0);
256 signal ipb_in : ipb_rbus;
257 signal ipb_out : ipb_wbus;
258 signal master_rx_data1_int, master_rx_data2_int, master_rx_data3_int, master_rx_data4_int : std_logic_vector(8 downto 0);
259 signal master_tx_data1_int, master_tx_data2_int, master_tx_data3_int, master_tx_data4_int : std_logic_vector(8 downto 0);
260 signal flash_clk, flash_led, scl_enb_0, sda_enb_0, scl_enb_1, sda_enb_1, scl_o_0, sda_o_0, scl_o_1, sda_o_1 : std_logic;
261 signal Module_ID, status : std_logic_vector(31 downto 0);
262 signal master_tx_err1, master_tx_err2, master_tx_err3, master_tx_err4 : std_logic;
264 signal control_reg, pulse_reg, reconfig_reg, last_input_data_l1id, input_data_readout_control : std_logic_vector (31 downto 0);
265 signal clkfb_in, gmii_rx_clk_int, clkfb_out : std_logic;
266 signal select_pll, select_flash : std_logic_vector (1 downto 0);
267 signal pll_en, flash_csn_int, trigger_reconfig, reconfig, en_reset : std_logic;
268 signal data_reg0, data_reg1, reg128_latch : std_logic;
269 signal flash_addr_int : std_logic_vector(2 downto 0);
270 signal flash_mosi_int, f5_flash_disable_int, f5_flash_csn_int : std_logic;
271 signal f1_flash_sel_int, f2_flash_sel_int, f3_flash_sel_int, f4_flash_sel_int : std_logic;
272 signal probe : std_logic_vector(12 downto 0);
273 signal start : std_logic;
275 signal hub1_rx_data, hub2_rx_data : std_logic_vector(31 downto 0);
276 signal rx_er_count : std_logic_vector(31 downto 0);
277 signal hub1_combined_ttc_rxclk, hub1_combined_ttc, hub1_combined_ttc_i, hub1_combined_ttc_ila : std_logic_vector(128 downto 0);
278 signal hub2_combined_ttc_rxclk, hub2_combined_ttc, hub2_combined_ttc_i, hub2_combined_ttc_ila : std_logic_vector(128 downto 0);
279 signal hub1_combined_ttc_valid, hub2_combined_ttc_valid : std_logic;
280 signal mgt_enable : std_logic_vector(3 downto 0);
281 signal bc_reg_sel, mux_sel : std_logic_vector(15 downto 0);
282 signal delay_cntr_0, delay_cntr_1 : std_logic_vector(3 downto 0);
283 signal rx_resetdone_mgt114 : std_logic_vector (1 downto 0);
284 signal mgt_commadret : std_logic_vector (1 downto 0);
285 signal rx_clk160 : std_logic_vector(3 downto 0);
286 signal RXN_IN_i, RXP_IN_i : std_logic_vector(11 downto 0);
287 signal encode_114, rx_disperr_114 : std_logic_vector(3 downto 0);
288 signal ttc_BCR, ttc_L1A, ttc_ECR, ttc_pr_rdout : std_logic;
289 signal ttc_ECRID : std_logic_vector(7 downto 0);
290 signal ttc_L1ID : std_logic_vector(23 downto 0);
291 signal sof_topo_fpga1, sof_topo_fpga2, sof_topo_fpga3, sof_topo_fpga4 : std_logic;
292 signal sof_raw_fpga1, sof_raw_fpga2, sof_raw_fpga3, sof_raw_fpga4 : std_logic;
293 signal rx_resetdone, tx_resetdone, tx_fsm_resetdone, rx_fsm_resetdone, rx_realign, rx_byteisaligned : std_logic_vector(11 downto 0);
294 signal loopback : std_logic_vector (5 downto 0);
295 signal rx_disperr, encode_error : std_logic_vector(47 downto 0);
296 signal qpll_lock, qpll_refclklost, softreset_tx, softreset_rx : std_logic_vector(2 downto 0);
297 signal tx_bufstatus : std_logic_vector(23 downto 0);
298 signal gmii_rx_er_i, hub2_combined_ttc_latch, link_reset_hub1, link_reset_hub2, ttc_fifo_reset : std_logic;
299 signal locked: std_logic := '0';
300 signal reset: std_logic := '1';
303 signal s_axi_tx_tdata_hub1, s_axi_tx_tdata_data_hub1, s_axi_tx_tdata_ufc_hub1 : std_logic_vector (63 downto 0);
304 signal s_axi_tx_tvalid_hub1, s_axi_tx_tready_hub1, s_axi_tx_tready_vld_hub1, s_axi_tx_tlast_hub1 : std_logic;
305 signal s_axi_tx_tkeep_hub1 : std_logic_vector (7 downto 0);
306 signal s_axi_ufc_tx_req_hub1, s_axi_ufc_tx_ack_hub1 : std_logic;
307 signal s_axi_ufc_tx_ms_hub1 : std_logic_vector (2 downto 0);
308 signal aurora_status_hub1 : std_logic_vector(31 downto 0);
309 signal tx_lane_up_hub1 : std_logic_vector (3 downto 0);
310 signal tx_channel_up_hub1, tx_hard_err_hub1, tx_lock_hub1, pll_not_locked_hub1, aurora_tx_resetdone_hub1 : std_logic;
311 signal aurora_user_clk_hub1, sys_reset_out_hub1, init_clk_out_hub1, rd_rst_busy_hub1 : std_logic;
312 signal busy_status_hub1 : std_logic_vector (15 downto 0);
315 signal s_axi_tx_tdata_hub2, s_axi_tx_tdata_data_hub2, s_axi_tx_tdata_ufc_hub2 : std_logic_vector (63 downto 0);
316 signal s_axi_tx_tvalid_hub2, s_axi_tx_tready_hub2, s_axi_tx_tready_vld_hub2, s_axi_tx_tlast_hub2 : std_logic;
317 signal s_axi_tx_tkeep_hub2 : std_logic_vector (7 downto 0);
318 signal s_axi_ufc_tx_req_hub2, s_axi_ufc_tx_ack_hub2 : std_logic;
319 signal s_axi_ufc_tx_ms_hub2 : std_logic_vector (2 downto 0);
320 signal aurora_status_hub2 : std_logic_vector(31 downto 0);
321 signal tx_lane_up_hub2 : std_logic_vector (3 downto 0);
322 signal tx_channel_up_hub2, tx_hard_err_hub2, tx_lock_hub2, pll_not_locked_hub2, aurora_tx_resetdone_hub2 : std_logic;
323 signal aurora_user_clk_hub2, sys_reset_out_hub2, init_clk_out_hub2, rd_rst_busy_hub2 : std_logic;
324 signal busy_status_hub2 : std_logic_vector (15 downto 0);
326 signal payload_data : std_logic_vector(63 downto 0);
327 signal payload_valid, payload_last, tready_data, first : std_logic;
328 signal master_link_down_int, master_link_down_dly : std_logic_vector(3 downto 0);
329 signal fifo_empty, valid, rst_320, rst_320_n : std_logic;
330 signal bcn_cntr, BCN : std_logic_vector (11 downto 0);
333 signal ttc_din : std_logic_vector(49 downto 0);
334 signal priv_rdout_l1id : std_logic_vector(23 downto 0);
335 signal priv_rdout_reg_1, priv_rdout_reg_2 : std_logic;
338 signal data_from_mgt_bus : mgt_data_array(N_PROCESSORFPGA*2 - 1 downto 0);
339 signal char_is_k_bus : std_logic_vector(N_PROCESSORFPGA*2 - 1 downto 0);
340 signal error_from_mgt_bus : std_logic_vector(N_PROCESSORFPGA*2 - 1 downto 0);
342 signal payload_data_bus : packet_data_array(1 downto 0);
343 signal payload_valid_bus : std_logic_vector(1 downto 0);
344 signal payload_last_bus : std_logic_vector(1 downto 0);
345 signal tready_data_bus : std_logic_vector(1 downto 0);
347 signal tob_xoff_bus : std_logic_vector(1 downto 0);
348 signal raw_xoff_bus : std_logic_vector(1 downto 0);
349 signal mgt_xoff_bus, merged_busy_bus, processor_busy_bus, local_busy_bus: std_logic_vector(N_PROCESSORFPGA*2 - 1 downto 0) := (Others => '0');
351 signal packet_mux_source : std_logic_vector(7 downto 0);
353 signal TXN_OUT_i, TXP_OUT_i : std_logic_vector(11 downto 0);
354 signal ftm_ttc_mode, phase2_ttc_mode : std_logic;
355 signal phase2_ttc_delay_offset : std_logic_vector(1 downto 0);
356 signal d_i, e_i, f_i, g_i, q_i : std_logic_vector (35 downto 0);
357 signal ttc_l1A_i, ttc_bcr_i, ttc_ecr_i, ttc_pr_rdout_i, ttc_parity_i : std_logic_vector(3 downto 0);
358 signal ttc_dummy_i : std_logic_vector (23 downto 0) := (Others => '0');
359 signal ttc_ECRID_i : std_logic_vector (31 downto 0);
360 signal ttc_L1ID_i : std_logic_vector (95 downto 0);
361 signal ttc_rst_tff : std_logic := '0';
362 signal rst_320_tff_buf : std_logic_vector(1 downto 0) := (Others => '0');
363 signal hub1_ila_error_bit, hub2_ila_error_bit : std_logic;
364 signal parity12, parity32 : std_logic;
368 signal xtal_ttc_sel, force_priv_rdout, crc_disable, ttc_enable, l1a_enable: std_logic;
369 signal rod_override, tob_aurora_en, raw_aurora_en, aurora_en: std_logic_vector(1 downto 0);
370 signal tob_ro_en, raw_ro_en, p_fpga_reset_125: std_logic_vector(3 downto 0);
374 signal master_tx1_int, master_tx2_int, master_tx3_int, master_tx4_int : std_logic_vector(9 downto 0);
375 signal master_tx1_reg, master_tx2_reg, master_tx3_reg, master_tx4_reg : std_logic_vector(9 downto 0);
376 signal master_pause1_int, master_pause2_int, master_pause3_int, master_pause4_int : std_logic;
377 signal master_pause1_reg, master_pause2_reg, master_pause3_reg, master_pause4_reg : std_logic;
378 signal master_rx1_int, master_rx2_int, master_rx3_int, master_rx4_int : std_logic_vector(9 downto 0);
379 signal master_rx1_reg, master_rx2_reg, master_rx3_reg, master_rx4_reg : std_logic_vector(9 downto 0);
380 signal slaves_ipbus_up_int : std_logic_vector(3 downto 0);
381 signal dummy_tx1, dummy_tx2, dummy_tx3, dummy_tx4 : std_logic_vector(49 downto 5);
382 signal dummy_rx1, dummy_rx2, dummy_rx3, dummy_rx4 : std_logic_vector(54 downto 5);
383 signal i2c_sda_i, sda_o : std_logic;
385 signal image_type : std_logic;
391 signal ttc_L1A_p : std_logic_vector (3 downto 0);
392 signal ttc_L1A_n : std_logic_vector (3 downto 0);
393 signal ttc_BCR_p : std_logic_vector (3 downto 0);
394 signal ttc_BCR_n : std_logic_vector (3 downto 0);
395 signal ttc_ECR_p : std_logic_vector (3 downto 0);
396 signal ttc_ECR_n : std_logic_vector (3 downto 0);
397 signal ttc_pr_rdout_p : std_logic_vector (3 downto 0);
398 signal ttc_pr_rdout_n : std_logic_vector (3 downto 0);
399 signal ttc_info_F1 : std_logic_vector (37 downto 0);
400 signal ttc_info_F2 : std_logic_vector (37 downto 0);
401 signal ttc_info_F3 : std_logic_vector (37 downto 0);
402 signal ttc_info_F4 : std_logic_vector (37 downto 0);
403 signal ttc_parity_F1 : std_logic;
404 signal ttc_parity_F2 : std_logic;
405 signal ttc_parity_F3 : std_logic;
406 signal ttc_parity_F4 : std_logic;
407 signal aurora_hub1_txp : std_logic_vector (3 downto 0);
408 signal aurora_hub1_txn : std_logic_vector (3 downto 0);
409 signal aurora_hub2_txp : std_logic_vector (3 downto 0);
410 signal aurora_hub2_txn : std_logic_vector (3 downto 0);
411 signal cntl_RAW_rdy_F1_out : std_logic;
412 signal cntl_TOB_rdy_F1_out : std_logic;
413 signal cntl_RAW_rdy_F2_out : std_logic;
414 signal cntl_TOB_rdy_F2_out : std_logic;
415 signal cntl_RAW_rdy_F3_out : std_logic;
416 signal cntl_TOB_rdy_F3_out : std_logic;
417 signal cntl_RAW_rdy_F4_out : std_logic;
418 signal cntl_TOB_rdy_F4_out : std_logic;
419 signal txp_OUT : std_logic_vector(9 downto 0);
420 signal txn_OUT : std_logic_vector(9 downto 0);
421 signal sk14 : std_logic;
422 signal sk15 : std_logic;
424 signal aurora_hub2_refclk1_p : std_logic;
425 signal aurora_hub2_refclk1_n : std_logic;
426 signal aurora_hub1_refclk1_p : std_logic;
427 signal aurora_hub1_refclk1_n : std_logic;
428 signal Q_CLK_GTREFCLK_PAD_N_IN : std_logic_vector(2 downto 0);
429 signal Q_CLK_GTREFCLK_PAD_P_IN : std_logic_vector(2 downto 0);
430 signal rxp_IN : std_logic_vector (9 downto 0);
431 signal rxn_IN : std_logic_vector (9 downto 0);
432 signal crc_error_i : std_logic_vector (1 downto 0);
433 signal reg_temp0, reg_temp1, ttc_enable_pulse: std_logic;
435 signal aurora_1_gt0_txctrl_i,aurora_1_gt1_txctrl_i,aurora_1_gt2_txctrl_i,aurora_1_gt3_txctrl_i:std_logic_vector(23 downto 0);
436 signal aurora_2_gt0_txctrl_i,aurora_2_gt1_txctrl_i,aurora_2_gt2_txctrl_i,aurora_2_gt3_txctrl_i:std_logic_vector(23 downto 0);
440 attribute DONT_TOUCH : string;
442 attribute DONT_TOUCH of ttc_BCR_i : signal is "TRUE";
443 attribute DONT_TOUCH of ttc_L1A_i : signal is "TRUE";
444 attribute DONT_TOUCH of ttc_ECR_i : signal is "TRUE";
445 attribute DONT_TOUCH of ttc_pr_rdout_i : signal is "TRUE";
446 attribute DONT_TOUCH of ttc_dummy_i : signal is "TRUE";
447 attribute DONT_TOUCH of ttc_ECRID_i : signal is "TRUE";
448 attribute DONT_TOUCH of ttc_L1ID_i : signal is "TRUE";
449 attribute DONT_TOUCH of ttc_parity_i : signal is "TRUE";
451 attribute ASYNC_REG : string;
452 attribute ASYNC_REG of force_rx_error_buf : signal is "TRUE";
453 attribute ASYNC_REG of rst_320_tff_buf : signal is "TRUE";
454 attribute ASYNC_REG of hub1_combined_ttc_i : signal is "TRUE";
455 attribute ASYNC_REG of hub2_combined_ttc_i : signal is "TRUE";
462 P_CONTROL_RECORD_TO_PORTS (
463 record_in => ctrl_in,
464 record_out => ctrl_out,
465 ttc_L1A_p => ttc_L1A_p,
466 ttc_L1A_n => ttc_L1A_n,
467 ttc_BCR_p => ttc_BCR_p,
468 ttc_BCR_n => ttc_BCR_n,
469 ttc_ECR_p => ttc_ECR_p,
470 ttc_ECR_n => ttc_ECR_n,
471 ttc_pr_rdout_p => ttc_pr_rdout_p,
472 ttc_pr_rdout_n => ttc_pr_rdout_n,
473 ttc_info_F1 => ttc_info_F1,
474 ttc_info_F2 => ttc_info_F2,
475 ttc_info_F3 => ttc_info_F3,
476 ttc_info_F4 => ttc_info_F4,
477 ttc_parity_F1 => ttc_parity_F1,
478 ttc_parity_F2 => ttc_parity_F2,
479 ttc_parity_F3 => ttc_parity_F3,
480 ttc_parity_F4 => ttc_parity_F4,
481 aurora_hub1_txp => aurora_hub1_txp,
482 aurora_hub1_txn => aurora_hub1_txn,
483 aurora_hub2_txp => aurora_hub2_txp,
484 aurora_hub2_txn => aurora_hub2_txn,
485 cntl_RAW_rdy_F1_out => cntl_RAW_rdy_F1_out,
486 cntl_TOB_rdy_F1_out => cntl_TOB_rdy_F1_out,
487 cntl_RAW_rdy_F2_out => cntl_RAW_rdy_F2_out,
488 cntl_TOB_rdy_F2_out => cntl_TOB_rdy_F2_out,
489 cntl_RAW_rdy_F3_out => cntl_RAW_rdy_F3_out,
490 cntl_TOB_rdy_F3_out => cntl_TOB_rdy_F3_out,
491 cntl_RAW_rdy_F4_out => cntl_RAW_rdy_F4_out,
492 cntl_TOB_rdy_F4_out => cntl_TOB_rdy_F4_out,
497 aurora_hub2_refclk1_p => aurora_hub2_refclk1_p,
498 aurora_hub2_refclk1_n => aurora_hub2_refclk1_n,
499 aurora_hub1_refclk1_p => aurora_hub1_refclk1_p,
500 aurora_hub1_refclk1_n => aurora_hub1_refclk1_n,
501 busy_raw => processor_busy_bus(7 downto 4),
502 busy_tob => processor_busy_bus(3 downto 0),
503 Q_CLK_GTREFCLK_PAD_N_IN => Q_CLK_GTREFCLK_PAD_N_IN,
504 Q_CLK_GTREFCLK_PAD_P_IN => Q_CLK_GTREFCLK_PAD_P_IN,
509 efex_number <= eFEX_mapping(to_integer(unsigned(hardware_addr(3 downto 0))));
516 i2c_sda_i <= i2c_sda;
517 i2c_sda <= '0' when (sda_o = '0') else 'Z';
521 xtal_ttc_clk_sel <= xtal_ttc_sel;
530 f5_ipbus_access_led_block :
process(mac_clk)
531 variable counter_int: unsigned(25 downto 0) := (Others => '0');
532 constant all_ones
: unsigned(25 downto 0) := (Others => '1');
533 variable led_lit, last_onehz, penultimate_onehz, no_ip_blink, reset_counter : std_logic := '0';
535 if rising_edge(mac_clk) then
536 if rst_macclk = '1' then
537 reset_counter := '1';
540 elsif mac_tx_last = '1' and mac_tx_valid = '1' and got_ip_address = '1' then
541 reset_counter := '1';
544 elsif clk_locked = '1' and onehz = '1' and penultimate_onehz = '0' then
545 reset_counter := '1';
547 no_ip_blink := not got_ip_address;
548 elsif counter_int = all_ones then
549 reset_counter := '1';
550 led_lit := no_ip_blink;
553 if reset_counter = '1' then
554 counter_int := (Others => '0');
556 if counter_int(25) = '1' then
559 counter_int := counter_int + 1;
561 penultimate_onehz := last_onehz;
563 reset_counter := '0';
564 f5_ipbus_access_led <= led_lit;
566 end process f5_ipbus_access_led_block;
568 f5_user_led_1 <= '0' when GOLDEN else '1';
569 f5_ttc_clk_sel <= xtal_ttc_sel;
570 fifos_full <= '0' when merged_busy_bus = x"00" else '1';
572 l1a_stretch_block:
process(clk40)
573 variable counter_int: unsigned(22 downto 0) := (Others => '0');
574 constant all_ones
: unsigned(22 downto 0) := (Others => '1');
575 variable led_lit, reset_counter: std_logic := '0';
577 if rising_edge(clk40) then
578 if (reset = '1') then
579 reset_counter := '1';
581 elsif counter_int = all_ones then
582 reset_counter := '1';
584 elsif ttc_L1A = '1' and image_type = '1' then
585 reset_counter := '1';
588 if reset_counter = '1' then
589 counter_int := (Others => '0');
591 counter_int := counter_int + 1;
593 reset_counter := '0';
594 l1a_stretch <= led_lit;
596 end process l1a_stretch_block;
601 image_type <= '0' when GOLDEN else '1';
603 Module_ID <= (31 => image_type,
604 30 downto 28 => "000",
605 27 downto 26 => "00",
606 25 downto 20 => serial_number,
607 19 downto 16 => hardware_addr(11 downto 8),
608 15 downto 12 => efex_number,
609 11 downto 0 => X"efe"
612 status <= x"00000" & slaves_ipbus_up_int & fpga4_done & fpga3_done & fpga2_done & fpga1_done & locked & pll_lock_3 & '0' & pll_lock_1;
616 xtal_ttc_sel <= control_reg(0);
617 start <= control_reg(1);
618 POWERDN_B_CDCE <= not control_reg(2);
619 ftm_ttc_mode <= control_reg(3);
620 phase2_ttc_mode <= control_reg(4);
621 crc_disable <= control_reg(5);
622 enable_pll_rst <= control_reg(6);
623 ttc_enable <= control_reg(7);
624 l1a_enable <= control_reg(8);
625 rod_override <= control_reg(10 downto 9);
626 tob_ro_en <= control_reg(15 downto 12);
627 raw_ro_en <= control_reg(19 downto 16);
628 tob_aurora_en <= control_reg(21 downto 20);
629 raw_aurora_en <= control_reg(23 downto 22);
630 aurora_en <= tob_aurora_en or raw_aurora_en;
631 phase2_ttc_delay_offset <= control_reg(29 downto 28);
632 reconfig <= control_reg(30);
634 master_link_down_int(0) <= not fpga1_done;
635 master_link_down_int(1) <= not fpga2_done;
636 master_link_down_int(2) <= not fpga3_done;
637 master_link_down_int(3) <= not fpga4_done;
639 reset_and_reboot_block:
process(ipb_clk)
643 variable counter_int: unsigned(18 downto 0) := (Others => '0');
644 variable reset_phy_i, hold_counter: std_logic := '1';
645 variable trigger_reconfig_i: std_logic := '0';
647 if rising_edge(ipb_clk) then
648 if (rst_ipb = '1') then
651 trigger_reconfig_i := '0';
652 elsif (reconfig = '1') then
655 if hold_counter = '1' then
656 counter_int := (Others => '0');
658 counter_int := counter_int + 1;
660 if (counter_int(16) = '1') then
663 if (counter_int(18 downto 17) = "11") then
664 trigger_reconfig_i := '1';
666 reset_phy <= reset_phy_i;
667 trigger_reconfig <= trigger_reconfig_i;
669 end process reset_and_reboot_block;
671 phy_rstb <= not reset_phy;
674 reset_macclk_block :
process(mac_clk, clk_locked)
675 Variable reset_stretch: std_logic_vector(15 downto 0) := (Others => '1');
677 if (clk_locked /= '1') then
679 reset_stretch := (Others => '1');
680 elsif rising_edge(mac_clk) then
681 rst_macclk <= reset_stretch(15);
682 if (rst_125 = '1') then
683 reset_stretch := (Others => '1');
685 reset_stretch := reset_stretch(14 downto 0) & "0";
688 end process reset_macclk_block;
691 stretch_link_down_dly : for i in 0 to 3 generate
692 link_down_stretch :
process(mac_clk)
693 Variable reset_stretch: std_logic_vector(15 downto 0) := (Others => '1');
695 if rising_edge(mac_clk) then
696 master_link_down_dly(i) <= reset_stretch(15);
697 if (master_link_down_int(i) = '1') then
698 reset_stretch := (Others => '1');
700 reset_stretch := reset_stretch(14 downto 0) & "0";
703 end process link_down_stretch;
704 end generate stretch_link_down_dly;
707 force_rx_error:
process(mac_clk)
709 if rising_edge(mac_clk) then
710 force_rx_error_buf <= force_rx_error_buf(0) & reconfig;
714 my_rx_error <= mac_rx_error or force_rx_error_buf(1);
718 reset_125_block :
process(mac_clk)
719 variable sent_first_packet : std_logic := '0';
721 if rising_edge(mac_clk) then
722 if rst_macclk = '1' then
723 sent_first_packet := '0';
724 elsif mac_tx_last = '1' and mac_tx_valid = '1' and got_ip_address = '1' then
725 sent_first_packet := '1';
727 if sent_first_packet = '1' then
728 p_fpga_reset_125 <= control_reg(27 downto 24) or master_link_down_int or master_link_down_dly;
730 p_fpga_reset_125 <= (others => '1');
733 end process reset_125_block;
735 reset_clk125 <= p_fpga_reset_125;
737 global_ctrl_fabric :
entity ipbus_lib.ipbus_fabric_sel
738 generic map(NSLV => N_SLAVES,
739 SEL_WIDTH => ipbus_sel_width
)
743 sel => ipbus_sel_L1CaloEfex
(ipb_out.ipb_addr
),
744 ipb_to_slaves => ipbw,
745 ipb_from_slaves => ipbr
757 ipb_in => ipbw
(N_SLV_COMMON_ID_VERSION
),
758 ipb_out => ipbr
(N_SLV_COMMON_ID_VERSION
),
775 hardware_addr => hardware_addr,
776 serial_number => serial_number,
778 mac_rx_data => mac_rx_data,
779 mac_rx_error => my_rx_error,
780 mac_rx_last => mac_rx_last,
781 mac_rx_valid => mac_rx_valid,
782 mac_tx_ready => mac_tx_ready,
783 master_tx_data1 => master_tx_data1_int,
784 master_tx_data2 => master_tx_data2_int,
785 master_tx_data3 => master_tx_data3_int,
786 master_tx_data4 => master_tx_data4_int,
787 master_tx_err1 => master_tx_err1,
788 master_tx_err2 => master_tx_err2,
789 master_tx_err3 => master_tx_err3,
790 master_tx_err4 => master_tx_err4,
791 rst_ipb => rst_ipb_ctrl,
792 rst_macclk => rst_macclk,
793 p_fpga_reset_125 => p_fpga_reset_125,
794 mac_tx_data => mac_tx_data,
795 mac_tx_error => mac_tx_error,
796 mac_tx_last => mac_tx_last,
797 mac_tx_valid => mac_tx_valid,
798 master_rx_data1 => master_rx_data1_int,
799 master_rx_data2 => master_rx_data2_int,
800 master_rx_data3 => master_rx_data3_int,
801 master_rx_data4 => master_rx_data4_int,
802 master_tx_pause1 => master_pause1_int,
803 master_tx_pause2 => master_pause2_int,
804 master_tx_pause3 => master_pause3_int,
805 master_tx_pause4 => master_pause4_int,
806 master_link_down1 => master_link_down_int
(0),
807 master_link_down2 => master_link_down_int
(1),
808 master_link_down3 => master_link_down_int
(2),
809 master_link_down4 => master_link_down_int
(3),
810 got_ip_address => got_ip_address,
811 slaves_ipbus_up => slaves_ipbus_up_int
822 tx_data => master_rx_data1_int,
834 tx_data => master_rx_data2_int,
847 tx_data => master_rx_data3_int,
859 tx_data => master_rx_data4_int,
868 sysclk_p => gt_clk125_p,
869 sysclk_n => gt_clk125_n,
873 locked => clk_locked,
876 rsto_ipb_ctrl => rst_ipb_ctrl,
886 gmii_gtx_clk => gmii_gtx_clk,
887 gmii_txd => gmii_txd,
888 gmii_tx_en => gmii_tx_en,
889 gmii_tx_er => gmii_tx_er,
890 gmii_rx_clk => gmii_rx_clk,
891 gmii_rxd => gmii_rxd,
892 gmii_rx_dv => gmii_rx_dv,
893 gmii_rx_er => gmii_rx_er,
894 tx_data => mac_tx_data,
895 tx_valid => mac_tx_valid,
896 tx_last => mac_tx_last,
897 tx_error => mac_tx_error,
898 tx_ready => mac_tx_ready,
899 rx_data => mac_rx_data,
900 rx_valid => mac_rx_valid,
901 rx_last => mac_rx_last,
902 rx_error => mac_rx_error
916 ipb_in => ipbw
(N_SLV_CNTRL_INFRA
),
917 ipb_out => ipbr
(N_SLV_CNTRL_INFRA
),
920 reconfig_reg => reconfig_reg,
950 sel => select_pll
(1 downto 0),
958 cclk_o :
entity infrastructure_lib.
startup
960 flash_cclk => flash_clk
966 configure :
entity infrastructure_lib.
reconfig
967 generic map (MAX_COUNT =>
1)
971 trigger => trigger_reconfig
985 clk_in1_p => clk_40_p,
986 clk_in1_n => clk_40_n
990 reset_clk40 :
process(clk40, locked)
991 Variable reset_stretch, ttc_stretch: std_logic_vector(15 downto 0) := (Others => '1');
993 if (locked /= '1') then
995 ttc_fifo_reset <= '1';
996 reset_stretch := (Others => '1');
997 ttc_stretch := (Others => '1');
998 elsif rising_edge(clk40) then
999 reset <= reset_stretch(15);
1000 ttc_fifo_reset <= ttc_stretch(15);
1001 if (ttc_enable_pulse = '1') then
1002 ttc_stretch := (Others => '1');
1004 ttc_stretch := ttc_stretch(14 downto 0) & "0";
1006 reset_stretch := reset_stretch(14 downto 0) & "0";
1008 end process reset_clk40;
1010 reset_pll :
entity infrastructure_lib.
nreset_pll
1020 IPBusReg :
process(mac_clk)
1022 if rising_edge(mac_clk) then
1023 master_tx1_int <= master_tx1_reg;
1024 master_tx2_int <= master_tx2_reg;
1025 master_tx3_int <= master_tx3_reg;
1026 master_tx4_int <= master_tx4_reg;
1028 master_rx1_reg <= master_rx1_int;
1029 master_pause1_reg <= master_pause1_int;
1030 master_rx2_reg <= master_rx2_int;
1031 master_pause2_reg <= master_pause2_int;
1032 master_rx3_reg <= master_rx3_int;
1033 master_pause3_reg <= master_pause3_int;
1034 master_rx4_reg <= master_rx4_int;
1035 master_pause4_reg <= master_pause4_int;
1037 end process IPBusReg;
1040 IPBusIO :
process(mac_clk)
1042 if falling_edge(mac_clk) then
1043 master_tx1_reg <= master_tx_data1;
1044 master_tx2_reg <= master_tx_data2;
1045 master_tx3_reg <= master_tx_data3;
1046 master_tx4_reg <= master_tx_data4;
1048 master_rx_data1 <= master_rx1_reg;
1049 master_tx_pause1 <= master_pause1_reg;
1050 master_rx_data2 <= master_rx2_reg;
1051 master_tx_pause2 <= master_pause2_reg;
1052 master_rx_data3 <= master_rx3_reg;
1053 master_tx_pause3 <= master_pause3_reg;
1054 master_rx_data4 <= master_rx4_reg;
1055 master_tx_pause4 <= master_pause4_reg;
1057 end process IPBusIO;
1060 GOLDEN_IF : if not GOLDEN generate
1065 RXN_IN_i <= "00" & RXN_IN;
1066 RXP_IN_i <= "00" & RXP_IN;
1067 TXN_OUT <= TXN_OUT_i(9 downto 0);
1068 TXP_OUT <= TXP_OUT_i(9 downto 0);
1080 Q_CLK_GTREFCLK_PAD_P_IN => Q_CLK_GTREFCLK_PAD_P_IN,
1084 TXP_OUT => TXP_OUT_i,
1110 cntl_TOB_rdy_F1_out <= not mgt_xoff_bus(0);
1111 cntl_TOB_rdy_F2_out <= not mgt_xoff_bus(3);
1112 cntl_TOB_rdy_F3_out <= not mgt_xoff_bus(1);
1113 cntl_TOB_rdy_F4_out <= not mgt_xoff_bus(2);
1114 cntl_RAW_rdy_F1_out <= not mgt_xoff_bus(4);
1115 cntl_RAW_rdy_F2_out <= not mgt_xoff_bus(7);
1116 cntl_RAW_rdy_F3_out <= not mgt_xoff_bus(5);
1117 cntl_RAW_rdy_F4_out <= not mgt_xoff_bus(6);
1123 ttcenable_pulse:
process(clk40)
1125 if clk40' event and clk40 = '1' then
1126 reg_temp0 <= ttc_enable;
1127 reg_temp1 <= reg_temp0 ;
1128 ttc_enable_pulse <= reg_temp0 and not reg_temp1 ;
1140 reg_sel => bc_reg_sel
(3 downto 0),
1141 mux_sel => mux_sel
(3 downto 0),
1146 data_out => hub1_combined_ttc_rxclk,
1153 clk => rx_clk160
(0),
1154 reset => ttc_enable_pulse,
1161 hub1_ila_error_block:
process(rx_clk160(
0))
1163 if rising_edge(rx_clk160(0)) then
1168 if (rx_realign(8) = '0') and (rx_disperr(35 downto 32) = x"0") and (encode_error(35 downto 32) = x"0") then
1169 hub1_ila_error_bit <= '0';
1171 hub1_ila_error_bit <= '1';
1174 end process hub1_ila_error_block;
1176 crc_ila_hub1 : ila_1
1178 clk => rx_clk160
(0),
1179 probe0
(31 downto 0) => hub1_rx_data,
1180 probe0
(32) => mgt_commadret
(0),
1181 probe0
(33) => hub1_ila_error_bit,
1182 probe0
(34) => crc_error_i
(0)
1187 if clk40' event and clk40 = '1' then
1188 hub1_combined_ttc_i <= hub1_combined_ttc_rxclk;
1194 if clk40' event and clk40 = '1' then
1195 if (ttc_enable = '1') then
1196 if ((hub1_combined_ttc_i(128) = '0') or (crc_disable = '1')) and (hub1_combined_ttc_i(7 downto 0) = x"BC") then
1197 hub1_combined_ttc(128 downto 105) <= hub1_combined_ttc_i(128 downto 105);
1198 hub1_combined_ttc(104) <= (hub1_combined_ttc_i(104) and aurora_en(0)) or rod_override(0);
1199 hub1_combined_ttc(103 downto 101) <= hub1_combined_ttc_i(103 downto 101);
1200 hub1_combined_ttc(100) <= (hub1_combined_ttc_i(100) and aurora_en(0)) or rod_override(0);
1201 hub1_combined_ttc(99 downto 97) <= hub1_combined_ttc_i(99 downto 97);
1202 hub1_combined_ttc(96) <= hub1_combined_ttc_i(96) and aurora_en(0) and not rod_override(0);
1203 hub1_combined_ttc(95 downto 17) <= hub1_combined_ttc_i(95 downto 17);
1204 hub1_combined_ttc(16) <= hub1_combined_ttc_i(16) and l1a_enable;
1205 hub1_combined_ttc(15 downto 0) <= hub1_combined_ttc_i(15 downto 0);
1206 hub1_combined_ttc_valid <= '1';
1208 hub1_combined_ttc(128 downto 105) <= (Others => '0');
1209 hub1_combined_ttc(104) <= hub1_combined_ttc(104) or rod_override(0);
1210 hub1_combined_ttc(103 downto 101) <= (Others => '0');
1211 hub1_combined_ttc(100) <= hub1_combined_ttc(100) or rod_override(0);
1212 hub1_combined_ttc(99 downto 97) <= (Others => '0');
1213 hub1_combined_ttc(96) <= hub1_combined_ttc(96) and not rod_override(0);
1214 hub1_combined_ttc(95 downto 0) <= (Others => '0');
1215 hub1_combined_ttc_valid <= '0';
1218 hub1_combined_ttc <= (Others => '0');
1219 hub1_combined_ttc_valid <= '0';
1221 hub1_combined_ttc_ila <= hub1_combined_ttc_i;
1233 reg_sel => bc_reg_sel
(7 downto 4),
1234 mux_sel => mux_sel
(7 downto 4),
1239 data_out => hub2_combined_ttc_rxclk,
1246 clk => rx_clk160
(1),
1247 reset => ttc_enable_pulse,
1280 if clk40' event and clk40 = '1' then
1281 hub2_combined_ttc_i <= hub2_combined_ttc_rxclk;
1287 if clk40' event and clk40 = '1' then
1288 if (ttc_enable = '1') and (aurora_en(1) = '1') then
1289 if ((hub2_combined_ttc_i(128) = '0') or (crc_disable = '1')) and (hub2_combined_ttc_i(7 downto 0) = x"BC") then
1290 hub2_combined_ttc(128 downto 105) <= hub2_combined_ttc_i(128 downto 105);
1291 hub2_combined_ttc(104) <= hub2_combined_ttc_i(104) or rod_override(1);
1292 hub2_combined_ttc(103 downto 101) <= hub2_combined_ttc_i(103 downto 101);
1293 hub2_combined_ttc(100) <= hub2_combined_ttc_i(100) or rod_override(1);
1294 hub2_combined_ttc(99 downto 97) <= hub2_combined_ttc_i(99 downto 97);
1295 hub2_combined_ttc(96) <= hub2_combined_ttc_i(96) and not rod_override(1);
1296 hub2_combined_ttc(95 downto 0) <= hub2_combined_ttc_i(95 downto 0);
1297 hub2_combined_ttc_valid <= '1';
1299 hub2_combined_ttc(128 downto 105) <= (Others => '0');
1300 hub2_combined_ttc(104) <= hub2_combined_ttc(104) or rod_override(1);
1301 hub2_combined_ttc(103 downto 101) <= (Others => '0');
1302 hub2_combined_ttc(100) <= hub2_combined_ttc(100) or rod_override(1);
1303 hub2_combined_ttc(99 downto 97) <= (Others => '0');
1304 hub2_combined_ttc(96) <= hub2_combined_ttc(96) and not rod_override(1);
1305 hub2_combined_ttc(95 downto 0) <= (Others => '0');
1306 hub2_combined_ttc_valid <= '0';
1309 hub2_combined_ttc <= (Others => '0');
1310 hub2_combined_ttc_valid <= '0';
1312 hub2_combined_ttc_ila <= hub2_combined_ttc_i;
1316 bcn_counter :
process(clk40)
1317 variable bcn_count : unsigned (11 downto 0) := (others => '0');
1320 if clk40' event and clk40 = '1' then
1321 if ((hub1_combined_ttc_i(17) = '1') and (hub1_combined_ttc_i(128) = '0') and (hub1_combined_ttc_i(7 downto 0) = x"BC")) or (bcn_count = 3563) then
1322 bcn_count := (others => '0');
1324 bcn_count := bcn_count + 1;
1326 bcn_cntr <= std_logic_vector(bcn_count);
1328 end process bcn_counter;
1330 Aurora_link_control :
process(clk40)
1332 if rising_edge(clk40) then
1333 if (hub1_combined_ttc(100) = '1') and (hub1_combined_ttc(104) = '1') then
1334 tob_xoff_bus(0) <= hub1_combined_ttc(8);
1335 raw_xoff_bus(0) <= hub1_combined_ttc(9);
1337 tob_xoff_bus(0) <= '1';
1338 raw_xoff_bus(0) <= '1';
1340 if (hub2_combined_ttc(100) = '1') and (hub2_combined_ttc(104) = '1') then
1341 tob_xoff_bus(1) <= hub2_combined_ttc(8);
1342 raw_xoff_bus(1) <= hub2_combined_ttc(9);
1344 tob_xoff_bus(1) <= '1';
1345 raw_xoff_bus(1) <= '1';
1347 link_reset_hub1 <= hub1_combined_ttc(96);
1348 link_reset_hub2 <= hub2_combined_ttc(96);
1350 end process Aurora_link_control;
1352 ttc_din <= "000000" & hub1_combined_ttc(63 downto 32) & bcn_cntr;
1354 priv_rdout_block:
process(clk40)
1355 variable l1id_match: unsigned(23 downto 0) := (Others => '0');
1356 variable pulse_readout: std_logic := '0';
1358 if rising_edge(clk40) then
1359 if (hub1_combined_ttc(18) = '1') then
1360 l1id_match := (Others => '0');
1361 elsif (hub1_combined_ttc(16) = '1') then
1362 if (unsigned(hub1_combined_ttc(55 downto 32)) >= l1id_match) then
1363 l1id_match := l1id_match + unsigned(input_data_readout_control(31 downto 8));
1365 pulse_readout := '0';
1367 priv_rdout_l1id <= std_logic_vector(l1id_match);
1368 priv_rdout_reg_1 <= input_data_readout_control(0);
1369 priv_rdout_reg_2 <= priv_rdout_reg_1;
1370 if (priv_rdout_reg_1 = '1' and priv_rdout_reg_2 = '0') then
1371 pulse_readout := '1';
1373 if (pulse_readout = '1') or (input_data_readout_control(2) = '1') then
1374 force_priv_rdout <= '1';
1376 force_priv_rdout <= '0';
1379 end process priv_rdout_block;
1381 ttc_block:
process(clk40)
1383 if rising_edge(clk40) then
1384 ttc_L1A <= hub1_combined_ttc(16);
1385 ttc_BCR <= hub1_combined_ttc(17);
1386 ttc_ECR <= hub1_combined_ttc(18);
1387 if hub1_combined_ttc(16) = '1' then
1388 ttc_ECRID <= hub1_combined_ttc(63 downto 56);
1389 ttc_L1ID <= hub1_combined_ttc(55 downto 32);
1390 if (input_data_readout_control(1) = '1') and (hub1_combined_ttc(55 downto 32) = priv_rdout_l1id) then
1391 ttc_pr_rdout <= '1';
1393 ttc_pr_rdout <= force_priv_rdout;
1396 ttc_ECRID <= (Others => '0');
1397 ttc_L1ID <= x"000" & bcn_cntr;
1398 ttc_pr_rdout <= '0';
1401 end process ttc_block;
1403 d_i <= ttc_L1ID & ttc_ECRID & ttc_pr_rdout & ttc_ECR & ttc_BCR & ttc_L1A;
1405 combined_ttc_ila : ila_0
1408 probe0
(11 downto 0) => hub1_combined_ttc_ila
(11 downto 0),
1409 probe0
(15 downto 12) => hub1_combined_ttc_ila
(19 downto 16),
1410 probe0
(47 downto 16) => hub1_combined_ttc_ila
(63 downto 32),
1411 probe0
(48) => hub1_combined_ttc_ila
(96),
1412 probe0
(49) => hub1_combined_ttc_ila
(100),
1413 probe0
(50) => hub1_combined_ttc_ila
(104),
1414 probe0
(51) => hub1_combined_ttc_ila
(128),
1415 probe0
(63 downto 52) => hub2_combined_ttc_ila
(11 downto 0),
1416 probe0
(65 downto 64) => hub2_combined_ttc_ila
(17 downto 16),
1417 probe0
(66) => hub2_combined_ttc_ila
(96),
1418 probe0
(67) => hub2_combined_ttc_ila
(100),
1419 probe0
(68) => hub2_combined_ttc_ila
(104),
1420 probe0
(69) => hub2_combined_ttc_ila
(128)
1423 ftm_ttc_mode_sel :
process(clk40)
1425 if clk40' event and clk40 = '1' then
1426 if ftm_ttc_mode = '1' then
1434 shift_mux36_d : for i in 0 to 35 generate
1435 SRLC32E_inst_12 : SRLC32E
1437 INIT => X"00000000"
)
1441 A =>
(Others => '1'
),
1446 end generate shift_mux36_d;
1448 shift_mux36_e : for i in 0 to 35 generate
1449 SRLC32E_inst_12 : SRLC32E
1451 INIT => X"00000000"
)
1455 A =>
(Others => '1'
),
1460 end generate shift_mux36_e;
1462 shift_mux36_f : for i in 0 to 35 generate
1463 SRLC32E_inst_12 : SRLC32E
1465 INIT => X"00000000"
)
1469 A =>
(Others => '1'
),
1474 end generate shift_mux36_f;
1476 ttc_parity_calc :
entity infrastructure_lib.
ttc_parity
1478 ttc_data => q_i
(11 downto 4) & q_i
(35 downto 12),
1479 parity12 => parity12,
1480 parity32 => parity32
1484 pipe_gen : for i in 0 to 3 generate
1485 pipe_ttc :
process(clk40)
1487 if clk40' event and clk40 = '1' then
1488 ttc_L1A_i(i) <= q_i(0);
1489 ttc_BCR_i(i) <= q_i(1);
1490 ttc_ECR_i(i) <= q_i(2);
1491 ttc_pr_rdout_i(i) <= q_i(3);
1492 ttc_ECRID_i(7+i*8 downto i*8) <= q_i(11 downto 4);
1493 ttc_L1ID_i(23+i*24 downto i*24) <= q_i(35 downto 12);
1494 ttc_dummy_i(5+i*6 downto i*6) <= q_i(17 downto 12);
1495 if q_i(0) = '1' then
1496 ttc_parity_i(i) <= parity32;
1498 ttc_parity_i(i) <= parity12;
1502 end generate pipe_gen;
1504 ttc_bcr_gen : for i in 0 to 3 generate
1514 ttc_L1A_gen : for i in 0 to 3 generate
1524 ttc_ecr_gen : for i in 0 to 3 generate
1534 ttc_pr_rdout_gen : for i in 0 to 3 generate
1537 o => ttc_pr_rdout_p
(i
),
1538 ob => ttc_pr_rdout_n
(i
),
1539 i => ttc_pr_rdout_i
(i
)
1546 ttc_info_F1 <= ttc_dummy_i(5 downto 0) & ttc_ECRID_i(7 downto 0) & ttc_L1ID_i(23 downto 0);
1547 ttc_info_F2 <= ttc_dummy_i(11 downto 6) & ttc_ECRID_i(15 downto 8) & ttc_L1ID_i(47 downto 24);
1548 ttc_info_F3 <= ttc_dummy_i(17 downto 12) & ttc_ECRID_i(23 downto 16) & ttc_L1ID_i(71 downto 48);
1549 ttc_info_F4 <= ttc_dummy_i(23 downto 18) & ttc_ECRID_i(31 downto 24) & ttc_L1ID_i(95 downto 72);
1550 ttc_parity_F1 <= ttc_parity_i(0);
1551 ttc_parity_F2 <= ttc_parity_i(1);
1552 ttc_parity_F3 <= ttc_parity_i(2);
1553 ttc_parity_F4 <= ttc_parity_i(3);
1561 ipb_in => ipbw
(N_SLV_BACKPLANE
),
1562 ipb_out => ipbr
(N_SLV_BACKPLANE
),
1565 aurora_1_gt0_txctl => aurora_1_gt0_txctrl_i,
1566 aurora_1_gt1_txctl => aurora_1_gt1_txctrl_i,
1567 aurora_1_gt2_txctl => aurora_1_gt2_txctrl_i,
1568 aurora_1_gt3_txctl => aurora_1_gt3_txctrl_i,
1570 aurora_2_gt0_txctl => aurora_2_gt0_txctrl_i,
1571 aurora_2_gt1_txctl => aurora_2_gt1_txctrl_i,
1572 aurora_2_gt2_txctl => aurora_2_gt2_txctrl_i,
1573 aurora_2_gt3_txctl => aurora_2_gt3_txctrl_i,
1575 control_busy_bus => local_busy_bus,
1576 processor_busy_bus => processor_busy_bus,
1584 rx_clk160 => rx_clk160,
1585 rx_clk280 => rx_clk280,
1588 ipb_in => ipbw
(N_SLV_CNTRL_MGT
),
1589 ipb_out => ipbr
(N_SLV_CNTRL_MGT
),
1591 loopback => loopback,
1592 softreset_tx => softreset_tx,
1593 softreset_rx => softreset_rx,
1594 qpll_lock => qpll_lock,
1595 qpll_refclklost => qpll_refclklost,
1596 rx_resetdone => rx_resetdone,
1597 rx_fsm_resetdone => rx_fsm_resetdone,
1598 rx_byteisaligned => rx_byteisaligned,
1599 tx_resetdone => tx_resetdone,
1600 tx_fsm_resetdone => tx_fsm_resetdone,
1601 tx_bufstatus => tx_bufstatus,
1602 rx_realign => rx_realign,
1603 rx_disperr => rx_disperr,
1604 encode_error => encode_error,
1605 bc_reg_sel => bc_reg_sel,
1606 delay_cntr_0 => delay_cntr_0,
1607 delay_cntr_1 => delay_cntr_1,
1609 mgt_enable => mgt_enable,
1610 crc_error => crc_error_i
1615 ttc_rst_clk40 :
process(clk40)
1616 variable last_ttc_enable: std_logic:= '0';
1618 if rising_edge(clk40) then
1619 if (reset = '1') or (mgt_enable(0) = '0') or ((ttc_enable xor last_ttc_enable) = '1') then
1621 ttc_rst_tff <= not ttc_rst_tff;
1623 ttc_rst_tff <= ttc_rst_tff;
1625 last_ttc_enable := ttc_enable;
1627 end process ttc_rst_clk40;
1629 ttc_rst_clk320 :
process(clk320)
1631 if rising_edge(clk320) then
1632 rst_320_tff_buf <= rst_320_tff_buf(0) & ttc_rst_tff;
1634 end process ttc_rst_clk320;
1636 reset_clk320 :
process(clk320)
1637 Variable stretch: std_logic_vector(7 downto 0) := (Others => '1');
1639 if rising_edge(clk320) then
1640 if ((rst_320_tff_buf(1) xor rst_320_tff_buf(0)) = '1') then
1641 stretch := (Others => '1');
1643 stretch := stretch(6 downto 0) & "0";
1645 rst_320 <= stretch(7);
1647 end process reset_clk320;
1649 rst_320_n <= not rst_320;
1652 clk_mgt_bus(i) <= rx_clk280(i);
1653 end generate clk_mgt_bus_gen;
1658 TOB_FIFO_ADDR_WIDTH =>
13,
1659 MERGED_FIFO_ADDR_WIDTH =>
13,
1660 RAW_FIFO_ADDR_WIDTH =>
13,
1661 TOB_SPY_ADDR_WIDTH =>
11,
1662 RAW_SPY_ADDR_WIDTH =>
11,
1663 MERGER_SPY_ADDR_WIDTH =>
10,
1664 AURORA_SPY_ADDR_WIDTH =>
12,
1665 MAX_BUILT_PACKET_WIDTH =>
9
1670 clk_mgt_bus => clk_mgt_bus,
1676 eFEX_number
(7 downto 4) => hardware_addr
(11 downto 8),
1677 eFEX_number
(3 downto 0) => efex_number,
1679 ipb_in => ipbw
(N_SLV_DATA_PATH
),
1680 ipb_out => ipbr
(N_SLV_DATA_PATH
),
1682 bcr_40 => hub1_combined_ttc
(17),
1683 ecr_40 => hub1_combined_ttc
(18),
1684 rst_ttc => ttc_fifo_reset,
1685 ttc_wr_en => hub1_combined_ttc
(16),
1686 ttc_rd_en => q_i
(0),
1689 l1a_enable => l1a_enable,
1690 source_enable
(3 downto 0)=> tob_ro_en,
1691 source_enable
(7 downto 4)=> raw_ro_en,
1692 tob_destination_enable => tob_aurora_en,
1693 raw_destination_enable => raw_aurora_en,
1695 data_from_mgt_bus => data_from_mgt_bus,
1696 char_is_k_bus => char_is_k_bus,
1697 error_from_mgt_bus => error_from_mgt_bus,
1699 payload_data_bus => payload_data_bus,
1700 payload_valid_bus => payload_valid_bus,
1701 payload_last_bus => payload_last_bus,
1702 tready_data_bus => tready_data_bus,
1703 packet_mux_source => packet_mux_source,
1705 tob_xoff_bus => tob_xoff_bus,
1706 raw_xoff_bus => raw_xoff_bus,
1707 mgt_xoff_bus => mgt_xoff_bus,
1708 busy_bus => local_busy_bus
1711 merged_busy_bus <= (local_busy_bus or processor_busy_bus) and (raw_ro_en & tob_ro_en);
1713 busy_status_block:
process(ipb_clk)
1714 variable busy_status: std_logic_vector(15 downto 0);
1716 if rising_edge(ipb_clk) then
1717 busy_status := (processor_busy_bus and (raw_ro_en & tob_ro_en)) & (local_busy_bus and (raw_ro_en & tob_ro_en));
1718 if (aurora_en(0) = '1') then
1719 busy_status_hub1 <= busy_status;
1721 busy_status_hub1 <= (Others => '0');
1723 if (aurora_en(1) = '1') then
1724 busy_status_hub2 <= busy_status;
1726 busy_status_hub2 <= (Others => '0');
1729 end process busy_status_block;
1731 hub1_axi_stream_fifo : axi_stream_fifo
1733 wr_rst_busy =>
open,
1734 rd_rst_busy => rd_rst_busy_hub1,
1735 m_aclk => aurora_user_clk_hub1,
1737 s_aresetn => rst_320_n,
1738 s_axis_tvalid => payload_valid_bus
(0),
1739 s_axis_tready => tready_data_bus
(0),
1740 s_axis_tdata => payload_data_bus
(0),
1741 s_axis_tkeep =>
(others => '0'
),
1742 s_axis_tlast => payload_last_bus
(0),
1743 s_axis_tuser =>
(others => '0'
),
1744 m_axis_tvalid => s_axi_tx_tvalid_hub1,
1745 m_axis_tready => s_axi_tx_tready_vld_hub1,
1746 m_axis_tdata => s_axi_tx_tdata_data_hub1,
1747 m_axis_tkeep => s_axi_tx_tkeep_hub1,
1748 m_axis_tlast => s_axi_tx_tlast_hub1,
1749 m_axis_tuser =>
open
1754 clock => aurora_user_clk_hub1,
1755 reset => rd_rst_busy_hub1,
1756 enable => aurora_en
(0),
1757 busy_tob => merged_busy_bus
(3 downto 0),
1758 busy_raw => merged_busy_bus
(7 downto 4),
1759 s_axi_tx_tready => s_axi_tx_tready_hub1,
1760 s_axi_ufc_tx_tready => s_axi_ufc_tx_ack_hub1,
1761 s_axi_ufc_tx_tvalid => s_axi_ufc_tx_req_hub1,
1762 s_axi_ufc_tx_tdata => s_axi_ufc_tx_ms_hub1,
1763 AXI_UFC_TDATA => s_axi_tx_tdata_ufc_hub1
1766 s_axi_tx_tdata_hub1 <= s_axi_tx_tdata_data_hub1 when s_axi_tx_tready_hub1 = '1' else s_axi_tx_tdata_ufc_hub1;
1768 s_axi_tx_tready_vld_hub1 <= s_axi_tx_tready_hub1 and not rd_rst_busy_hub1;
1770 hub2_axi_stream_fifo : axi_stream_fifo
1772 wr_rst_busy =>
open,
1773 rd_rst_busy => rd_rst_busy_hub2,
1774 m_aclk => aurora_user_clk_hub2,
1776 s_aresetn => rst_320_n,
1777 s_axis_tvalid => payload_valid_bus
(1),
1778 s_axis_tready => tready_data_bus
(1),
1779 s_axis_tdata => payload_data_bus
(1),
1780 s_axis_tkeep =>
(others => '0'
),
1781 s_axis_tlast => payload_last_bus
(1),
1782 s_axis_tuser =>
(others => '0'
),
1783 m_axis_tvalid => s_axi_tx_tvalid_hub2,
1784 m_axis_tready => s_axi_tx_tready_vld_hub2,
1785 m_axis_tdata => s_axi_tx_tdata_data_hub2,
1786 m_axis_tkeep => s_axi_tx_tkeep_hub2,
1787 m_axis_tlast => s_axi_tx_tlast_hub2,
1788 m_axis_tuser =>
open
1793 clock => aurora_user_clk_hub2,
1794 reset => rd_rst_busy_hub2,
1795 enable => aurora_en
(1),
1796 busy_tob => merged_busy_bus
(3 downto 0),
1797 busy_raw => merged_busy_bus
(7 downto 4),
1798 s_axi_tx_tready => s_axi_tx_tready_hub2,
1799 s_axi_ufc_tx_tready => s_axi_ufc_tx_ack_hub2,
1800 s_axi_ufc_tx_tvalid => s_axi_ufc_tx_req_hub2,
1801 s_axi_ufc_tx_tdata => s_axi_ufc_tx_ms_hub2,
1802 AXI_UFC_TDATA => s_axi_tx_tdata_ufc_hub2
1805 s_axi_tx_tdata_hub2 <= s_axi_tx_tdata_data_hub2 when s_axi_tx_tready_hub2 = '1' else s_axi_tx_tdata_ufc_hub2;
1807 s_axi_tx_tready_vld_hub2 <= s_axi_tx_tready_hub2 and not rd_rst_busy_hub2;
1829 output_channel1_ila : ila_0
1831 clk => aurora_user_clk_hub1,
1832 probe0
(63 downto 0) => s_axi_tx_tdata_hub1,
1833 probe0
(64) => s_axi_tx_tvalid_hub1,
1834 probe0
(65) => s_axi_tx_tlast_hub1,
1835 probe0
(66) => s_axi_tx_tready_hub1,
1836 probe0
(67) => s_axi_ufc_tx_req_hub1,
1837 probe0
(68) => s_axi_ufc_tx_ack_hub1,
1841 output_channel2_ila : ila_0
1843 clk => aurora_user_clk_hub2,
1844 probe0
(63 downto 0) => s_axi_tx_tdata_hub2,
1845 probe0
(64) => s_axi_tx_tvalid_hub2,
1846 probe0
(65) => s_axi_tx_tlast_hub2,
1847 probe0
(66) => s_axi_tx_tready_hub2,
1848 probe0
(67) => s_axi_ufc_tx_req_hub2,
1849 probe0
(68) => s_axi_ufc_tx_ack_hub2,
1856 top_aurora_hub1 :
entity infrastructure_lib.
aurora_hub2
1860 s_axi_tx_tdata => s_axi_tx_tdata_hub1,
1861 s_axi_tx_tvalid => s_axi_tx_tvalid_hub1,
1862 s_axi_tx_tready => s_axi_tx_tready_hub1,
1863 s_axi_tx_tkeep => s_axi_tx_tkeep_hub1,
1864 s_axi_tx_tlast => s_axi_tx_tlast_hub1,
1866 s_axi_ufc_tx_req => s_axi_ufc_tx_req_hub1,
1867 s_axi_ufc_tx_ms => s_axi_ufc_tx_ms_hub1,
1868 s_axi_ufc_tx_ack => s_axi_ufc_tx_ack_hub1,
1870 txp => aurora_hub1_txp,
1871 txn => aurora_hub1_txn,
1874 gt_refclk1_p => aurora_hub1_refclk1_p,
1875 gt_refclk1_n => aurora_hub1_refclk1_n,
1877 tx_hard_err => tx_hard_err_hub1,
1879 tx_channel_up => tx_channel_up_hub1,
1880 tx_lane_up => tx_lane_up_hub1,
1882 aurora_gt0_txctrl => aurora_1_gt0_txctrl_i,
1883 aurora_gt1_txctrl => aurora_1_gt1_txctrl_i,
1884 aurora_gt2_txctrl => aurora_1_gt2_txctrl_i,
1885 aurora_gt3_txctrl => aurora_1_gt3_txctrl_i,
1887 user_clk_out => aurora_user_clk_hub1,
1888 sys_reset_out => sys_reset_out_hub1,
1889 tx_lock => tx_lock_hub1,
1890 init_clk => mac_clk,
1891 init_clk_out => init_clk_out_hub1,
1892 pll_not_locked => pll_not_locked_hub1,
1893 tx_resetdone => aurora_tx_resetdone_hub1,
1894 link_reset => link_reset_hub1
1897 aurora_status_hub1 <= busy_status_hub1 & aurora_en(0) & hub1_combined_ttc_valid & hub1_combined_ttc(104) & hub1_combined_ttc(100) & hub1_combined_ttc(96) & hub1_combined_ttc(9) & hub1_combined_ttc(8) & aurora_tx_resetdone_hub1 & tx_lock_hub1 & pll_not_locked_hub1 & tx_hard_err_hub1 & tx_channel_up_hub1 & tx_lane_up_hub1;
1902 top_aurora_hub2 :
entity infrastructure_lib.
aurora_hub2
1906 s_axi_tx_tdata => s_axi_tx_tdata_hub2,
1907 s_axi_tx_tvalid => s_axi_tx_tvalid_hub2,
1908 s_axi_tx_tready => s_axi_tx_tready_hub2,
1909 s_axi_tx_tkeep => s_axi_tx_tkeep_hub2,
1910 s_axi_tx_tlast => s_axi_tx_tlast_hub2,
1912 s_axi_ufc_tx_req => s_axi_ufc_tx_req_hub2,
1913 s_axi_ufc_tx_ms => s_axi_ufc_tx_ms_hub2,
1914 s_axi_ufc_tx_ack => s_axi_ufc_tx_ack_hub2,
1916 txp => aurora_hub2_txp,
1917 txn => aurora_hub2_txn,
1920 gt_refclk1_p => aurora_hub2_refclk1_p,
1921 gt_refclk1_n => aurora_hub2_refclk1_n,
1923 tx_hard_err => tx_hard_err_hub2,
1925 tx_channel_up => tx_channel_up_hub2,
1926 tx_lane_up => tx_lane_up_hub2,
1928 aurora_gt0_txctrl => aurora_2_gt0_txctrl_i,
1929 aurora_gt1_txctrl => aurora_2_gt1_txctrl_i,
1930 aurora_gt2_txctrl => aurora_2_gt2_txctrl_i,
1931 aurora_gt3_txctrl => aurora_2_gt3_txctrl_i,
1933 user_clk_out => aurora_user_clk_hub2,
1934 sys_reset_out => sys_reset_out_hub2,
1935 tx_lock => tx_lock_hub2,
1936 init_clk => mac_clk,
1937 init_clk_out => init_clk_out_hub2,
1938 pll_not_locked => pll_not_locked_hub2,
1939 tx_resetdone => aurora_tx_resetdone_hub2,
1940 link_reset => link_reset_hub2
1943 aurora_status_hub2 <= busy_status_hub2 & aurora_en(1) & hub2_combined_ttc_valid & hub2_combined_ttc(104) & hub2_combined_ttc(100) & hub2_combined_ttc(96) & hub2_combined_ttc(9) & hub2_combined_ttc(8) & aurora_tx_resetdone_hub2 & tx_lock_hub2 & pll_not_locked_hub2 & tx_hard_err_hub2 & tx_channel_up_hub2 & tx_lane_up_hub2;
out input_data_readout_control std_logic_vector( 31 downto 0)
Privileged readout control.
in ipb_rst std_logic
ipbus reset
in aurora_status_1 std_logic_vector( 31 downto 0)
aurora status hub1
in clk std_logic
TTC fabric clock.
in control_xoff_bus std_logic_vector( 7 downto 0)
XOff and BUSY.
in aurora_status_2 std_logic_vector( 31 downto 0)
aurora status hub2
in ipb_clk std_logic
ipbus clock
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
in rst std_logic
fabric reset
in ttc_info std_logic_vector( 35 downto 0)
ttc_L1ID & ttc_ECRID & ttc_pr_rdout & ttc_ECR & ttc_BCR & ttc_L1A
in clk std_logic
MGT rx clock of 160MHz.
in mgt_enable std_logic
mgt_enbable
in mgt_commdet std_logic
MGT commadet.
in rxdata std_logic_vector( 31 downto 0)
MGT rx data.
out crc_error std_logic
crc error
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.
control fpga infrastructure slaves
out pll_le std_logic
spi pll enable enable
out pll_mosi std_logic
spi pll output signals
in ipb_rst std_logic
IPBus Reset input.
out flash_le std_logic
spi flash enable
out control_reg std_logic_vector( 31 downto 0)
module control signals
in flash_miso std_logic
spi flash input signals
in status std_logic_vector( 31 downto 0)
module status signals
out pll_clko std_logic
spi pll clock
in ipb_clk std_logic
IPBus clock.
out flash_clko std_logic
spi flash clock
out scl std_logic
i2c bus signals
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
in pll_miso std_logic
spi pll input signals
out pll_select std_logic_vector( 1 downto 0)
spi pll select
out flash_mosi std_logic
spi flash output signals
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
Top ipbus interconnection.
out rx_data std_logic_vector( 8 DOWNTO 0)
slave_rx_data
in mac_clk std_logic
clock 125 MHz
in master_rx_data std_logic_vector( 9 DOWNTO 0)
IPBUS signals of master rx_data from control FPGA.
in tx_data std_logic_vector( 8 DOWNTO 0)
slave_tx_data
out master_rx_err std_logic
parity error
in rst_macclk std_logic
macclk Reset input
out process_tx_data std_logic_vector( 9 DOWNTO 0)
master_tx_data
MGT ipbus slave for control FPGA.
in enable_pll_rst std_logic
pll reset enable
out SYNC_B_CDCE std_logic
pll synch_b_CDCE
Instantiate the readout merging and routing logic...
PLL enable for the control FPGA.
in sel STD_LOGIC_VECTOR( 1 downto 0)
selector bits
out pll_en_1 STD_LOGIC
enable pll 1
in pll_en STD_LOGIC
pll enable
out pll_en_3 STD_LOGIC
enable pll 3
FPGA Reconfiguration State Machine.
in WBSTAR std_logic_vector( 31 downto 0)
Warm Boot Start Address.
Top Synchronisation of the control FPGA.
out delay_num std_logic_vector( 3 downto 0)
counted delay on the first stage of the synchronisation
in reset std_logic
reset active high
in rx_resetdone std_logic
rx reset done of the MGT
in MGT_Commadet std_logic
comma detected for incoming data
in mux_sel std_logic_vector( 3 downto 0)
setting the first stage mux
out data_out std_logic_vector( 128 downto 0)
data out of 128 bits
out reg128_latch std_logic
latch enable
in data_in std_logic_vector( 31 downto 0)
rx data in
in start std_logic
start pulse for the calibration to start
in crc_error_in std_logic
crc_error input
in enable_mgt std_logic
enable mgt rx register
in TTC_clk std_logic
ttc clk of 40MHz
in reg_sel std_logic_vector( 3 downto 0)
setting BC mux
in rx_clk160 std_logic
rx clock of the mgt
This is the top level of the Control FPGA.
obufds pr_rdpr_rd
ttc privilage read out fanout to the process fpgas
obufds bcrbcr
ttc bcr fanout to the process fpgas
obufds ecrecr
ttc ecr fanout to the process fpgas
This is the top level of the Control FPGA.
INFRASTRUCTURE_LIB_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)
CON_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the Hog submodule.
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 top folder: list file, xdcs, XMLs, tcl file and this file.
GLOBAL_TIME std_logic_vector( 31 downto 0) := x"00000000"
Time format 00HHMMSS in decimal.
GLOBAL_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the repository (format: MMmmcccc in hex)
GLOBAL_DATE std_logic_vector( 31 downto 0) := x"00000000"
Date format DDMMYYYY in decimal.
HOG_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the Hog submodule.
N_PROCESSORFPGA positive := 4
number of Processor FPGA instantiated in top_mgt_cfgpa
INFRASTRUCTURE_LIB_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of infrastructure library (format: MMmmcccc in hex)
XML_VER std_logic_vector( 31 downto 0) := x"00000000"
Version of the XMLs.
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.
IPBUS_LIB_SHA std_logic_vector( 31 downto 0) := x"00000000"
Short 7-digit git SHA of the ipbus submodule.
out hub1_rx_data std_logic_vector( 31 downto 0)
rx data from ttc information gt0
out rx_resetdone std_logic_vector( 11 downto 0)
rx reset done of the all of the MGTs
in clk40 std_logic
clk40 generatred from ttc clock
out rx_disperr std_logic_vector( 47 downto 0)
rx_disperr of the all of the MGTs
out rx_clk160 std_logic_vector( 3 downto 0)
rx clock 160MHz
out tx_fsm_resetdone std_logic_vector( 11 downto 0)
tx fsm reset done of the all of the MGTs
out error_from_mgt_bus std_logic_vector( NProcessorFPGA* 2- 1 downto 0)
error from the MGT links of 11.2Gbps
out rx_fsm_resetdone std_logic_vector( 11 downto 0)
rx fsm reset done of the all of the MGTs
out char_is_k_bus std_logic_vector( NProcessorFPGA* 2- 1 downto 0)
k char from process fpgas
out encode_error std_logic_vector( 47 downto 0)
encode_error of the all of the MGTs
out mgt_QPLLLOCK_OUT std_logic_vector( 2 downto 0)
mgt_QPLLLOCK_OUT
out mgt_QPLLREFCLKLOST_OUT std_logic_vector( 2 downto 0)
mgt_QPLLREFCLKLOST_OUT
out hub2_rx_data std_logic_vector( 31 downto 0)
rx data from gt1
in clk160 std_logic
clk160 generatred from ttc clock
out tx_resetdone std_logic_vector( 11 downto 0)
tx reset done of the all of the MGTs
in loopback std_logic_vector( 5 downto 0)
loopback
in mgt_SOFT_RESET_TX_IN std_logic_vector( 2 downto 0)
soft reset of tx quad
in Q_CLK_GTREFCLK_PAD_N_IN std_logic_vector( 2 downto 0)
clock input to the quad
in RXN_IN std_logic_vector( 11 downto 0)
rx quad input
in mgt_SOFT_RESET_RX_IN std_logic_vector( 2 downto 0)
soft reset of rx quad
out rx_realign std_logic_vector( 11 downto 0)
rx_realign of the all of the MGTs
out data_from_mgt_bus mgt_data_array( NProcessorFPGA* 2- 1 downto 0)
rx data from process fpgas
out rx_clk280 std_logic_vector( 7 downto 0)
rx clock 280MHz
out TXN_OUT std_logic_vector( 11 downto 0)
tx quad input
out tx_bufstatus std_logic_vector( 23 downto 0)
tx_bufstatus of the all of the MGTs
out mgt_commadret std_logic_vector( 1 downto 0)
mgt_commadret
out rx_byteisaligned std_logic_vector( 11 downto 0)
rx_byteisaligned of the all of the MGTs
generate parity for data going from Control FPGA to Processors