23 use ieee.std_logic_1164.
all;
24 use ieee.numeric_std.
all;
27 use UNISIM.VCOMPONENTS.
ALL;
29 library TOB_rdout_lib;
89 signal clk_in_280M_i : STD_LOGIC;
91 signal SIPO_T_TOB_out_i : STD_LOGIC_VECTOR (191 downto 0);
92 signal SIPO_T_TOB_sync_out_i : STD_LOGIC;
93 signal T_TOB_valid_out_i : STD_LOGIC_VECTOR (5 downto 0);
95 signal DPR_T_TOBs_in_i : STD_LOGIC_VECTOR (208 downto 0);
96 signal DPR_T_TOBs_out_i : STD_LOGIC_VECTOR (208 downto 0);
97 signal rdout_T_TOB_209b_i : STD_LOGIC_VECTOR (208 downto 0);
99 signal DPR_T_TOB_rd_addr_i : STD_LOGIC_VECTOR (8 downto 0);
100 signal DPR_T_TOB_wr_addr_i : STD_LOGIC_VECTOR (8 downto 0);
101 signal DRP_T_TOB_rd_en_i : std_logic ;
103 signal SIPO_T_TOB_sync_vec_i : STD_LOGIC_VECTOR (0 downto 0);
104 signal FIFO_wr_en_i, L1A_in_i : std_logic;
105 signal FIFO_wr_en_tmp : std_logic ;
107 signal ALGO_TOB_BCN_out_i : std_logic_vector (6 downto 0);
108 signal TOBs_FIFO_data_count_i :STD_LOGIC_VECTOR (8 downto 0) ;
109 signal tied_to_vcc_i : std_logic;
110 signal TOBs_data_valid_i : std_logic;
111 signal TOBs_data_prog_full_i, TOBs_data_full_i, TOBs_data_empty_i : std_logic;
115 tied_to_vcc_i <= '1';
120 FIFO_wr_en_tmp <= FIFO_wr_en_i ;
124 U6_TOB_clk280_proc :
Process (clk_in_280M_i)
126 if rising_edge (clk_in_280M_i) then
139 U1_TOBs_eg :
entity TOB_rdout_lib.
SIPO_TOPO_TOBs_unit -- convert
6*32b Topo TOBs into one
192b word
for Circular DPR
154 DPR_T_TOBs_in_i <= ALGO_TOB_BCN_out_i & "0000" & T_TOB_valid_out_i & SIPO_T_TOB_out_i;
155 SIPO_T_TOB_sync_vec_i(0) <= SIPO_T_TOB_sync_out_i ;
182 U4_T_TOB_DRP : DPR_209b_512 -- Topo TOBs into DPRAM
184 clka => clk_in_280M_i,
185 ena => tied_to_vcc_i ,
186 wea => SIPO_T_TOB_sync_vec_i ,
187 addra => DPR_T_TOB_wr_addr_i ,
188 dina => DPR_T_TOBs_in_i ,
189 clkb => clk_in_280M_i ,
190 enb => DRP_T_TOB_rd_en_i ,
191 addrb => DPR_T_TOB_rd_addr_i ,
192 doutb => DPR_T_TOBs_out_i
217 U5_T_TOBs_fifo : FIFO_209b_512 -- Topo TOBs into FIFO
on L1A
219 clk => clk_in_280M_i,
221 din => DPR_T_TOBs_out_i ,
222 wr_en => FIFO_wr_en_tmp,
224 dout => rdout_T_TOB_209b_i ,
225 data_count => TOBs_FIFO_data_count_i,
226 full => TOBs_data_full_i,
227 empty => TOBs_data_empty_i,
228 valid => TOBs_data_valid_i,
229 prog_full => TOBs_data_prog_full_i,
SIPO Sorting TOBs for process FPGA.
in TOBs_sync_in STD_LOGIC
TOB synch signal - indicating the start of the 7 TOB data words.
in TOBs_in STD_LOGIC_VECTOR( 31 downto 0)
32b sorted TOB in - 7 x 32b words in series
out ALGO_TOB_BCN_out std_logic_vector( 6 downto 0)
sorted TOB BCN with delay to match the delay on the TOBs through this block
out TOPO_TOB_valid_out STD_LOGIC_VECTOR( 5 downto 0)
6b sorted TOBs valid (ignore 7th TOB)
out TOPO_TOB_out STD_LOGIC_VECTOR( 191 downto 0)
6 * 32b sorted TOBs = 192b (ignore 7th TOB)
out TOPO_TOB_sync_out STD_LOGIC
1b sorted TOBs synch signal output
in TOB_valid_flg_in STD_LOGIC
1b valid signal - 7 x 1b valid in series
in clk_in_280M STD_LOGIC
280Mhz input signal
in ALGO_TOB_BCN_in std_logic_vector( 6 downto 0)
sorted TOB BCN with delay through ALGO/sorting block
Top of Sorting_TOBs module for process FPGA.
Top of Sorting_TOBs module for process FPGA.
in TOBs_sync_in STD_LOGIC
Sorted TOB synch signal - indicating the start of the 7 TOB data words.
in pre_ld_wr_addr_TOB STD_LOGIC_VECTOR( 8 downto 0)
Latency pre-load for TOB Circular DRPAM write address.
out TOBs_data_prog_full STD_LOGIC
Sorted TOBs FIFO prog full flag.
in trigger_slice_in STD_LOGIC_VECTOR( 3 downto 0)
Trigger slice number - on L1A.
in DPR_locations_to_rd STD_LOGIC_VECTOR( 2 downto 0)
Number of multi-slice locations to read from DPRAM.
in TOBs_32b_in STD_LOGIC_VECTOR( 31 downto 0)
Sorted TOBs 32b * 7 in series.
in TOBs_valid_flg_in STD_LOGIC
Sorted TOB valid signal - used to write TOBs into de-randomisation TOB FIFO.
in L1A_in STD_LOGIC
L1A signal input.
out rdout_T_TOB_209b STD_LOGIC_VECTOR( 208 downto 0)
Sorted TOBs output of fifo 209b = 7b TOB_BCN +4b error+6b valid +192b TOB data.
out TOBs_data_valid STD_LOGIC
Sorted TOBs FIFO data valid signal.
in FIFO_rd_en STD_LOGIC
Read sorted TOB data from de-randomisation TOB FIFO into TOB Link Output FIFO.
out TOBs_FIFO_data_count STD_LOGIC_VECTOR( 8 downto 0)
Sorted TOBs FIFO occupancy count.
FPGA_NUMBER integer := 1
Integer used to distinguish different FPGAs having a slightly different firmware.
out TOBs_data_full STD_LOGIC
Sorted TOBs FIFO full flag.
in TOB_FIFO_sw_rst std_logic
TOB Readout FIFO reset Pulsed by software command.
out tob_data_dpram_fsm STD_LOGIC_VECTOR( 7 downto 0)
Monitor state machine status register.
out TOBs_data_empty STD_LOGIC
Sorted TOBs FIFO empty flag.
in clk_280M_in STD_LOGIC
280Mhz input signal
in ALGO_TOB_BCN_in std_logic_vector( 6 downto 0)
Sorted TOB BCN with delay through ALGO/sorting block.
in TOBs_FIFO_pFULL_THRESH_negate STD_LOGIC_VECTOR( 8 DOWNTO 0)
Threshold to de-assert FIFO prog full flag.
in TOBs_FIFO_pFULL_THRESH_assert STD_LOGIC_VECTOR( 8 DOWNTO 0)
Threshold to assert FIFO prog full flag.
Top of fsm_TOB_wr_to_FIFO for process FPGA.
in trigger_slice_in STD_LOGIC_VECTOR( 3 downto 0)
Trigger slice number - on L1A.
in SIPO_sync_in STD_LOGIC
SIPO TOBs synch signal input.
in DPR_locations_to_rd STD_LOGIC_VECTOR( 2 downto 0)
number of multi-slice locations to read from DPRAM
out DPR_rd_addr STD_LOGIC_VECTOR( 8 downto 0)
DPRAM read address.
out DRP_rd_en STD_LOGIC
DPRAM read enable.
in pre_ld_wr_addr STD_LOGIC_VECTOR( 8 downto 0)
latency pre-load for DRPAM write address
out FIFO_wr_en STD_LOGIC
enable sorted TOBs write into derandomisatiion FIFO
in L1A_in STD_LOGIC
L1A signal input.
in CLK_IN STD_LOGIC
Clock input signal.
in TOB_FIFO_sw_rst std_logic
TOB Readout FIFO reset Pulse by software command.
out tob_data_dpram_fsm STD_LOGIC_VECTOR( 7 downto 0)
Monitor state machine status register.
out DPR_wr_addr STD_LOGIC_VECTOR( 8 downto 0)
DPRAM write address.