43 use IEEE.STD_LOGIC_1164.
all;
46 use ipbus_lib.ipbus.
all;
48 library TOB_rdout_lib;
51 use TOB_rdout_lib.ipbus_decode_efex_tob_readout.
all;
67 L1A_ID : in std_logic_vector (31 downto 0);
69 BCN_in : in std_logic_vector (11 downto 0);
129 signal ipbw : ipb_wbus_array(N_SLAVES-1 downto 0);
130 signal ipbr, ipbr_d : ipb_rbus_array(N_SLAVES-1 downto 0);
132 signal BCN_in_i : std_logic_vector (31 downto 0);
133 signal TOB_WR_ADDR_OFFSET_REG_i : std_logic_vector (31 downto 0);
134 signal XTOB_EG_WR_ADDR_OFFSET_REG_i : std_logic_vector (31 downto 0);
135 signal XTOB_TAU_WR_ADDR_OFFSET_REG_i : std_logic_vector (31 downto 0);
136 signal TOB_SLICES_TO_RD_i : std_logic_vector (31 downto 0) := X"00000001";
137 signal TOB_FIFO_pFULL_THRESH_ASSERT_i : std_logic_vector (31 downto 0);
138 signal TOB_FIFO_pFULL_THRESH_NEGATE_i : std_logic_vector (31 downto 0);
139 signal TOB_FIFO_DATA_COUNT_i : std_logic_vector (31 downto 0);
140 signal BCN_FIFO_pFULL_THRESH_assert_i : std_logic_vector (31 downto 0);
141 signal BCN_FIFO_pFULL_THRESH_negate_i : std_logic_vector (31 downto 0);
142 signal BCN_FIFO_TOB_rd_data_count_i : std_logic_vector (31 downto 0);
143 signal XTOB_EG_FIFO_pFULL_THRESH_ASSERT_i : std_logic_vector (31 downto 0);
144 signal XTOB_EG_FIFO_pFULL_THRESH_NEGATE_i : std_logic_vector (31 downto 0);
145 signal XTOB_EG_FIFO_DATA_COUNT_i : std_logic_vector (31 downto 0);
146 signal XTOB_TAU_FIFO_pFULL_THRESH_ASSERT_i : std_logic_vector (31 downto 0);
147 signal XTOB_TAU_FIFO_pFULL_THRESH_NEGATE_i : std_logic_vector (31 downto 0);
148 signal XTOB_TAU_FIFO_DATA_COUNT_i : std_logic_vector (31 downto 0);
149 signal TOB_Link_output_FIFO_pFULL_THRESH_ASSERT_i : std_logic_vector (31 downto 0);
150 signal TOB_Link_output_FIFO_pFULL_THRESH_NEGATE_i : std_logic_vector (31 downto 0);
151 signal TOB_LINK_OUTPUT_FIFO_RD_DATA_COUNT_i : std_logic_vector (31 downto 0);
152 signal TOB_data_FIFO_flags_i : std_logic_vector (31 downto 0);
153 signal trigger_slice_i : std_logic_vector (31 downto 0);
154 signal tob_busy_thresh_assert_i : STD_LOGIC_VECTOR (31 downto 0) ;
155 signal tob_busy_thresh_negate_i : STD_LOGIC_VECTOR (31 downto 0) ;
157 signal SPY_TOB_mem_wr_addr_i : std_logic_vector (31 downto 0);
158 signal ipb_strobe_i : std_logic;
159 signal ipb_write_i : std_logic;
163 BCN_in_i <= X"00000" & BCN_in;
195 ipb_strobe_i <= IPb_in.ipb_strobe;
196 ipb_write_i <= IPb_in.ipb_write;
216 TOB_rdout_fabric :
entity ipbus_lib.ipbus_fabric_sel
217 generic map(NSLV => N_SLAVES,
218 SEL_WIDTH => ipbus_sel_width
)
222 sel => ipbus_sel_efex_tob_readout
(ipb_in.ipb_addr
),
223 ipb_to_slaves => ipbw,
224 ipb_from_slaves => ipbr
228 U1_L1A_ID_counter :
entity ipbus_lib.ipbus_ctrlreg_v
229 generic map(N_CTRL =>
0, N_STAT =>
1)
233 ipbus_in => ipbw
(N_SLV_L1A_COUNTER
),
234 ipbus_out => ipbr
(N_SLV_L1A_COUNTER
),
240 U1_L1A_ID_event :
entity ipbus_lib.ipbus_ctrlreg_v
241 generic map(N_CTRL =>
0, N_STAT =>
1)
245 ipbus_in => ipbw
(N_SLV_L1A_ID_EVENT
),
246 ipbus_out => ipbr
(N_SLV_L1A_ID_EVENT
),
252 U2_BCN_in :
entity ipbus_lib.ipbus_ctrlreg_v
253 generic map(N_CTRL =>
0, N_STAT =>
1)
257 ipbus_in => ipbw
(N_SLV_BCN
),
258 ipbus_out => ipbr
(N_SLV_BCN
),
264 U3_TOB_WR_ADDR_OFFSET_REG :
entity ipbus_lib.ipbus_ctrlreg_v
265 generic map(N_CTRL =>
1, N_STAT =>
0)
269 ipbus_in => ipbw
(N_SLV_TOB_WR_ADDR_OFFSET_REG
),
270 ipbus_out => ipbr
(N_SLV_TOB_WR_ADDR_OFFSET_REG
),
271 q
(0) => TOB_WR_ADDR_OFFSET_REG_i,
272 d =>
(others =>
(others => '0'
)),
276 U3_XTOB_EG_WR_ADDR_OFFSET_REG :
entity ipbus_lib.ipbus_ctrlreg_v
277 generic map(N_CTRL =>
1, N_STAT =>
0)
281 ipbus_in => ipbw
(N_SLV_XTOB_EG_WR_ADDR_OFFSET_REG
),
282 ipbus_out => ipbr
(N_SLV_XTOB_EG_WR_ADDR_OFFSET_REG
),
283 q
(0) => XTOB_EG_WR_ADDR_OFFSET_REG_i,
284 d =>
(others =>
(others => '0'
)),
288 U3_XTOB_TAU_WR_ADDR_OFFSET_REG :
entity ipbus_lib.ipbus_ctrlreg_v
289 generic map(N_CTRL =>
1, N_STAT =>
0)
293 ipbus_in => ipbw
(N_SLV_XTOB_TAU_WR_ADDR_OFFSET_REG
),
294 ipbus_out => ipbr
(N_SLV_XTOB_TAU_WR_ADDR_OFFSET_REG
),
295 q
(0) => XTOB_TAU_WR_ADDR_OFFSET_REG_i,
296 d =>
(others =>
(others => '0'
)),
300 U4_TOB_SLICES_TO_RD :
entity ipbus_lib.ipbus_ctrlreg_v
301 generic map(N_CTRL =>
1, N_STAT =>
0)
305 ipbus_in => ipbw
(N_SLV_TOB_SLICES_TO_RD
),
306 ipbus_out => ipbr
(N_SLV_TOB_SLICES_TO_RD
),
307 q
(0) => TOB_SLICES_TO_RD_i,
308 d =>
(others =>
(others => '0'
)),
309 ctrl_default
(0) => X"00000001",
313 U4_trigger_slice :
entity ipbus_lib.ipbus_ctrlreg_v
314 generic map(N_CTRL =>
1, N_STAT =>
0)
318 ipbus_in => ipbw
(N_SLV_TRIGGER_SLICE
),
319 ipbus_out => ipbr
(N_SLV_TRIGGER_SLICE
),
320 q
(0) => trigger_slice_i,
321 ctrl_default
(0) => X"00000000",
322 d =>
(others =>
(others => '0'
)),
326 U5_TOB_FIFO_pFULL_THRESH_ASSERT :
entity ipbus_lib.ipbus_ctrlreg_v
327 generic map(N_CTRL =>
1, N_STAT =>
0)
331 ipbus_in => ipbw
(N_SLV_TOB_FIFO_PROG_FULL_THRESH_ASSERT
),
332 ipbus_out => ipbr
(N_SLV_TOB_FIFO_PROG_FULL_THRESH_ASSERT
),
333 q
(0) => TOB_FIFO_pFULL_THRESH_ASSERT_i,
334 ctrl_default
(0) => X"00000180",
335 d =>
(others =>
(others => '0'
)),
339 U6_TOB_FIFO_pFULL_THRESH_NEGATE :
entity ipbus_lib.ipbus_ctrlreg_v
340 generic map(N_CTRL =>
1, N_STAT =>
0)
344 ipbus_in => ipbw
(N_SLV_TOB_FIFO_PROG_FULL_THRESH_NEGATE
),
345 ipbus_out => ipbr
(N_SLV_TOB_FIFO_PROG_FULL_THRESH_NEGATE
),
346 q
(0) => TOB_FIFO_pFULL_THRESH_NEGATE_i,
347 ctrl_default
(0) => X"00000100",
348 d =>
(others =>
(others => '0'
)),
352 U7_TOB_FIFO_DATA_COUNT :
entity ipbus_lib.ipbus_ctrlreg_v
353 generic map(N_CTRL =>
0, N_STAT =>
1)
357 ipbus_in => ipbw
(N_SLV_TOB_FIFO_DATA_COUNT
),
358 ipbus_out => ipbr
(N_SLV_TOB_FIFO_DATA_COUNT
),
359 d
(0) => TOB_FIFO_DATA_COUNT_i,
364 U7_TOB_BUSY_THRESH_ASSERT :
entity ipbus_lib.ipbus_ctrlreg_v
371 ipbus_in => ipbw
(N_SLV_TOB_BUSY_THRESH_ASSERT
),
372 ipbus_out => ipbr
(N_SLV_TOB_BUSY_THRESH_ASSERT
),
373 d =>
(others=>
(others=> '0'
)),
374 ctrl_default
(0) => X"00000160",
375 q
(0) =>
(tob_busy_thresh_assert_i
),
380 U7_TOB_BUSY_THRESH_NEGATE :
entity ipbus_lib.ipbus_ctrlreg_v
387 ipbus_in => ipbw
(N_SLV_TOB_BUSY_THRESH_NEGATE
),
388 ipbus_out => ipbr
(N_SLV_TOB_BUSY_THRESH_NEGATE
),
389 d =>
(others=>
(others=> '0'
)),
390 ctrl_default
(0) => X"00000100",
391 q
(0) =>
(tob_busy_thresh_negate_i
),
396 U7_BCN_FIFO_TOB_rd_data_count :
entity ipbus_lib.ipbus_ctrlreg_v
397 generic map(N_CTRL =>
0, N_STAT =>
1)
401 ipbus_in => ipbw
(N_SLV_BCN_FIFO_TOB_RD_DATA_COUNT
),
402 ipbus_out => ipbr
(N_SLV_BCN_FIFO_TOB_RD_DATA_COUNT
),
403 d
(0) => BCN_FIFO_TOB_rd_data_count_i,
408 U8_XTOB_EG_FIFO_pFULL_THRESH_ASSERT :
entity ipbus_lib.ipbus_ctrlreg_v
409 generic map(N_CTRL =>
1, N_STAT =>
0)
413 ipbus_in => ipbw
(N_SLV_XTOB_EG_FIFO_PROG_FULL_THRESH_ASSERT
),
414 ipbus_out => ipbr
(N_SLV_XTOB_EG_FIFO_PROG_FULL_THRESH_ASSERT
),
415 q
(0) => XTOB_EG_FIFO_pFULL_THRESH_ASSERT_i,
416 ctrl_default
(0) => X"00000180",
417 d =>
(others =>
(others => '0'
)),
421 U9_XTOB_EG_FIFO_pFULL_THRESH_NEGATE :
entity ipbus_lib.ipbus_ctrlreg_v
422 generic map(N_CTRL =>
1, N_STAT =>
0)
426 ipbus_in => ipbw
(N_SLV_XTOB_EG_FIFO_PROG_FULL_THRESH_NEGATE
),
427 ipbus_out => ipbr
(N_SLV_XTOB_EG_FIFO_PROG_FULL_THRESH_NEGATE
),
428 q
(0) => XTOB_EG_FIFO_pFULL_THRESH_NEGATE_i,
429 ctrl_default
(0) => X"00000100",
430 d =>
(others =>
(others => '0'
)),
434 U10_XTOB_EG_FIFO_DATA_COUNT :
entity ipbus_lib.ipbus_ctrlreg_v
435 generic map(N_CTRL =>
0, N_STAT =>
1)
439 ipbus_in => ipbw
(N_SLV_XTOB_EG_FIFO_DATA_COUNT
),
440 ipbus_out => ipbr
(N_SLV_XTOB_EG_FIFO_DATA_COUNT
),
441 d
(0) => XTOB_EG_FIFO_DATA_COUNT_i,
446 U8_XTOB_TAU_FIFO_pFULL_THRESH_ASSERT :
entity ipbus_lib.ipbus_ctrlreg_v
447 generic map(N_CTRL =>
1, N_STAT =>
0)
451 ipbus_in => ipbw
(N_SLV_XTOB_TAU_FIFO_PROG_FULL_THRESH_ASSERT
),
452 ipbus_out => ipbr
(N_SLV_XTOB_TAU_FIFO_PROG_FULL_THRESH_ASSERT
),
453 q
(0) => XTOB_TAU_FIFO_pFULL_THRESH_ASSERT_i,
454 ctrl_default
(0) => X"00000180",
455 d =>
(others =>
(others => '0'
)),
459 U9_XTOB_TAU_FIFO_pFULL_THRESH_NEGATE :
entity ipbus_lib.ipbus_ctrlreg_v
460 generic map(N_CTRL =>
1, N_STAT =>
0)
464 ipbus_in => ipbw
(N_SLV_XTOB_TAU_FIFO_PROG_FULL_THRESH_NEGATE
),
465 ipbus_out => ipbr
(N_SLV_XTOB_TAU_FIFO_PROG_FULL_THRESH_NEGATE
),
466 q
(0) => XTOB_TAU_FIFO_pFULL_THRESH_NEGATE_i,
467 ctrl_default
(0) => X"00000100",
468 d =>
(others =>
(others => '0'
)),
472 U10_XTOB_TAU_FIFO_DATA_COUNT :
entity ipbus_lib.ipbus_ctrlreg_v
473 generic map(N_CTRL =>
0, N_STAT =>
1)
477 ipbus_in => ipbw
(N_SLV_XTOB_TAU_FIFO_DATA_COUNT
),
478 ipbus_out => ipbr
(N_SLV_XTOB_TAU_FIFO_DATA_COUNT
),
479 d
(0) => XTOB_TAU_FIFO_DATA_COUNT_i,
484 U11_LINK_OUTPUT_FIFO_pFULL_THRESH_ASSERT :
entity ipbus_lib.ipbus_ctrlreg_v
485 generic map(N_CTRL =>
1, N_STAT =>
0)
489 ipbus_in => ipbw
(N_SLV_LINK_OUTPUT_FIFO_PROG_FULL_THRESH_ASSERT
),
490 ipbus_out => ipbr
(N_SLV_LINK_OUTPUT_FIFO_PROG_FULL_THRESH_ASSERT
),
491 q
(0) => TOB_LINK_OUTPUT_FIFO_pFULL_THRESH_ASSERT_i,
492 ctrl_default
(0) => X"00001800",
493 d =>
(others =>
(others => '0'
)),
497 U12_LINK_OUTPUT_FIFO_pFULL_THRESH_NEGATE :
entity ipbus_lib.ipbus_ctrlreg_v
498 generic map(N_CTRL =>
1, N_STAT =>
0)
502 ipbus_in => ipbw
(N_SLV_LINK_OUTPUT_FIFO_PROG_FULL_THRESH_NEGATE
),
503 ipbus_out => ipbr
(N_SLV_LINK_OUTPUT_FIFO_PROG_FULL_THRESH_NEGATE
),
504 q
(0) => TOB_LINK_OUTPUT_FIFO_pFULL_THRESH_NEGATE_i,
505 ctrl_default
(0) => X"00001000",
506 d =>
(others =>
(others => '0'
)),
510 U13_LINK_OUTPUT_FIFO_RD_DATA_COUNT :
entity ipbus_lib.ipbus_ctrlreg_v
511 generic map(N_CTRL =>
0, N_STAT =>
1)
515 ipbus_in => ipbw
(N_SLV_LINK_OUTPUT_FIFO_RD_DATA_COUNT
),
516 ipbus_out => ipbr
(N_SLV_LINK_OUTPUT_FIFO_RD_DATA_COUNT
),
517 d
(0) => TOB_LINK_OUTPUT_FIFO_RD_DATA_COUNT_i,
522 U12_TOB_data_FIFO_flags :
entity ipbus_lib.ipbus_ctrlreg_v
523 generic map(N_CTRL =>
0, N_STAT =>
1)
527 ipbus_in => ipbw
(N_SLV_TOB_DATA_FIFO_FLAGS
),
528 ipbus_out => ipbr
(N_SLV_TOB_DATA_FIFO_FLAGS
),
529 d
(0) => TOB_data_FIFO_flags_i,
534 U16_TOB_mem_wr_addr :
entity ipbus_lib.ipbus_ctrlreg_v
535 generic map(N_CTRL =>
0, N_STAT =>
1)
539 ipbus_in => ipbw
(N_SLV_SPY_TOB_MEM_WR_ADDR
),
540 ipbus_out => ipbr
(N_SLV_SPY_TOB_MEM_WR_ADDR
),
541 d
(0) => SPY_TOB_mem_wr_addr_i,
545 U17_BCN_FIFO_pFULL_THRESH_assert :
entity ipbus_lib.ipbus_ctrlreg_v
546 generic map(N_CTRL =>
1, N_STAT =>
0)
550 ipbus_in => ipbw
(N_SLV_BCN_FIFO_TOB_PFULL_THRESH_ASSERT
),
551 ipbus_out => ipbr
(N_SLV_BCN_FIFO_TOB_PFULL_THRESH_ASSERT
),
552 d =>
(others =>
(others => '0'
)),
553 q
(0) => BCN_FIFO_pFULL_THRESH_assert_i,
554 ctrl_default
(0) => X"00000180",
557 U18_BCN_FIFO_pFULL_THRESH_negate :
entity ipbus_lib.ipbus_ctrlreg_v
558 generic map(N_CTRL =>
1, N_STAT =>
0)
562 ipbus_in => ipbw
(N_SLV_BCN_FIFO_TOB_PFULL_THRESH_NEGATE
),
563 ipbus_out => ipbr
(N_SLV_BCN_FIFO_TOB_PFULL_THRESH_NEGATE
),
564 d =>
(others =>
(others => '0'
)),
565 q
(0) => BCN_FIFO_pFULL_THRESH_negate_i,
566 ctrl_default
(0) => X"00000100",
571 U19_tob_fsm_monitor :
entity ipbus_lib.ipbus_ctrlreg_v
578 ipbus_in => ipbw
(N_SLV_TOB_FSM_MONITOR
),
579 ipbus_out => ipbr
(N_SLV_TOB_FSM_MONITOR
),
580 d
(0) => X"000000" & tob_fsm_monitor
(7 downto 0),
581 d
(1) => X"000000" & tob_fsm_monitor
(15 downto 8),
582 d
(2) => X"000000" & tob_fsm_monitor
(23 downto 16),
583 d
(3) => X"000000" & tob_fsm_monitor
(31 downto 24),
584 d
(4) => X"000000" & tob_fsm_monitor
(39 downto 32),
TOB/XTOB data readout slave registers.
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 IPb_out ipb_rbus
IPBus output bus going from slaves to master.
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_in ipb_wbus
IPBus input bus going from master to slaves.
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.