46 use IEEE.STD_LOGIC_1164.
ALL;
49 use ipbus_lib.ipbus.
all;
51 library TOB_rdout_lib;
54 use TOB_rdout_lib.ipbus_decode_efex_readout.
all;
70 L1A_ID : in STD_LOGIC_VECTOR (31 downto 0);
72 BCN_in : in STD_LOGIC_VECTOR (11 downto 0);
212 signal ipbw: ipb_wbus_array(N_SLAVES - 1 downto 0);
213 signal ipbr, ipbr_d: ipb_rbus_array(N_SLAVES-1 downto 0);
215 signal RDOUT_PULSE_REG_i : STD_LOGIC_VECTOR (31 downto 0);
216 signal rst_pulse_reg_i : STD_LOGIC := '0';
217 signal rst_pulse_reg_ii : STD_LOGIC;
218 signal IPbw_in_i : ipb_wbus;
219 signal IPbr_out_i : ipb_rbus;
220 signal TEST_CONTROL_REG_i : STD_LOGIC_VECTOR (31 downto 0);
221 signal rst_ECR_dbg_cntr_i : STD_LOGIC := '0' ;
222 signal rst_L1A_dbg_cntr_i : STD_LOGIC := '0' ;
224 signal ipbus_out_raw_dpram_i : ipb_wbus;
225 signal ipbus_in_raw_dpram_i : ipb_rbus;
226 signal ipbus_out_tob_dpram_i : ipb_wbus;
227 signal ipbus_in_tob_dpram_i : ipb_rbus;
232 ipb_out <= IPbr_out_i ;
245 U1_rdout_fabric:
entity ipbus_lib.ipbus_fabric_sel
246 generic map(NSLV => N_SLAVES,
247 SEL_WIDTH => ipbus_sel_width
)
250 ipb_out => IPbr_out_i,
251 sel => ipbus_sel_efex_readout
(ipb_in.ipb_addr
),
252 ipb_to_slaves => ipbw,
253 ipb_from_slaves => ipbr
258 U2_Test_Cntl_Reg :
entity ipbus_lib.ipbus_ctrlreg_v
265 ipbus_in => ipbw
(N_SLV_TEST_CONTROL_REG
),
266 ipbus_out => ipbr
(N_SLV_TEST_CONTROL_REG
),
267 d =>
(others=>
(others=> '0'
)),
268 ctrl_default
(0) =>
(others=> '0'
),
269 q
(0) =>
(TEST_CONTROL_REG_i
),
276 U3_pulsed_register :
entity ipbus_lib.ipbus_ctrlreg_v
282 reset => rst_pulse_reg_ii,
283 ipbus_in => ipbw
(N_SLV_RDOUT_PULSE_REG
),
284 ipbus_out => ipbr
(N_SLV_RDOUT_PULSE_REG
),
285 d =>
(others=>
(others=> '0'
)),
286 q
(0) =>
(RDOUT_PULSE_REG_i
),
290 rst_pulse_reg_ii <= rst_pulse_reg_i OR ipb_rst;
293 U3_top_level_counters :
entity ipbus_lib.ipbus_ctrlreg_v
300 ipbus_in => ipbw
(N_SLV_TOP_LEVEL_COUNTERS
),
301 ipbus_out => ipbr
(N_SLV_TOP_LEVEL_COUNTERS
),
315 U3_ttc_parity_L1A_BCN :
entity ipbus_lib.ipbus_ctrlreg_v
322 ipbus_in => ipbw
(N_SLV_TTC_PARITY_L1A_BCN
),
323 ipbus_out => ipbr
(N_SLV_TTC_PARITY_L1A_BCN
),
338 U4_rst_pulse_reg :
process (
ipb_clk)
341 if RDOUT_PULSE_REG_i /= X"00000000" then
342 rst_pulse_reg_i <= '1';
344 rst_pulse_reg_i <= '0';
355 ipb_in => ipbw
(N_SLV_TOB
),
356 ipb_out => ipbr
(N_SLV_TOB
),
394 ipb_in => ipbw
(N_SLV_RAW
),
395 ipb_out => ipbr
(N_SLV_RAW
),
IPBUS readout slave definitions of registers used in the Top Level Readout Block.
IPBUS readout slave definitions of registers used in the Top Level Readout Block.
in RAW_data_FIFO_flags STD_LOGIC_VECTOR( 31 downto 0)
Full and Empty flags for all FIFOs in the RAW Readout Logic.
in ipbus_in_tob_dpram ipb_rbus
IPBus access bus signal coming from TOB SPY DPRAM.
out TOB_Link_output_FIFO_pFULL_THRESH_NEGATE STD_LOGIC_VECTOR( 12 downto 0)
Prog Full flag negate threshold for Link Output FIFO of TOBs Readout.
out RAW_FIFO_FULL_THRESH_ASSERT STD_LOGIC_VECTOR( 8 downto 0)
Full flag assert threshold for de-randomisation FIFO of RAW Data Readout.
out raw_fsm_monitor std_logic_vector( 31 downto 0)
Monitor RAW Readout state machines.
out TOB_WR_ADDR_OFFSET STD_LOGIC_VECTOR( 8 downto 0)
Write Address Offset for TOB circular DPRAM.
out trigger_slice STD_LOGIC_VECTOR( 3 downto 0)
Trigger slice number - on L1A.
in BCN_FIFO_RAW_rd_data_count STD_LOGIC_VECTOR( 31 downto 0)
BCN & L1A FIFO occupancy for RAW Readout.
in ipb_rst std_logic
IPBus Reset input.
out TOB_SLICES_TO_RD STD_LOGIC_VECTOR( 2 downto 0)
Number of cosecutive Slices to read from TOBs circular DPRAM.
in SPY_RAW_mem_wr_addr STD_LOGIC_VECTOR( 10 downto 0)
Current write address of RAW SPY Memory - used for IPBus access and to calculate occupancy.
in busy_tob_duration_counter STD_LOGIC_VECTOR( 31 downto 0)
Busy counter for TOB BUSY duration.
in tob_double_word_counter STD_LOGIC_VECTOR( 31 downto 0)
Number of identical TOB double words counter.
out TEST_CONTROL_REG STD_LOGIC_VECTOR( 31 downto 0)
Test Control Register at Top Level Readout Firmware.
in bcn_mismatch_cntr_debug std_logic_vector( 31 downto 0)
Mismatch error count on BCN.
out tob_busy_thresh_assert STD_LOGIC_VECTOR( 8 downto 0)
sorted TOB BUSY flag threshold assert
out BCN_FIFO_RAW_pFULL_THRESH_assert STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag assert threshold for TTC FIFO.
in RAW_FIFO_data_count STD_LOGIC_VECTOR( 31 downto 0)
Occupancy level ofde-randomisation FIFO of RAW Data Readout.
in TOB_data_FIFO_flags STD_LOGIC_VECTOR( 31 downto 0)
Full and Empty flags for all FIFOs in the TOBs Readout Logic.
out raw_busy_thresh_assert STD_LOGIC_VECTOR( 8 downto 0)
raw BUSY flag threshold assert
in busy_raw_counter STD_LOGIC_VECTOR( 31 downto 0)
Busy counter for RAW data buffers.
out XTOB_TAU_WR_ADDR_OFFSET STD_LOGIC_VECTOR( 8 downto 0)
Write Address Offset for XTOB tau circular DPRAM.
out BCN_FIFO_RAW_pFULL_THRESH_negate STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag negate threshold for TTC FIFO.
in l1id_parity_err_cntr_debug std_logic_vector( 31 downto 0)
Parity error count on L1A.
out tob_fsm_monitor std_logic_vector( 39 downto 0)
Monitor TOB Readout state machines.
out XTOB_TAU_FIFO_pFULL_THRESH_ASSERT STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag assert threshold for de-randomisation FIFO of XTOBs tau Readout.
out RDOUT_PULSE_REG STD_LOGIC_VECTOR( 31 downto 0)
Control Pulse Register for RAW Readout, all values are set to ZERO following a write to this register...
in XTOB_TAU_FIFO_DATA_COUNT STD_LOGIC_VECTOR( 31 downto 0)
Occupancy level of de-randomisation FIFO of XTOBs tau Readout.
out IPb_out ipb_rbus
IPBus output bus going from slaves to master.
out RAW_FIFO_pFULL_THRESH_ASSERT STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag assert threshold for de-randomisation FIFO of RAW Data Readout.
out BCN_FIFO_TOB_pFULL_THRESH_negate STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag negate threshold for TTC FIFO.
out BCN_FIFO_TOB_pFULL_THRESH_assert STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag assert threshold for TTC FIFO.
in RAW_frame_count STD_LOGIC_VECTOR( 31 downto 0)
Number of complete RAW Frames in Link Output FIFO to be transmitted to cFPGA.
in ttc_err_history_debug std_logic_vector( 31 downto 0)
History of last 8 TTC errors.
in SPY_TOB_mem_wr_addr STD_LOGIC_VECTOR( 10 downto 0)
Current write address of TOBs SPY Memory - used for IPBus access and to calculate occupancy.
out RAW_FIFO_pFULL_THRESH_NEGATE STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag negate threshold for de-randomisation FIFO of RAW Data Readout.
in L1A_ID STD_LOGIC_VECTOR( 31 downto 0)
8b Extended L1A ID + 24b L1A ID of L1A counter
out XTOB_EG_WR_ADDR_OFFSET STD_LOGIC_VECTOR( 8 downto 0)
Write Address Offset for XTOB e/g circular DPRAM.
out raw_busy_thresh_negate STD_LOGIC_VECTOR( 8 downto 0)
raw BUSY flag threshold de-assert
in l1a_id_err_debug std_logic_vector( 31 downto 0)
Shows last corrupt L1A ID.
in bcn_err_expected_debug std_logic_vector( 31 downto 0)
Error, bad BCN and expected BCN on BCN error.
in IPb_in ipb_wbus
IPBus input bus going from master to slaves.
in link_error_flags STD_LOGIC_VECTOR( 53 downto 0)
54-b error flags from the Error Flag FIFO to IPBUS register
in ipb_clk std_logic
IPBus Clock input.
in XTOB_EG_FIFO_DATA_COUNT STD_LOGIC_VECTOR( 31 downto 0)
Occupancy level of de-randomisation FIFO of XTOBs e/g Readout.
out XTOB_TAU_FIFO_pFULL_THRESH_NEGATE STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag negate threshold for de-randomisation FIFO of XTOBs tau Readout.
in l1a_id_good_debug std_logic_vector( 31 downto 0)
Shows last good L1A ID.
in TOB_FIFO_DATA_COUNT STD_LOGIC_VECTOR( 31 downto 0)
Occupancy level of de-randomisation FIFO of TOBs Readout.
out RAW_FIFO_FULL_THRESH_NEGATE STD_LOGIC_VECTOR( 8 downto 0)
Full flag negate threshold for de-randomisation FIFO of RAW Data Readout.
in busy_tob_counter STD_LOGIC_VECTOR( 31 downto 0)
Busy counter for TOB data buffers.
in real_time_40m_counter STD_LOGIC_VECTOR( 31 downto 0)
Real time 40MHz counter, counting number of 40MHz ticks.
out ipbus_out_tob_dpram ipb_wbus
IPBus access bus signal going to TOB SPY DPRAM.
in busy_raw_duration_counter STD_LOGIC_VECTOR( 31 downto 0)
Busy counter for RAW BUSY Duration.
in L1A_ID_Event STD_LOGIC_VECTOR( 31 downto 0)
8b Ext L1A ID from TTC input + 24b L1A ID of counter from TTC FIFO - inserted in the event header
in Link_output_FIFO_RAW_rd_data_count STD_LOGIC_VECTOR( 31 downto 0)
Occupancy level of Link Output FIFO of RAW Data Readout.
in BCN_FIFO_TOB_rd_data_count STD_LOGIC_VECTOR( 31 downto 0)
BCN & L1A FIFO occupancy for TOB Readout.
in bcn_parity_err_cntr_debug std_logic_vector( 31 downto 0)
Parity error count on BCN.
out Link_output_FIFO_RAW_pfull_thresh_assert STD_LOGIC_VECTOR( 12 downto 0)
Prog Full flag assert threshold for Link Output FIFO of RAW Data Readout.
out RAW_WR_ADDR_OFFSET STD_LOGIC_VECTOR( 9 downto 0)
Write Address Offset for RAW circular DPRAM.
out tob_busy_thresh_negate STD_LOGIC_VECTOR( 8 downto 0)
sorted TOB BUSY flag threshold de-assert
in l1a_id_expected_debug std_logic_vector( 31 downto 0)
Shows last expected L1A ID on error.
out TOB_FIFO_pFULL_THRESH_NEGATE STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag negate threshold for de-randomisation FIFO of TOBs Readout.
out Link_output_FIFO_RAW_pfull_thresh_negate STD_LOGIC_VECTOR( 12 downto 0)
Prog Full flag negate threshold for Link Output FIFO of RAW Data Readout.
out TOB_FIFO_pFULL_THRESH_ASSERT STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag assert threshold for de-randomisation FIFO of TOBs Readout.
out XTOB_EG_FIFO_pFULL_THRESH_ASSERT STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag assert threshold for de-randomisation FIFO of XTOBs e/g Readout.
in l1id_mismatch_cntr_debug std_logic_vector( 31 downto 0)
Mismatch error count on L1A.
out TOB_Link_output_FIFO_pFULL_THRESH_ASSERT STD_LOGIC_VECTOR( 12 downto 0)
Prog Full flag assert threshold for Link Output FIFO of TOBs Readout.
out ipbus_out_raw_dpram ipb_wbus
IPBus access bus signal going to RAW SPY DPRAM.
in TOB_LINK_OUTPUT_FIFO_RD_DATA_COUNT STD_LOGIC_VECTOR( 31 downto 0)
Occupancy level of Link Output FIFO of TOBs Readout.
in ipbus_in_raw_dpram ipb_rbus
IPBus access bus signal coming from RAW SPY DPRAM.
in BCN_in STD_LOGIC_VECTOR( 11 downto 0)
Bunch Crossing Number.
in L1A_debug_counter STD_LOGIC_VECTOR( 31 downto 0)
L1A_debug_counter.
in ECR_debug_counter STD_LOGIC_VECTOR( 31 downto 0)
ECR_debug_counter.
out XTOB_EG_FIFO_pFULL_THRESH_NEGATE STD_LOGIC_VECTOR( 8 downto 0)
Prog Full flag negate threshold for de-randomisation FIFO of XTOBs e/g Readout.
RAW calorimeter data readout slave registers.
in BCN_FIFO_RAW_rd_data_count STD_LOGIC_VECTOR( 31 downto 0)
BCN & L1A FIFO occupancy for RAW Readout.
in RAW_FIFO_data_count std_logic_vector( 31 downto 0)
Derandomisation FIFO FIFO occupancy data count.
out Link_output_FIFO_pFULL_THRESH_ASSERT std_logic_vector( 12 downto 0)
Link output FIFO (before MGT) partial full flag assert threshold.
in ipb_rst std_logic
IPBus Reset input.
out RAW_WR_ADDR_OFFSET std_logic_vector( 9 downto 0)
The write address offset pre load for RAW data Circular DRPAM.
out raw_busy_thresh_assert STD_LOGIC_VECTOR( 8 downto 0)
raw BUSY flag threshold assert
out Link_output_FIFO_pFULL_THRESH_NEGATE std_logic_vector( 12 downto 0)
Link output FIFO (before MGT) partial full flag negate threshold.
in Link_output_FIFO_rd_data_count std_logic_vector( 31 downto 0)
Link output FIFO (before MGT) occupancy data count.
out raw_busy_thresh_negate STD_LOGIC_VECTOR( 8 downto 0)
raw BUSY flag threshold de-assert
in RAW_data_FIFO_flags std_logic_vector( 31 downto 0)
Read only register containing all Empty pFull and Full of RAW data block.
in RAW_frame_count std_logic_vector( 31 downto 0)
numer of frames in the link output FIFO to be transmitted to MGT & Control FPGA
in link_error_flags STD_LOGIC_VECTOR( 53 downto 0)
54-b error flags from the Error Flag FIFO to IPBUS register
in ipb_clk std_logic
IPBus Clock input.
in SPY_RAW_mem_wr_addr std_logic_vector( 10 downto 0)
RAW SPY Memory write address (read only register)
out RAW_FIFO_FULL_THRESH_NEGATE std_logic_vector( 8 downto 0)
36b derandomisation FIFO full flag negate threshold
out RAW_FIFO_pFULL_THRESH_ASSERT std_logic_vector( 8 downto 0)
Derandomisation FIFO partial full flag assert threshold.
out BCN_FIFO_pFULL_THRESH_negate std_logic_vector( 8 downto 0)
BCN FIFO partial full flag negate threshold.
out BCN_FIFO_pFULL_THRESH_assert std_logic_vector( 8 downto 0)
BCN FIFO partial full flag assert threshold.
out ipbus_out_raw_dpram ipb_wbus
IPBus signal going to RAW SPY DPRAM.
out RAW_FIFO_FULL_THRESH_ASSERT std_logic_vector( 8 downto 0)
Derandomisation FIFO full flag assert threshold.
out RAW_FIFO_pFULL_THRESH_NEGATE std_logic_vector( 8 downto 0)
36b derandomisation FIFO partial full flag negate threshold
in ipbus_in_raw_dpram ipb_rbus
IPBus signal coming from RAW SPY DPRAM.
in raw_fsm_monitor std_logic_vector( 31 downto 0)
Monitor RAW Readout state machines.
TOB/XTOB data readout slave registers.
in ipbus_in_tob_dpram ipb_rbus
IPBus signal coming from TOB/XTOB SPY DPRAM.
out TOB_WR_ADDR_OFFSET std_logic_vector( 8 downto 0)
The write address offset pre load for TOB Circular DRPAM.
in TOB_LINK_OUTPUT_FIFO_RD_DATA_COUNT std_logic_vector( 31 downto 0)
Link output FIFO (before MGT) occupancy data count.
out trigger_slice STD_LOGIC_VECTOR( 3 downto 0)
Trigger slice number - on L1A.
out TOB_SLICES_TO_RD std_logic_vector( 2 downto 0)
number of DRP locations (Slices) to read 1 to 5
in ipb_rst std_logic
IPBus Reset input.
out TOB_Link_output_FIFO_pFULL_THRESH_ASSERT std_logic_vector( 12 downto 0)
Link output FIFO (before MGT) partial full flag assert threshold.
out tob_busy_thresh_assert STD_LOGIC_VECTOR( 8 downto 0)
sorted TOB BUSY flag threshold assert
out XTOB_TAU_WR_ADDR_OFFSET std_logic_vector( 8 downto 0)
The write address offset pre load for XTOB tau Circular DRPAM.
in XTOB_EG_FIFO_DATA_COUNT std_logic_vector( 31 downto 0)
XTOB e/g Derandomisation FIFO FIFO occupancy data count.
out TOB_FIFO_pFULL_THRESH_NEGATE std_logic_vector( 8 downto 0)
TOB Derandomisation FIFO partial full flag negate threshold.
out XTOB_EG_FIFO_pFULL_THRESH_NEGATE std_logic_vector( 8 downto 0)
XTOB e/g Derandomisation FIFO partial full flag negate threshold.
out XTOB_EG_FIFO_pFULL_THRESH_ASSERT std_logic_vector( 8 downto 0)
XTOB e/g Derandomisation FIFO partial full flag assert threshold.
out XTOB_TAU_FIFO_pFULL_THRESH_ASSERT std_logic_vector( 8 downto 0)
XTOB tau Derandomisation FIFO partial full flag assert threshold.
out TOB_Link_output_FIFO_pFULL_THRESH_NEGATE std_logic_vector( 12 downto 0)
Link output FIFO (before MGT) partial full flag negate threshold.
in L1A_ID std_logic_vector( 31 downto 0)
8b Extended L1A ID + 24b L1A ID of counter
out XTOB_TAU_FIFO_pFULL_THRESH_NEGATE std_logic_vector( 8 downto 0)
XTOB tau Derandomisation FIFO partial full flag negate threshold.
in TOB_FIFO_DATA_COUNT std_logic_vector( 31 downto 0)
TOB Derandomisation FIFO FIFO occupancy data count.
in ipb_clk std_logic
IPBus Clock input.
in XTOB_TAU_FIFO_DATA_COUNT std_logic_vector( 31 downto 0)
XTOB tau Derandomisation FIFO FIFO occupancy data count.
in SPY_TOB_mem_wr_addr std_logic_vector( 10 downto 0)
TOB/XTOB SPY Memory write address (read only register)
out ipbus_out_tob_dpram ipb_wbus
IPBus signal going to TOB/XTOB SPY DPRAM.
out TOB_FIFO_pFULL_THRESH_ASSERT std_logic_vector( 8 downto 0)
TOB Derandomisation FIFO partial full flag assert threshold.
in tob_fsm_monitor std_logic_vector( 39 downto 0)
Monitor TOB Readout state machines.
in BCN_FIFO_TOB_rd_data_count STD_LOGIC_VECTOR( 31 downto 0)
BCN & L1A FIFO occupancy for TOB Readout.
out tob_busy_thresh_negate STD_LOGIC_VECTOR( 8 downto 0)
sorted TOB BUSY flag threshold de-assert
in TOB_data_FIFO_flags std_logic_vector( 31 downto 0)
Read only register containing all Empty pFull and Full of TOB/XTOB data block.
out XTOB_EG_WR_ADDR_OFFSET std_logic_vector( 8 downto 0)
The write address offset pre load for XTOB e/g Circular DRPAM.
in L1A_ID_Event std_logic_vector( 31 downto 0)
8b Ext L1A ID from TTC input + 24b L1A ID of counter from TTC FIFO - inserted in the event header
out BCN_FIFO_pFULL_THRESH_negate std_logic_vector( 8 downto 0)
BCN FIFO partial full flag negate threshold.
out BCN_FIFO_pFULL_THRESH_assert std_logic_vector( 8 downto 0)
BCN FIFO partial full flag assert threshold.
in BCN_in std_logic_vector( 11 downto 0)
Bunch Crossing number input.