47 USE ieee.std_logic_1164.
all;
48 use ieee.numeric_std.
all;
51 USE ipbus_lib.ipbus.
all;
52 LIBRARY infrastructure_lib;
58 TOB_FIFO_ADDR_MAX_WIDTH: positive := 12;
69 clk_320 : in std_logic;
70 rst_320 : in std_logic;
71 clk_ipb : in std_logic;
72 rst_ipb : in std_logic;
73 bcr_320 : in std_logic;
74 ecr_320 : in std_logic;
77 ipb_out : out ipb_rbus;
79 ipbus_tob_mgt_wbus_array : out ipb_wbus_array(3 downto 0);
80 ipbus_tob_mgt_rbus_array : in ipb_rbus_array(3 downto 0);
82 ipbus_raw_mgt_wbus_array : out ipb_wbus_array(3 downto 0);
83 ipbus_raw_mgt_rbus_array : in ipb_rbus_array(3 downto 0);
85 ipbus_merger_spy_wbus_array : out ipb_wbus_array(1 downto 0);
86 ipbus_merger_spy_rbus_array : in ipb_rbus_array(1 downto 0);
88 ipbus_built_fifo_wbus_array : out ipb_wbus_array(1 downto 0);
89 ipbus_built_fifo_rbus_array : in ipb_rbus_array(1 downto 0);
92 rst_ipbus_tob_mgt_addr_bus : out std_logic_vector(3 downto 0);
93 ipbus_tob_mgt_wraparound_bus : out std_logic_vector(3 downto 0);
95 rst_ipbus_raw_mgt_addr_bus : out std_logic_vector(3 downto 0);
96 ipbus_raw_mgt_wraparound_bus : out std_logic_vector(3 downto 0);
98 rst_ipbus_merger_spy_addr_bus : out std_logic_vector(1 downto 0);
99 ipbus_merger_spy_wraparound_bus : out std_logic_vector(1 downto 0);
101 rst_ipbus_built_fifo_addr_bus : out std_logic_vector(1 downto 0);
102 ipbus_built_fifo_wraparound_bus : out std_logic_vector(1 downto 0);
104 readout_delay : out std_logic_vector(31 downto 0);
106 tob_mgt_packet_received_bus : in std_logic_vector(3 downto 0);
107 tob_mgt_safe_mode_bus : in std_logic_vector(3 downto 0);
108 tob_mgt_packet_err_bus : in std_logic_vector(3 downto 0);
109 tob_mgt_length_err_bus : in std_logic_vector(3 downto 0);
110 tob_mgt_bcn_err_bus : in std_logic_vector(3 downto 0);
111 tob_mgt_last_l1id_bus : in mgt_data_array(3 downto 0);
114 raw_mgt_packet_received_bus : in std_logic_vector(3 downto 0);
115 raw_mgt_safe_mode_bus : in std_logic_vector(3 downto 0);
116 raw_mgt_packet_err_bus : in std_logic_vector(3 downto 0);
117 raw_mgt_length_err_bus : in std_logic_vector(3 downto 0);
118 raw_mgt_last_l1id_bus : in mgt_data_array(3 downto 0);
121 tob_fifo_fill_level_A_bus : in fifo_status_array(3 downto 0);
122 tob_packet_count_A_bus : in fifo_status_array(3 downto 0);
123 tob_fifo_error_A_bus : in std_logic_vector(3 downto 0);
126 tob_fifo_fill_level_B_bus : in fifo_status_array(3 downto 0);
127 tob_packet_count_B_bus : in fifo_status_array(3 downto 0);
128 tob_fifo_error_B_bus : in std_logic_vector(3 downto 0);
131 Last_L1ID_merger_A : in std_logic_vector(31 downto 0);
132 Last_L1ID_merger_B : in std_logic_vector(31 downto 0);
133 L1A_seen_bus : in std_logic_vector(1 downto 0);
136 TOB_packet_merged_A_bus : in std_logic_vector(3 downto 0);
137 TOB_packet_missing_A_bus : in std_logic_vector(3 downto 0);
138 debug_packet_created_A_bus : in std_logic_vector(3 downto 0);
139 TOB_packet_merged_B_bus : in std_logic_vector(3 downto 0);
140 TOB_packet_missing_B_bus : in std_logic_vector(3 downto 0);
141 debug_packet_created_B_bus : in std_logic_vector(3 downto 0);
144 mux_active_bus : in std_logic_vector(1 downto 0);
145 mux_l1id_valid_bus : in std_logic_vector(1 downto 0);
146 mux_source_bus : in std_logic_vector(7 downto 0);
147 mux_l1id_bus : in mgt_data_array(1 downto 0);
150 merged_fifo_fill_level_A_bus : in fifo_status_array(1 downto 0);
151 merged_packet_count_A_bus : in fifo_status_array(1 downto 0);
152 merged_fifo_error_A_bus : in std_logic_vector(1 downto 0);
155 merged_fifo_fill_level_B_bus : in fifo_status_array(1 downto 0);
156 merged_packet_count_B_bus : in fifo_status_array(1 downto 0);
157 merged_fifo_error_B_bus : in std_logic_vector(1 downto 0);
160 raw_fifo_fill_level_bus : in fifo_status_array(3 downto 0);
161 raw_packet_count_bus : in fifo_status_array(3 downto 0);
162 raw_fifo_error_bus : in std_logic_vector(3 downto 0);
165 tob_mgt_xoff_bus : out std_logic_vector(3 downto 0);
166 raw_mgt_xoff_bus : out std_logic_vector(3 downto 0);
168 tob_busy_bus : out std_logic_vector(3 downto 0);
169 raw_busy_bus : out std_logic_vector(3 downto 0);
171 Block_A_pause : out std_logic_vector(1 downto 0);
172 Block_B_pause : out std_logic_vector(1 downto 0)
177 signal counter_control_i : std_logic_vector(31 downto 0);
178 signal spy_ram_rst_wr_addr_i : std_logic_vector(31 downto 0);
179 signal wraparound_enable_i : std_logic_vector(31 downto 0);
181 signal rst_err_cntrs_i : std_logic ;
182 signal rst_status_cntrs_i : std_logic ;
183 signal rst_xoff_cntr_i : std_logic ;
185 signal tob_fifo_err_cnt_A_bus_i : mgt_data_array(3 downto 0);
186 signal tob_fifo_err_cnt_B_bus_i : mgt_data_array(3 downto 0);
187 signal raw_fifo_err_cnt_i : mgt_data_array(3 downto 0);
188 signal merged_fifo_err_cnt_A_bus_i : mgt_data_array(1 downto 0);
189 signal merged_fifo_err_cnt_B_bus_i : mgt_data_array(1 downto 0);
191 signal tob_fifo_prog_full_thresh_assert_i : std_logic_vector(15 downto 0);
192 signal tob_fifo_prog_full_thresh_negate_i : std_logic_vector(15 downto 0);
193 signal raw_fifo_prog_full_thresh_assert_i : std_logic_vector(15 downto 0);
194 signal raw_fifo_prog_full_thresh_negate_i : std_logic_vector(15 downto 0);
196 signal tob_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0);
197 signal tob_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0);
198 signal merged_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0);
199 signal merged_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0);
200 signal raw_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0);
201 signal raw_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0);
202 signal dbg_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0);
203 signal dbg_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0);
205 signal fifo_bc_count_i: std_logic_vector(31 downto 0);
206 signal tob_busy_cnt_32b_A_i, tob_busy_active_cnt_32b_A_i, tob_busy_assert_cnt_32b_A_i: mgt_data_array(3 downto 0);
207 signal tob_busy_cnt_32b_B_i, tob_busy_active_cnt_32b_B_i, tob_busy_assert_cnt_32b_B_i: mgt_data_array(3 downto 0);
208 signal tob_xoff_cnt_32b_A_i, tob_xoff_active_cnt_32b_A_i, tob_xoff_assert_cnt_32b_A_i: mgt_data_array(3 downto 0);
209 signal tob_xoff_cnt_32b_B_i, tob_xoff_active_cnt_32b_B_i, tob_xoff_assert_cnt_32b_B_i: mgt_data_array(3 downto 0);
210 signal raw_busy_cnt_32b_i, raw_busy_active_cnt_32b_i, raw_busy_assert_cnt_32b_i : mgt_data_array(3 downto 0);
211 signal raw_xoff_cnt_32b_i, raw_xoff_active_cnt_32b_i, raw_xoff_assert_cnt_32b_i : mgt_data_array(3 downto 0);
212 signal merged_xoff_cnt_32b_A_i, merged_xoff_active_cnt_32b_A_i, merged_xoff_assert_cnt_32b_A_i: mgt_data_array(1 downto 0);
213 signal merged_xoff_cnt_32b_B_i, merged_xoff_active_cnt_32b_B_i, merged_xoff_assert_cnt_32b_B_i: mgt_data_array(1 downto 0);
216 signal tob_fifo_tide_mark_A_bus_i : fifo_status_array(3 downto 0);
217 signal tob_packet_tide_mark_A_bus_i : fifo_status_array(3 downto 0);
218 signal tob_fifo_tide_mark_B_bus_i : fifo_status_array(3 downto 0);
219 signal tob_packet_tide_mark_B_bus_i : fifo_status_array(3 downto 0);
220 signal merged_fifo_tide_mark_A_bus_i : fifo_status_array(1 downto 0);
221 signal merged_packet_tide_mark_A_bus_i : fifo_status_array(1 downto 0);
222 signal merged_fifo_tide_mark_B_bus_i : fifo_status_array(1 downto 0);
223 signal merged_packet_tide_mark_B_bus_i : fifo_status_array(1 downto 0);
224 signal raw_fifo_tide_mark_bus_i : fifo_status_array(3 downto 0);
225 signal raw_packet_tide_mark_bus_i : fifo_status_array(3 downto 0);
227 signal TOB_packet_merged_cnt_A_bus_out_i : mgt_data_array(3 downto 0);
228 signal TOB_packet_missing_cnt_A_bus_out_i : mgt_data_array(3 downto 0);
229 signal debug_packet_created_cnt_A_bus_out_i : mgt_data_array(3 downto 0);
230 signal TOB_packet_merged_cnt_B_bus_out_i : mgt_data_array(3 downto 0);
231 signal TOB_packet_missing_cnt_B_bus_out_i : mgt_data_array(3 downto 0);
232 signal debug_packet_created_cnt_B_bus_out_i : mgt_data_array(3 downto 0);
234 signal Last_L1ID_merger_A_i, Last_L1ID_merger_B_i : std_logic_vector(31 downto 0);
235 signal L1A_cnt_merger_A_i, L1A_cnt_merger_B_i : std_logic_vector(31 downto 0);
237 signal tob_mgt_packet_received_cnt_bus_i : mgt_data_array(3 downto 0);
238 signal tob_mgt_safe_mode_cnt_bus_i : mgt_data_array(3 downto 0);
239 signal tob_mgt_packet_err_cnt_bus_i : mgt_data_array(3 downto 0);
240 signal tob_mgt_length_err_cnt_bus_i : mgt_data_array(3 downto 0);
241 signal tob_mgt_bcn_err_cnt_bus_i : mgt_data_array(3 downto 0);
243 signal raw_mgt_packet_received_cnt_bus_i : mgt_data_array(3 downto 0);
244 signal raw_mgt_safe_mode_cnt_bus_i : mgt_data_array(3 downto 0);
245 signal raw_mgt_packet_err_cnt_bus_i : mgt_data_array(3 downto 0);
246 signal raw_mgt_length_err_cnt_bus_i : mgt_data_array(3 downto 0);
248 signal tob_mgt_last_l1id_bus_i, raw_mgt_last_l1id_bus_i: mgt_data_array(3 downto 0);
249 signal tob_mgt_last_error_l1id_bus_i, raw_mgt_last_error_l1id_bus_i: mgt_data_array(3 downto 0);
251 signal mux_l1id_valid_bus_i: std_logic_vector(1 downto 0);
252 signal mux_l1id_bus_i: mgt_data_array(1 downto 0);
253 signal mux_source_bus_i: std_logic_vector(7 downto 0);
254 signal mux_source_a, mux_source_b: integer range 0 to 15 := 0;
255 signal mux_a_pkt_bus_i, mux_b_pkt_bus_i: std_logic_vector(5 downto 0);
256 signal mux_a_pkt_cnt_bus_i, mux_b_pkt_cnt_bus_i: mgt_data_array(5 downto 0);
257 signal mux_a_last_l1id_bus_i, mux_b_last_l1id_bus_i: mgt_data_array(5 downto 0) := (Others => (Others => '0'));
258 signal mux_active_bus_i: fifo_status_array(1 downto 0);
259 signal mux_a_active_bus_i, mux_b_active_bus_i: fifo_status_array(5 downto 0);
260 signal mux_a_active_tide_mark_bus_i, mux_b_active_tide_mark_bus_i: fifo_status_array(5 downto 0);
261 signal mux_orbit_active_bus_i, mux_orbit_active_tide_mark_bus_i: fifo_status_array(1 downto 0);
265 rst_ipbus_tob_mgt_addr_bus <= spy_ram_rst_wr_addr_i(3 downto 0);
266 rst_ipbus_raw_mgt_addr_bus <= spy_ram_rst_wr_addr_i(7 downto 4);
267 rst_ipbus_built_fifo_addr_bus <= spy_ram_rst_wr_addr_i(9 downto 8);
268 rst_ipbus_merger_spy_addr_bus <= spy_ram_rst_wr_addr_i(11 downto 10);
269 ipbus_tob_mgt_wraparound_bus <= wraparound_enable_i(3 downto 0);
270 ipbus_raw_mgt_wraparound_bus <= wraparound_enable_i(7 downto 4);
271 ipbus_built_fifo_wraparound_bus <= wraparound_enable_i(9 downto 8);
272 ipbus_merger_spy_wraparound_bus <= wraparound_enable_i(11 downto 10);
274 rst_err_cntrs_i <= counter_control_i(4) or rst_320;
275 rst_status_cntrs_i <= counter_control_i(5) or rst_320;
276 rst_xoff_cntr_i <= counter_control_i(6) or rst_320;
278 L1ID_latch:
process(clk_320)
280 if (rising_edge(clk_320)) then
281 if (rst_status_cntrs_i = '1') then
282 Last_L1ID_merger_A_i <= (Others => '0');
283 Last_L1ID_merger_B_i <= (Others => '0');
284 for i in 3 downto 0 loop
285 tob_mgt_last_l1id_bus_i(i) <= (Others => '0');
286 tob_mgt_last_error_l1id_bus_i(i) <= (Others => '0');
287 raw_mgt_last_l1id_bus_i(i) <= (Others => '0');
288 raw_mgt_last_error_l1id_bus_i(i) <= (Others => '0');
291 if (L1A_seen_bus(0) = '1') then
292 Last_L1ID_merger_A_i <= Last_L1ID_merger_A;
294 if (L1A_seen_bus(1) = '1') then
295 Last_L1ID_merger_B_i <= Last_L1ID_merger_B;
297 for i in 3 downto 0 loop
298 if (tob_mgt_packet_received_bus(i) = '1') then
299 tob_mgt_last_l1id_bus_i(i) <= tob_mgt_last_l1id_bus(i);
301 if (tob_mgt_packet_err_bus(i) = '1') or (tob_mgt_length_err_bus(i) = '1') then
302 tob_mgt_last_error_l1id_bus_i(i) <= tob_mgt_last_l1id_bus(i);
304 if (raw_mgt_packet_received_bus(i) = '1') then
305 raw_mgt_last_l1id_bus_i(i) <= raw_mgt_last_l1id_bus(i);
307 if (raw_mgt_packet_err_bus(i) = '1') or (raw_mgt_length_err_bus(i) = '1') then
308 raw_mgt_last_error_l1id_bus_i(i) <= raw_mgt_last_l1id_bus(i);
313 end process L1ID_latch;
315 MUX_source_block:
process(clk_320)
316 variable pkt_active_a, pkt_active_b : unsigned(18 downto 0);
317 constant max_count: unsigned(18 downto 0) := (Others => '1');
318 variable last_src_a, last_src_b: std_logic_vector(3 downto 0);
320 if (rising_edge(clk_320)) then
321 if (rst_status_cntrs_i = '1') then
322 pkt_active_a := (Others => '0');
323 pkt_active_b := (Others => '0');
324 last_src_a := (Others => '0');
325 last_src_b := (Others => '0');
327 if (mux_l1id_valid_bus(0) = '1') or (mux_source_bus(3 downto 0) /= last_src_a) then
328 pkt_active_a := (Others => '0');
329 elsif (mux_active_bus(0) = '1') and (pkt_active_a < max_count) then
330 pkt_active_a := pkt_active_a + 1;
332 last_src_a := mux_source_bus(3 downto 0);
333 if (mux_l1id_valid_bus(1) = '1') or (mux_source_bus(7 downto 4) /= last_src_b) then
334 pkt_active_b := (Others => '0');
335 elsif (mux_active_bus(1) = '1') and (pkt_active_b < max_count) then
336 pkt_active_b := pkt_active_b + 1;
338 last_src_b := mux_source_bus(7 downto 4);
341 mux_active_bus_i(0) <= std_logic_vector(pkt_active_a(18 downto 3));
342 mux_active_bus_i(1) <= std_logic_vector(pkt_active_b(18 downto 3));
344 mux_l1id_valid_bus_i <= mux_l1id_valid_bus;
345 mux_l1id_bus_i <= mux_l1id_bus;
346 mux_source_bus_i <= mux_source_bus;
348 end process MUX_source_block;
350 mux_source_a <= to_integer(unsigned(mux_source_bus_i(3 downto 0)));
351 mux_source_b <= to_integer(unsigned(mux_source_bus_i(7 downto 4)));
353 mux_sig_gen: for i in 5 downto 0 generate
355 mux_a_bus_block:
process(clk_320)
357 if (rising_edge(clk_320)) then
358 if (rst_status_cntrs_i = '1') then
359 mux_a_last_l1id_bus_i(i) <= (Others => '0');
360 elsif (mux_source_a = i) then
361 mux_a_pkt_bus_i(i) <= mux_l1id_valid_bus_i(0);
362 mux_a_active_bus_i(i) <= mux_active_bus_i(0);
363 if (mux_l1id_valid_bus_i(0) = '1') then
364 mux_a_last_l1id_bus_i(i) <= mux_l1id_bus_i(0);
367 mux_a_pkt_bus_i(i) <= '0';
368 mux_a_active_bus_i(i) <= (Others => '0');
371 end process mux_a_bus_block;
373 mux_b_bus_block:
process(clk_320)
375 if (rising_edge(clk_320)) then
376 if (rst_status_cntrs_i = '1') then
377 mux_b_last_l1id_bus_i(i) <= (Others => '0');
378 elsif (mux_source_b = i) then
379 mux_b_pkt_bus_i(i) <= mux_l1id_valid_bus_i(1);
380 mux_b_active_bus_i(i) <= mux_active_bus_i(1);
381 if (mux_l1id_valid_bus_i(1) = '1') then
382 mux_b_last_l1id_bus_i(i) <= mux_l1id_bus_i(1);
385 mux_b_pkt_bus_i(i) <= '0';
386 mux_b_active_bus_i(i) <= (Others => '0');
389 end process mux_b_bus_block;
392 MUX_orbit_block:
process(clk_320)
393 variable orbit_active_a, orbit_active_b, last_orbit_active_a, last_orbit_active_b : unsigned(16 downto 0);
395 if (rising_edge(clk_320)) then
396 if (rst_status_cntrs_i = '1') then
397 orbit_active_a := (Others => '0');
398 orbit_active_b := (Others => '0');
399 last_orbit_active_a := (Others => '0');
400 last_orbit_active_b := (Others => '0');
401 elsif (bcr_320 = '1') then
402 last_orbit_active_a := orbit_active_a;
403 last_orbit_active_b := orbit_active_b;
404 orbit_active_a := (Others => '0');
405 orbit_active_b := (Others => '0');
407 if (mux_active_bus(0) = '1') then
408 orbit_active_a := orbit_active_a + 1;
410 if (mux_active_bus(1) = '1') then
411 orbit_active_b := orbit_active_b + 1;
414 mux_orbit_active_bus_i(0) <= "00" & std_logic_vector(last_orbit_active_a(16 downto 3));
415 mux_orbit_active_bus_i(1) <= "00" & std_logic_vector(last_orbit_active_b(16 downto 3));
417 end process MUX_orbit_block;
422 TOB_FIFO_MAX_ADDR_WIDTH => TOB_FIFO_ADDR_MAX_WIDTH,
435 ipbus_in_tob_mgt_rbus_array => ipbus_tob_mgt_rbus_array ,
437 ipbus_in_raw_mgt_rbus_array => ipbus_raw_mgt_rbus_array ,
439 ipbus_in_merger_spy_rbus_array => ipbus_merger_spy_rbus_array,
441 ipbus_in_built_fifo_rbus_array => ipbus_built_fifo_rbus_array ,
445 readout_delay => readout_delay,
446 counter_control => counter_control_i,
447 spy_ram_rst_wr_addr => spy_ram_rst_wr_addr_i,
448 wraparound_enable => wraparound_enable_i,
451 tob_fifo_prog_full_thresh_negate => tob_fifo_prog_full_thresh_negate_i,
452 raw_fifo_prog_full_thresh_assert => raw_fifo_prog_full_thresh_assert_i,
453 raw_fifo_prog_full_thresh_negate => raw_fifo_prog_full_thresh_negate_i,
455 tob_fifo_xoff_thresh_assert => tob_fifo_xoff_thresh_assert_i,
456 tob_fifo_xoff_thresh_negate => tob_fifo_xoff_thresh_negate_i,
457 raw_fifo_xoff_thresh_assert => raw_fifo_xoff_thresh_assert_i,
458 raw_fifo_xoff_thresh_negate => raw_fifo_xoff_thresh_negate_i,
459 merged_fifo_xoff_thresh_assert => merged_fifo_xoff_thresh_assert_i,
460 merged_fifo_xoff_thresh_negate => merged_fifo_xoff_thresh_negate_i,
461 dbg_fifo_xoff_thresh_assert => dbg_fifo_xoff_thresh_assert_i,
462 dbg_fifo_xoff_thresh_negate => dbg_fifo_xoff_thresh_negate_i,
464 tob_mgt_packet_received_cnt_bus => tob_mgt_packet_received_cnt_bus_i,
465 tob_mgt_safe_mode_cnt_bus => tob_mgt_safe_mode_cnt_bus_i,
466 tob_mgt_packet_err_cnt_bus => tob_mgt_packet_err_cnt_bus_i,
467 tob_mgt_length_err_cnt_bus => tob_mgt_length_err_cnt_bus_i,
468 tob_mgt_bcn_err_cnt_bus => tob_mgt_bcn_err_cnt_bus_i,
469 tob_mgt_last_l1id_bus => tob_mgt_last_l1id_bus_i,
470 tob_mgt_last_error_l1id_bus => tob_mgt_last_error_l1id_bus_i,
471 raw_mgt_packet_received_cnt_bus => raw_mgt_packet_received_cnt_bus_i,
472 raw_mgt_safe_mode_cnt_bus => raw_mgt_safe_mode_cnt_bus_i,
473 raw_mgt_packet_err_cnt_bus => raw_mgt_packet_err_cnt_bus_i,
474 raw_mgt_length_err_cnt_bus => raw_mgt_length_err_cnt_bus_i,
475 raw_mgt_last_l1id_bus => raw_mgt_last_l1id_bus_i,
476 raw_mgt_last_error_l1id_bus => raw_mgt_last_error_l1id_bus_i,
478 tob_fifo_fill_level_A_bus => tob_fifo_fill_level_A_bus ,
479 tob_packet_count_A_bus => tob_packet_count_A_bus ,
480 tob_fifo_err_cnt_A_bus => tob_fifo_err_cnt_A_bus_i ,
481 tob_fifo_fill_level_B_bus => tob_fifo_fill_level_B_bus,
482 tob_packet_count_B_bus => tob_packet_count_B_bus,
483 tob_fifo_err_cnt_B_bus => tob_fifo_err_cnt_B_bus_i ,
484 merged_fifo_fill_level_A_bus => merged_fifo_fill_level_A_bus,
485 merged_packet_count_A_bus => merged_packet_count_A_bus,
486 merged_fifo_err_cnt_A_bus => merged_fifo_err_cnt_A_bus_i ,
487 merged_fifo_fill_level_B_bus => merged_fifo_fill_level_B_bus,
488 merged_packet_count_B_bus => merged_packet_count_B_bus,
489 merged_fifo_err_cnt_B_bus => merged_fifo_err_cnt_B_bus_i,
490 raw_fifo_fill_level_bus => raw_fifo_fill_level_bus,
491 raw_packet_count_bus => raw_packet_count_bus,
492 raw_fifo_err_cnt_bus => raw_fifo_err_cnt_i,
494 tob_fifo_tide_mark_A_bus => tob_fifo_tide_mark_A_bus_i,
495 tob_packet_tide_mark_A_bus => tob_packet_tide_mark_A_bus_i,
496 tob_fifo_tide_mark_B_bus => tob_fifo_tide_mark_B_bus_i,
497 tob_packet_tide_mark_B_bus => tob_packet_tide_mark_B_bus_i,
498 merged_fifo_tide_mark_A_bus => merged_fifo_tide_mark_A_bus_i,
499 merged_packet_tide_mark_A_bus => merged_packet_tide_mark_A_bus_i,
500 merged_fifo_tide_mark_B_bus => merged_fifo_tide_mark_B_bus_i,
501 merged_packet_tide_mark_B_bus => merged_packet_tide_mark_B_bus_i,
502 raw_fifo_tide_mark_bus => raw_fifo_tide_mark_bus_i,
503 raw_packet_tide_mark_bus => raw_packet_tide_mark_bus_i,
505 Last_L1ID_merger_A => Last_L1ID_merger_A_i,
506 Last_L1ID_merger_B => Last_L1ID_merger_B_i,
507 L1A_cnt_merger_A => L1A_cnt_merger_A_i,
508 L1A_cnt_merger_B => L1A_cnt_merger_B_i,
509 TOB_packet_merged_cnt_A_bus => TOB_packet_merged_cnt_A_bus_out_i ,
510 TOB_packet_missing_cnt_A_bus => TOB_packet_missing_cnt_A_bus_out_i ,
511 debug_packet_created_cnt_A_bus => debug_packet_created_cnt_A_bus_out_i ,
512 TOB_packet_merged_cnt_B_bus => TOB_packet_merged_cnt_B_bus_out_i ,
513 TOB_packet_missing_cnt_B_bus => TOB_packet_missing_cnt_B_bus_out_i ,
514 debug_packet_created_cnt_B_bus => debug_packet_created_cnt_B_bus_out_i ,
516 mux_orbit_active_bus => mux_orbit_active_bus_i,
517 mux_orbit_active_tide_mark_bus => mux_orbit_active_tide_mark_bus_i,
518 mux_a_active_bus => mux_a_active_bus_i,
519 mux_b_active_bus => mux_b_active_bus_i,
520 mux_a_active_tide_mark_bus => mux_a_active_tide_mark_bus_i,
521 mux_b_active_tide_mark_bus => mux_b_active_tide_mark_bus_i,
522 mux_a_pkt_cnt_bus => mux_a_pkt_cnt_bus_i,
523 mux_b_pkt_cnt_bus => mux_b_pkt_cnt_bus_i,
524 mux_a_last_l1id_bus => mux_a_last_l1id_bus_i,
525 mux_b_last_l1id_bus => mux_b_last_l1id_bus_i,
527 fifo_bc_count => fifo_bc_count_i,
528 tob_busy_cnt_32b_A => tob_busy_cnt_32b_A_i,
529 tob_busy_cnt_32b_B => tob_busy_cnt_32b_B_i,
530 tob_xoff_cnt_32b_A => tob_xoff_cnt_32b_A_i,
531 tob_xoff_cnt_32b_B => tob_xoff_cnt_32b_B_i,
532 merged_xoff_cnt_32b_A => merged_xoff_cnt_32b_A_i,
533 merged_xoff_cnt_32b_B => merged_xoff_cnt_32b_B_i,
534 raw_busy_cnt_32b => raw_busy_cnt_32b_i,
535 raw_xoff_cnt_32b => raw_xoff_cnt_32b_i,
537 tob_busy_active_cnt_32b_A => tob_busy_active_cnt_32b_A_i,
538 tob_busy_active_cnt_32b_B => tob_busy_active_cnt_32b_B_i,
539 tob_xoff_active_cnt_32b_A => tob_xoff_active_cnt_32b_A_i,
540 tob_xoff_active_cnt_32b_B => tob_xoff_active_cnt_32b_B_i,
541 merged_xoff_active_cnt_32b_A => merged_xoff_active_cnt_32b_A_i,
542 merged_xoff_active_cnt_32b_B => merged_xoff_active_cnt_32b_B_i,
543 raw_busy_active_cnt_32b => raw_busy_active_cnt_32b_i,
544 raw_xoff_active_cnt_32b => raw_xoff_active_cnt_32b_i,
546 tob_busy_assert_cnt_32b_A => tob_busy_assert_cnt_32b_A_i,
547 tob_busy_assert_cnt_32b_B => tob_busy_assert_cnt_32b_B_i,
548 tob_xoff_assert_cnt_32b_A => tob_xoff_assert_cnt_32b_A_i,
549 tob_xoff_assert_cnt_32b_B => tob_xoff_assert_cnt_32b_B_i,
550 merged_xoff_assert_cnt_32b_A => merged_xoff_assert_cnt_32b_A_i,
551 merged_xoff_assert_cnt_32b_B => merged_xoff_assert_cnt_32b_B_i,
552 raw_busy_assert_cnt_32b => raw_busy_assert_cnt_32b_i,
553 raw_xoff_assert_cnt_32b => raw_xoff_assert_cnt_32b_i
562 rst_err_cntrs => rst_err_cntrs_i,
563 rst_status_cntrs => rst_status_cntrs_i,
565 tob_fifo_error_A_bus => tob_fifo_error_A_bus,
566 tob_fifo_error_B_bus => tob_fifo_error_B_bus,
567 merged_fifo_error_A_bus => merged_fifo_error_A_bus,
568 merged_fifo_error_B_bus => merged_fifo_error_B_bus,
569 raw_fifo_error_bus => raw_fifo_error_bus,
571 tob_fifo_err_cnt_A_bus_out => tob_fifo_err_cnt_A_bus_i ,
572 tob_fifo_err_cnt_B_bus_out => tob_fifo_err_cnt_B_bus_i ,
573 merged_fifo_err_cnt_A_bus_out => merged_fifo_err_cnt_A_bus_i ,
574 merged_fifo_err_cnt_B_bus_out => merged_fifo_err_cnt_B_bus_i ,
575 raw_fifo_err_cnt_out => raw_fifo_err_cnt_i,
577 tob_mgt_packet_received_bus => tob_mgt_packet_received_bus,
578 tob_mgt_safe_mode_bus => tob_mgt_safe_mode_bus,
579 tob_mgt_packet_err_bus => tob_mgt_packet_err_bus,
580 tob_mgt_length_err_bus => tob_mgt_length_err_bus,
581 tob_mgt_bcn_err_bus => tob_mgt_bcn_err_bus,
583 tob_mgt_packet_received_cnt_bus_out => tob_mgt_packet_received_cnt_bus_i,
584 tob_mgt_safe_mode_cnt_bus_out => tob_mgt_safe_mode_cnt_bus_i,
585 tob_mgt_packet_err_cnt_bus_out => tob_mgt_packet_err_cnt_bus_i,
586 tob_mgt_length_err_cnt_bus_out => tob_mgt_length_err_cnt_bus_i,
587 tob_mgt_bcn_err_cnt_bus_out => tob_mgt_bcn_err_cnt_bus_i,
589 raw_mgt_packet_received_bus => raw_mgt_packet_received_bus,
590 raw_mgt_safe_mode_bus => raw_mgt_safe_mode_bus,
591 raw_mgt_packet_err_bus => raw_mgt_packet_err_bus,
592 raw_mgt_length_err_bus => raw_mgt_length_err_bus,
594 raw_mgt_packet_received_cnt_bus_out => raw_mgt_packet_received_cnt_bus_i,
595 raw_mgt_safe_mode_cnt_bus_out => raw_mgt_safe_mode_cnt_bus_i,
596 raw_mgt_packet_err_cnt_bus_out => raw_mgt_packet_err_cnt_bus_i,
597 raw_mgt_length_err_cnt_bus_out => raw_mgt_length_err_cnt_bus_i,
599 L1A_seen_bus => L1A_seen_bus,
600 L1A_cnt_merger_A => L1A_cnt_merger_A_i,
601 L1A_cnt_merger_B => L1A_cnt_merger_B_i,
603 TOB_packet_merged_A_bus => TOB_packet_merged_A_bus,
604 TOB_packet_missing_A_bus => TOB_packet_missing_A_bus,
605 debug_packet_created_A_bus => debug_packet_created_A_bus ,
606 TOB_packet_merged_B_bus => TOB_packet_merged_B_bus,
607 TOB_packet_missing_B_bus => TOB_packet_missing_B_bus,
608 debug_packet_created_B_bus => debug_packet_created_B_bus ,
610 TOB_packet_merged_cnt_A_bus_out => TOB_packet_merged_cnt_A_bus_out_i ,
611 TOB_packet_missing_cnt_A_bus_out => TOB_packet_missing_cnt_A_bus_out_i ,
612 debug_packet_created_cnt_A_bus_out => debug_packet_created_cnt_A_bus_out_i ,
613 TOB_packet_merged_cnt_B_bus_out => TOB_packet_merged_cnt_B_bus_out_i ,
614 TOB_packet_missing_cnt_B_bus_out => TOB_packet_missing_cnt_B_bus_out_i ,
615 debug_packet_created_cnt_B_bus_out => debug_packet_created_cnt_B_bus_out_i,
617 mux_a_pkt_bus => mux_a_pkt_bus_i,
618 mux_b_pkt_bus => mux_b_pkt_bus_i,
620 mux_a_pkt_cnt_bus_out => mux_a_pkt_cnt_bus_i,
621 mux_b_pkt_cnt_bus_out => mux_b_pkt_cnt_bus_i
624 U3_monitoring_block :
entity infrastructure_lib.
rdout_monitor
627 rst_xoff_cntr => rst_xoff_cntr_i,
630 tob_fifo_prog_full_thresh_negate => tob_fifo_prog_full_thresh_negate_i,
632 raw_fifo_prog_full_thresh_negate => raw_fifo_prog_full_thresh_negate_i,
634 tob_fifo_xoff_thresh_assert => tob_fifo_xoff_thresh_assert_i,
635 tob_fifo_xoff_thresh_negate => tob_fifo_xoff_thresh_negate_i,
636 merged_fifo_xoff_thresh_assert => merged_fifo_xoff_thresh_assert_i,
637 merged_fifo_xoff_thresh_negate => merged_fifo_xoff_thresh_negate_i,
638 raw_fifo_xoff_thresh_assert => raw_fifo_xoff_thresh_assert_i,
639 raw_fifo_xoff_thresh_negate => raw_fifo_xoff_thresh_negate_i,
640 dbg_fifo_xoff_thresh_assert => dbg_fifo_xoff_thresh_assert_i,
641 dbg_fifo_xoff_thresh_negate => dbg_fifo_xoff_thresh_negate_i,
644 tob_fifo_fill_level_B_bus => tob_fifo_fill_level_B_bus,
646 merged_fifo_fill_level_B_bus => merged_fifo_fill_level_B_bus,
649 fifo_bc_count => fifo_bc_count_i,
650 tob_busy_cnt_32b_A => tob_busy_cnt_32b_A_i,
651 tob_xoff_cnt_32b_A => tob_xoff_cnt_32b_A_i,
652 tob_busy_cnt_32b_B => tob_busy_cnt_32b_B_i,
653 tob_xoff_cnt_32b_B => tob_xoff_cnt_32b_B_i,
654 merged_xoff_cnt_32b_A => merged_xoff_cnt_32b_A_i,
655 merged_xoff_cnt_32b_B => merged_xoff_cnt_32b_B_i,
656 raw_busy_cnt_32b => raw_busy_cnt_32b_i,
657 raw_xoff_cnt_32b => raw_xoff_cnt_32b_i,
659 tob_busy_active_cnt_32b_A => tob_busy_active_cnt_32b_A_i,
660 tob_busy_active_cnt_32b_B => tob_busy_active_cnt_32b_B_i,
661 tob_xoff_active_cnt_32b_A => tob_xoff_active_cnt_32b_A_i,
662 tob_xoff_active_cnt_32b_B => tob_xoff_active_cnt_32b_B_i,
663 merged_xoff_active_cnt_32b_A => merged_xoff_active_cnt_32b_A_i,
664 merged_xoff_active_cnt_32b_B => merged_xoff_active_cnt_32b_B_i,
665 raw_busy_active_cnt_32b => raw_busy_active_cnt_32b_i,
666 raw_xoff_active_cnt_32b => raw_xoff_active_cnt_32b_i,
668 tob_busy_assert_cnt_32b_A => tob_busy_assert_cnt_32b_A_i,
669 tob_busy_assert_cnt_32b_B => tob_busy_assert_cnt_32b_B_i,
670 tob_xoff_assert_cnt_32b_A => tob_xoff_assert_cnt_32b_A_i,
671 tob_xoff_assert_cnt_32b_B => tob_xoff_assert_cnt_32b_B_i,
672 merged_xoff_assert_cnt_32b_A => merged_xoff_assert_cnt_32b_A_i,
673 merged_xoff_assert_cnt_32b_B => merged_xoff_assert_cnt_32b_B_i,
674 raw_busy_assert_cnt_32b => raw_busy_assert_cnt_32b_i,
675 raw_xoff_assert_cnt_32b => raw_xoff_assert_cnt_32b_i,
677 tob_mgt_xoff_bus => tob_mgt_xoff_bus,
678 raw_mgt_xoff_bus => raw_mgt_xoff_bus,
680 tob_busy_bus => tob_busy_bus,
681 raw_busy_bus => raw_busy_bus,
683 Block_A_pause => Block_A_pause,
684 Block_B_pause => Block_B_pause
693 rst_status_cntrs => rst_status_cntrs_i,
695 value_bus
(3 downto 0) => tob_fifo_fill_level_A_bus,
696 value_bus
(7 downto 4) => tob_packet_count_A_bus,
697 value_bus
(11 downto 8) => tob_fifo_fill_level_B_bus,
698 value_bus
(15 downto 12) => tob_packet_count_B_bus,
699 value_bus
(17 downto 16) => merged_fifo_fill_level_A_bus,
700 value_bus
(19 downto 18) => merged_packet_count_A_bus,
701 value_bus
(21 downto 20) => merged_fifo_fill_level_B_bus,
702 value_bus
(23 downto 22) => merged_packet_count_B_bus,
703 value_bus
(27 downto 24) => raw_fifo_fill_level_bus,
704 value_bus
(31 downto 28) => raw_packet_count_bus,
705 value_bus
(37 downto 32) => mux_a_active_bus_i,
706 value_bus
(43 downto 38) => mux_b_active_bus_i,
707 value_bus
(45 downto 44) => mux_orbit_active_bus_i,
709 tide_mark_bus
(3 downto 0) => tob_fifo_tide_mark_A_bus_i,
710 tide_mark_bus
(7 downto 4) => tob_packet_tide_mark_A_bus_i,
711 tide_mark_bus
(11 downto 8) => tob_fifo_tide_mark_B_bus_i,
712 tide_mark_bus
(15 downto 12) => tob_packet_tide_mark_B_bus_i,
713 tide_mark_bus
(17 downto 16) => merged_fifo_tide_mark_A_bus_i,
714 tide_mark_bus
(19 downto 18) => merged_packet_tide_mark_A_bus_i,
715 tide_mark_bus
(21 downto 20) => merged_fifo_tide_mark_B_bus_i,
716 tide_mark_bus
(23 downto 22) => merged_packet_tide_mark_B_bus_i,
717 tide_mark_bus
(27 downto 24) => raw_fifo_tide_mark_bus_i,
718 tide_mark_bus
(31 downto 28) => raw_packet_tide_mark_bus_i,
719 tide_mark_bus
(37 downto 32) => mux_a_active_tide_mark_bus_i,
720 tide_mark_bus
(43 downto 38) => mux_b_active_tide_mark_bus_i,
721 tide_mark_bus
(45 downto 44) => mux_orbit_active_tide_mark_bus_i
Instantiate the readout merging and routing FIFO status and control interface to IPBus....
RAW_FIFO_ADDR_MAX_WIDTH positive := 11
address bus width of merged FIFO RAMs after TOB merging
MERGED_FIFO_ADDR_MAX_WIDTH positive := 11
address bus width of TOB FIFO RAM in packet_fifo_block for each Processor FPGA
MAX_PACKET_WIDTH positive := 8
address bus width of RAW FIFO RAM in packet_fifo_block for each Processor FPGA address bus width of m...
Instantiate tide mark calculation for a set of 16 bit values...
Control FPGA readout counter registers.
Control FPGA data_path slave registers.
in bcr_320 std_logic
Control registers.
in ipb_rst std_logic
IPBus Reset input.
MERGED_FIFO_MAX_ADDR_WIDTH positive := 11
address bus width of TOB FIFO RAM in packet_fifo_block for each Processor FPGA
out ipbus_out_raw_mgt_wbus_array ipb_wbus_array( 3 downto 0)
MGT raw input spy RAMs.
out IPb_out ipb_rbus
IPBus output bus going from slaves to master.
out ipbus_out_tob_mgt_wbus_array ipb_wbus_array( 3 downto 0)
MGT TOB input spy RAMs.
out ipbus_out_merger_spy_wbus_array ipb_wbus_array( 1 downto 0)
Merger debug spy RAMs.
in IPb_in ipb_wbus
IPBus input bus going from master to slaves.
PACKET_MAX_WIDTH positive := 8
address bus width of RAW FIFO RAM in packet_fifo_block for each Processor FPGA address bus width of m...
in ipb_clk std_logic
IPBus Clock input.
RAW_FIFO_MAX_ADDR_WIDTH positive := 11
address bus width of merged FIFO RAMs after TOB merging
out ipbus_out_built_fifo_wbus_array ipb_wbus_array( 1 downto 0)
Aurora output spy RAMs.
out tob_fifo_prog_full_thresh_assert std_logic_vector( 15 downto 0)
BUSY FIFO partial full flag thresholds.
Control Readout FIFO level Monitor.
in tob_fifo_fill_level_A_bus fifo_status_array( 3 downto 0)
TOB FIFO status block B XOFF & BUSY.
in raw_fifo_prog_full_thresh_assert std_logic_vector( 15 downto 0)
BUSY input RAW FIFO partial full flag assert thresholds.
in raw_fifo_fill_level_bus fifo_status_array( 3 downto 0)
Raw FIFO status block XOFF & BUSY.
in merged_fifo_fill_level_A_bus fifo_status_array( 1 downto 0)
Aurora merged_fifo status bits PAUSE.
in tob_fifo_prog_full_thresh_assert std_logic_vector( 15 downto 0)
BUSY TOB FIFO partial full flag thresholds.