eFEX firmware  1.7.3
ATLAS l1-calo - electron and tau feature extraction firmware for eFEX boards

Back to eFEX documentation
packet_status_block.vhd
Go to the documentation of this file.
1 
44 
46 LIBRARY ieee;
47 USE ieee.std_logic_1164.all;
48 use ieee.numeric_std.all;
49 
50 LIBRARY ipbus_lib;
51 USE ipbus_lib.ipbus.all;
52 LIBRARY infrastructure_lib;
53 use infrastructure_lib.packet_mux_type.all;
54 
57  GENERIC(
58  TOB_FIFO_ADDR_MAX_WIDTH: positive := 12;
60  MERGED_FIFO_ADDR_MAX_WIDTH: positive := 11;
62  RAW_FIFO_ADDR_MAX_WIDTH: positive := 11;
64  MAX_PACKET_WIDTH : positive := 8
66  );
67  PORT (
68 -- clocks etc
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;
75 -- upstream IPBus
76  ipb_in : in ipb_wbus;
77  ipb_out : out ipb_rbus;
78 -- MGT TOB input spy RAMs
79  ipbus_tob_mgt_wbus_array : out ipb_wbus_array(3 downto 0); -- array of wbus
80  ipbus_tob_mgt_rbus_array : in ipb_rbus_array(3 downto 0); -- array of rbus
81 -- MGT raw input spy RAMs
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);
84 -- Merger debug spy RAMs
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);
87 -- Aurora output spy RAMs
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);
90 
91 -- MGT TOB input spy RAM control
92  rst_ipbus_tob_mgt_addr_bus : out std_logic_vector(3 downto 0); -- size of spy RAM 16-bit address
93  ipbus_tob_mgt_wraparound_bus : out std_logic_vector(3 downto 0);
94 -- MGT raw input spy RAM control
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);
97 -- Merger debug spy RAM control
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);
100 -- Aurora output spy RAM control
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);
103 -- Readout delay control
104  readout_delay : out std_logic_vector(31 downto 0);
105 -- TOB MGT status
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);
112 
113 -- Raw MGT status
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);
119 
120 -- TOB FIFO status block A -- TOB FIFOs have same values, XOFF & BUSY
121  tob_fifo_fill_level_A_bus : in fifo_status_array(3 downto 0); -- array of 16-bits
122  tob_packet_count_A_bus : in fifo_status_array(3 downto 0); -- array of 16-bits
123  tob_fifo_error_A_bus : in std_logic_vector(3 downto 0); -- status to be read by IPBus (if rd & wr pointers crash) to be counted.
124 
125 -- TOB FIFO status block B XOFF & BUSY
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);
129 
130 -- L1A status
131  Last_L1ID_merger_A : in std_logic_vector(31 downto 0); -- ECRID and L1ID
132  Last_L1ID_merger_B : in std_logic_vector(31 downto 0);
133  L1A_seen_bus : in std_logic_vector(1 downto 0); -- Merger A (0), Merger B (1)
134 
135 -- TOB merging counts per Processor FPGA
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);
142 
143 -- MUX status
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);
148 
149 -- status bits PAUSE
150  merged_fifo_fill_level_A_bus : in fifo_status_array(1 downto 0); -- merged TOB FIFO (0), debug FIFO (1) 16-bits inputs
151  merged_packet_count_A_bus : in fifo_status_array(1 downto 0); -- merged TOB FIFO (0), debug FIFO (1) 16-bits
152  merged_fifo_error_A_bus : in std_logic_vector(1 downto 0); -- merged TOB FIFO (0), debug FIFO (1) count errors
153 
154 -- status bits PAUSE
155  merged_fifo_fill_level_B_bus : in fifo_status_array(1 downto 0); -- merged TOB FIFO (0), debug FIFO (1)
156  merged_packet_count_B_bus : in fifo_status_array(1 downto 0); -- merged TOB FIFO (0), debug FIFO (1)
157  merged_fifo_error_B_bus : in std_logic_vector(1 downto 0); -- merged TOB FIFO (0), debug FIFO (1)
158 
159 -- Raw FIFO status block XOFF & BUSY
160  raw_fifo_fill_level_bus : in fifo_status_array(3 downto 0); -- 16-bits
161  raw_packet_count_bus : in fifo_status_array(3 downto 0);
162  raw_fifo_error_bus : in std_logic_vector(3 downto 0);
163 
164 -- MGT flow control
165  tob_mgt_xoff_bus : out std_logic_vector(3 downto 0); -- to process FPGA
166  raw_mgt_xoff_bus : out std_logic_vector(3 downto 0);
167 -- BUSY control
168  tob_busy_bus : out std_logic_vector(3 downto 0);
169  raw_busy_bus : out std_logic_vector(3 downto 0);
170 -- Merging block flow control
171  Block_A_pause : out std_logic_vector(1 downto 0);
172  Block_B_pause : out std_logic_vector(1 downto 0)
173  );
175 
176 architecture Behavioral of packet_status_block is
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);
180 
181  signal rst_err_cntrs_i : std_logic ; -- reset all memory error counters
182  signal rst_status_cntrs_i : std_logic ; -- reset all status counters
183  signal rst_xoff_cntr_i : std_logic ; -- reset all BUSY/xoff counters
184 
185  signal tob_fifo_err_cnt_A_bus_i : mgt_data_array(3 downto 0); -- 32-bit error counter
186  signal tob_fifo_err_cnt_B_bus_i : mgt_data_array(3 downto 0); -- 32-bit error counter
187  signal raw_fifo_err_cnt_i : mgt_data_array(3 downto 0); -- 32-bit error counter
188  signal merged_fifo_err_cnt_A_bus_i : mgt_data_array(1 downto 0); -- 32-bit error counter
189  signal merged_fifo_err_cnt_B_bus_i : mgt_data_array(1 downto 0); -- 32-bit error counter
190 
191  signal tob_fifo_prog_full_thresh_assert_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
192  signal tob_fifo_prog_full_thresh_negate_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
193  signal raw_fifo_prog_full_thresh_assert_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
194  signal raw_fifo_prog_full_thresh_negate_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
195 
196  signal tob_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
197  signal tob_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
198  signal merged_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
199  signal merged_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
200  signal raw_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
201  signal raw_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
202  signal dbg_fifo_xoff_thresh_assert_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
203  signal dbg_fifo_xoff_thresh_negate_i : std_logic_vector(15 downto 0); -- 16-b out of 32-b register
204 
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); -- 32-b register
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); -- 32-b register
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); -- 32-b register
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); -- 32-b register
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); -- 32-b register
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); -- 32-b register
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); -- 32-b register
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); -- 32-b register
214 
215 -- tide mark status registers
216  signal tob_fifo_tide_mark_A_bus_i : fifo_status_array(3 downto 0); -- array of 16-bits
217  signal tob_packet_tide_mark_A_bus_i : fifo_status_array(3 downto 0); -- array of 16-bits
218  signal tob_fifo_tide_mark_B_bus_i : fifo_status_array(3 downto 0); -- array of 16-bits
219  signal tob_packet_tide_mark_B_bus_i : fifo_status_array(3 downto 0); -- array of 16-bits
220  signal merged_fifo_tide_mark_A_bus_i : fifo_status_array(1 downto 0); -- array of 16-bits
221  signal merged_packet_tide_mark_A_bus_i : fifo_status_array(1 downto 0); -- array of 16-bits
222  signal merged_fifo_tide_mark_B_bus_i : fifo_status_array(1 downto 0); -- array of 16-bits
223  signal merged_packet_tide_mark_B_bus_i : fifo_status_array(1 downto 0); -- array of 16-bits
224  signal raw_fifo_tide_mark_bus_i : fifo_status_array(3 downto 0); -- array of 16-bits
225  signal raw_packet_tide_mark_bus_i : fifo_status_array(3 downto 0); -- array of 16-bits
226 
227  signal TOB_packet_merged_cnt_A_bus_out_i : mgt_data_array(3 downto 0); -- 32-b register
228  signal TOB_packet_missing_cnt_A_bus_out_i : mgt_data_array(3 downto 0); -- 32-b register
229  signal debug_packet_created_cnt_A_bus_out_i : mgt_data_array(3 downto 0); -- 32-b register
230  signal TOB_packet_merged_cnt_B_bus_out_i : mgt_data_array(3 downto 0); -- 32-b register
231  signal TOB_packet_missing_cnt_B_bus_out_i : mgt_data_array(3 downto 0); -- 32-b register
232  signal debug_packet_created_cnt_B_bus_out_i : mgt_data_array(3 downto 0); -- 32-b register
233 
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);
236 
237  signal tob_mgt_packet_received_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
238  signal tob_mgt_safe_mode_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
239  signal tob_mgt_packet_err_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
240  signal tob_mgt_length_err_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
241  signal tob_mgt_bcn_err_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
242 
243  signal raw_mgt_packet_received_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
244  signal raw_mgt_safe_mode_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
245  signal raw_mgt_packet_err_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
246  signal raw_mgt_length_err_cnt_bus_i : mgt_data_array(3 downto 0); -- 32-b register
247 
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);
250 
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);
262 
263 BEGIN
264 
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);
273 
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;
277 
278 L1ID_latch: process(clk_320)
279 begin
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');
289  end loop;
290  else
291  if (L1A_seen_bus(0) = '1') then
292  Last_L1ID_merger_A_i <= Last_L1ID_merger_A;
293  end if;
294  if (L1A_seen_bus(1) = '1') then
295  Last_L1ID_merger_B_i <= Last_L1ID_merger_B;
296  end if;
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);
300  end if;
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);
303  end if;
304  if (raw_mgt_packet_received_bus(i) = '1') then
305  raw_mgt_last_l1id_bus_i(i) <= raw_mgt_last_l1id_bus(i);
306  end if;
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);
309  end if;
310  end loop;
311  end if;
312  end if;
313 end process L1ID_latch;
314 
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);
319 begin
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');
326  else
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;
331  end if;
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;
337  end if;
338  last_src_b := mux_source_bus(7 downto 4);
339  end if;
340 -- Convert from 320 MHz to BC...
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));
343 -- and register all these for the mux_sig_gen...
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;
347  end if;
348 end process MUX_source_block;
349 
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)));
352 
353 mux_sig_gen: for i in 5 downto 0 generate
354 begin
355  mux_a_bus_block: process(clk_320)
356  begin
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);
365  end if;
366  else
367  mux_a_pkt_bus_i(i) <= '0';
368  mux_a_active_bus_i(i) <= (Others => '0');
369  end if;
370  end if;
371  end process mux_a_bus_block;
372 
373  mux_b_bus_block: process(clk_320)
374  begin
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);
383  end if;
384  else
385  mux_b_pkt_bus_i(i) <= '0';
386  mux_b_active_bus_i(i) <= (Others => '0');
387  end if;
388  end if;
389  end process mux_b_bus_block;
390 end generate;
391 
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);
394 begin
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');
406  else
407  if (mux_active_bus(0) = '1') then
408  orbit_active_a := orbit_active_a + 1;
409  end if;
410  if (mux_active_bus(1) = '1') then
411  orbit_active_b := orbit_active_b + 1;
412  end if;
413  end if;
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));
416  end if;
417 end process MUX_orbit_block;
418 
419 -- Readout_ipb_slave Module is responsible for communication with IPBus.
420 U1_rdout_ipb_slave : entity infrastructure_lib.rdout_ipb_slave
421  GENERIC map (
422  TOB_FIFO_MAX_ADDR_WIDTH => TOB_FIFO_ADDR_MAX_WIDTH,
426  )
427  Port map (
428  clk_320 => clk_320 , -- i/p
429  ipb_rst => rst_ipb , -- i/p
430  ipb_clk => clk_ipb , -- i/p
431  IPb_in => IPb_in , -- i/p
432  IPb_out => IPb_out , -- o/p
433 
434  ipbus_out_tob_mgt_wbus_array => ipbus_tob_mgt_wbus_array , -- o/p
435  ipbus_in_tob_mgt_rbus_array => ipbus_tob_mgt_rbus_array , -- i/p
436  ipbus_out_raw_mgt_wbus_array => ipbus_raw_mgt_wbus_array , -- o/p
437  ipbus_in_raw_mgt_rbus_array => ipbus_raw_mgt_rbus_array , -- i/p
438  ipbus_out_merger_spy_wbus_array => ipbus_merger_spy_wbus_array,
439  ipbus_in_merger_spy_rbus_array => ipbus_merger_spy_rbus_array,
440  ipbus_out_built_fifo_wbus_array => ipbus_built_fifo_wbus_array , -- o/p
441  ipbus_in_built_fifo_rbus_array => ipbus_built_fifo_rbus_array , -- i/p
442 -- control registers output
443  bcr_320 => bcr_320,
444  ecr_320 => ecr_320,
445  readout_delay => readout_delay,
446  counter_control => counter_control_i,
447  spy_ram_rst_wr_addr => spy_ram_rst_wr_addr_i, -- o/p
448  wraparound_enable => wraparound_enable_i, -- o/p
449 -- BUSY_FIFO_CONTROL
450  tob_fifo_prog_full_thresh_assert => tob_fifo_prog_full_thresh_assert_i, -- o/p
451  tob_fifo_prog_full_thresh_negate => tob_fifo_prog_full_thresh_negate_i, -- o/p
452  raw_fifo_prog_full_thresh_assert => raw_fifo_prog_full_thresh_assert_i, -- o/p
453  raw_fifo_prog_full_thresh_negate => raw_fifo_prog_full_thresh_negate_i, -- o/p
454 -- XOFF_FIFO_CONTROL
455  tob_fifo_xoff_thresh_assert => tob_fifo_xoff_thresh_assert_i, -- o/p
456  tob_fifo_xoff_thresh_negate => tob_fifo_xoff_thresh_negate_i, -- o/p
457  raw_fifo_xoff_thresh_assert => raw_fifo_xoff_thresh_assert_i, -- o/p
458  raw_fifo_xoff_thresh_negate => raw_fifo_xoff_thresh_negate_i, -- o/p
459  merged_fifo_xoff_thresh_assert => merged_fifo_xoff_thresh_assert_i, -- o/p
460  merged_fifo_xoff_thresh_negate => merged_fifo_xoff_thresh_negate_i, -- o/p
461  dbg_fifo_xoff_thresh_assert => dbg_fifo_xoff_thresh_assert_i, -- o/p
462  dbg_fifo_xoff_thresh_negate => dbg_fifo_xoff_thresh_negate_i, -- o/p
463 -- MGT status blocks
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,
477 -- FIFO status registers
478  tob_fifo_fill_level_A_bus => tob_fifo_fill_level_A_bus , -- i/p
479  tob_packet_count_A_bus => tob_packet_count_A_bus , -- i/p
480  tob_fifo_err_cnt_A_bus => tob_fifo_err_cnt_A_bus_i , -- i/p
481  tob_fifo_fill_level_B_bus => tob_fifo_fill_level_B_bus, -- i/p
482  tob_packet_count_B_bus => tob_packet_count_B_bus, -- i/p
483  tob_fifo_err_cnt_B_bus => tob_fifo_err_cnt_B_bus_i , -- i/p
484  merged_fifo_fill_level_A_bus => merged_fifo_fill_level_A_bus, -- i/p
485  merged_packet_count_A_bus => merged_packet_count_A_bus, -- i/p
486  merged_fifo_err_cnt_A_bus => merged_fifo_err_cnt_A_bus_i , -- i/p
487  merged_fifo_fill_level_B_bus => merged_fifo_fill_level_B_bus, -- i/p
488  merged_packet_count_B_bus => merged_packet_count_B_bus, -- i/p
489  merged_fifo_err_cnt_B_bus => merged_fifo_err_cnt_B_bus_i, -- i/p
490  raw_fifo_fill_level_bus => raw_fifo_fill_level_bus, -- i/p
491  raw_packet_count_bus => raw_packet_count_bus, -- i/p
492  raw_fifo_err_cnt_bus => raw_fifo_err_cnt_i, -- i/p
493 -- tide mark status registers
494  tob_fifo_tide_mark_A_bus => tob_fifo_tide_mark_A_bus_i, -- i/p
495  tob_packet_tide_mark_A_bus => tob_packet_tide_mark_A_bus_i, -- i/p
496  tob_fifo_tide_mark_B_bus => tob_fifo_tide_mark_B_bus_i, -- i/p
497  tob_packet_tide_mark_B_bus => tob_packet_tide_mark_B_bus_i, -- i/p
498  merged_fifo_tide_mark_A_bus => merged_fifo_tide_mark_A_bus_i, -- i/p
499  merged_packet_tide_mark_A_bus => merged_packet_tide_mark_A_bus_i, -- i/p
500  merged_fifo_tide_mark_B_bus => merged_fifo_tide_mark_B_bus_i, -- i/p
501  merged_packet_tide_mark_B_bus => merged_packet_tide_mark_B_bus_i, -- i/p
502  raw_fifo_tide_mark_bus => raw_fifo_tide_mark_bus_i, -- i/p
503  raw_packet_tide_mark_bus => raw_packet_tide_mark_bus_i, -- i/p
504 -- Merger status registers
505  Last_L1ID_merger_A => Last_L1ID_merger_A_i, -- ECRID and L1ID
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 , -- i/p 32-bits
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 ,
515 -- MUX status blocks
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,
526 -- BUSY and xoff counters
527  fifo_bc_count => fifo_bc_count_i,
528  tob_busy_cnt_32b_A => tob_busy_cnt_32b_A_i, -- i/p 32-bits
529  tob_busy_cnt_32b_B => tob_busy_cnt_32b_B_i, -- i/p 32-bits
530  tob_xoff_cnt_32b_A => tob_xoff_cnt_32b_A_i, -- 32-bits
531  tob_xoff_cnt_32b_B => tob_xoff_cnt_32b_B_i, -- 32-bits
532  merged_xoff_cnt_32b_A => merged_xoff_cnt_32b_A_i, -- 32-bits
533  merged_xoff_cnt_32b_B => merged_xoff_cnt_32b_B_i, -- 32-bits
534  raw_busy_cnt_32b => raw_busy_cnt_32b_i, -- 32-bits
535  raw_xoff_cnt_32b => raw_xoff_cnt_32b_i, -- 32-bits
536 
537  tob_busy_active_cnt_32b_A => tob_busy_active_cnt_32b_A_i, -- i/p 32-bits
538  tob_busy_active_cnt_32b_B => tob_busy_active_cnt_32b_B_i, -- i/p 32-bits
539  tob_xoff_active_cnt_32b_A => tob_xoff_active_cnt_32b_A_i, -- 32-bits
540  tob_xoff_active_cnt_32b_B => tob_xoff_active_cnt_32b_B_i, -- 32-bits
541  merged_xoff_active_cnt_32b_A => merged_xoff_active_cnt_32b_A_i, -- 32-bits
542  merged_xoff_active_cnt_32b_B => merged_xoff_active_cnt_32b_B_i, -- 32-bits
543  raw_busy_active_cnt_32b => raw_busy_active_cnt_32b_i, -- 32-bits
544  raw_xoff_active_cnt_32b => raw_xoff_active_cnt_32b_i, -- 32-bits
545 
546  tob_busy_assert_cnt_32b_A => tob_busy_assert_cnt_32b_A_i, -- i/p 32-bits
547  tob_busy_assert_cnt_32b_B => tob_busy_assert_cnt_32b_B_i, -- i/p 32-bits
548  tob_xoff_assert_cnt_32b_A => tob_xoff_assert_cnt_32b_A_i, -- 32-bits
549  tob_xoff_assert_cnt_32b_B => tob_xoff_assert_cnt_32b_B_i, -- 32-bits
550  merged_xoff_assert_cnt_32b_A => merged_xoff_assert_cnt_32b_A_i, -- 32-bits
551  merged_xoff_assert_cnt_32b_B => merged_xoff_assert_cnt_32b_B_i, -- 32-bits
552  raw_busy_assert_cnt_32b => raw_busy_assert_cnt_32b_i, -- 32-bits
553  raw_xoff_assert_cnt_32b => raw_xoff_assert_cnt_32b_i-- 32-bits
554 
555  );
556 
557 -- Readout Error Counter block.
558 U2_rdout_err_cnt : entity infrastructure_lib.rdout_err_cnt
559  Port map (
560  rst_320 => rst_320 , -- i/p
561  clk_320 => clk_320 , -- i/p
562  rst_err_cntrs => rst_err_cntrs_i,
563  rst_status_cntrs => rst_status_cntrs_i,
564 -- FIFO errors
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,
570 
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,
576 -- TOB MGT status
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,
582 
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,
588 -- Raw MGT status
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,
593 
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,
598 -- L1A status
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,
602 -- Merging status
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 ,
609 
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,
616 -- MUX status
617  mux_a_pkt_bus => mux_a_pkt_bus_i,
618  mux_b_pkt_bus => mux_b_pkt_bus_i,
619 
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
622  );
623 
624 U3_monitoring_block : entity infrastructure_lib.rdout_monitor
625  Port map (
626  clk_320 => clk_320, -- i/p
627  rst_xoff_cntr => rst_xoff_cntr_i, -- i/p
628  -- BUSY_FIFO_CONTROL
629  tob_fifo_prog_full_thresh_assert => tob_fifo_prog_full_thresh_assert_i, -- i/p
630  tob_fifo_prog_full_thresh_negate => tob_fifo_prog_full_thresh_negate_i, -- i/p
631  raw_fifo_prog_full_thresh_assert => raw_fifo_prog_full_thresh_assert_i, -- i/p
632  raw_fifo_prog_full_thresh_negate => raw_fifo_prog_full_thresh_negate_i, -- i/p
633  -- XOFF_FIFO_CONTROL
634  tob_fifo_xoff_thresh_assert => tob_fifo_xoff_thresh_assert_i, -- i/p
635  tob_fifo_xoff_thresh_negate => tob_fifo_xoff_thresh_negate_i, -- i/p
636  merged_fifo_xoff_thresh_assert => merged_fifo_xoff_thresh_assert_i, -- i/p
637  merged_fifo_xoff_thresh_negate => merged_fifo_xoff_thresh_negate_i, -- i/p
638  raw_fifo_xoff_thresh_assert => raw_fifo_xoff_thresh_assert_i, -- i/p
639  raw_fifo_xoff_thresh_negate => raw_fifo_xoff_thresh_negate_i, -- i/p
640  dbg_fifo_xoff_thresh_assert => dbg_fifo_xoff_thresh_assert_i, -- i/p
641  dbg_fifo_xoff_thresh_negate => dbg_fifo_xoff_thresh_negate_i, -- i/p
642  -- FIFO Fill Levels
643  tob_fifo_fill_level_A_bus => tob_fifo_fill_level_A_bus , -- i/p
644  tob_fifo_fill_level_B_bus => tob_fifo_fill_level_B_bus, -- i/p
645  merged_fifo_fill_level_A_bus => merged_fifo_fill_level_A_bus, -- i/p
646  merged_fifo_fill_level_B_bus => merged_fifo_fill_level_B_bus, -- i/p
647  raw_fifo_fill_level_bus => raw_fifo_fill_level_bus, -- i/p
648 
649  fifo_bc_count => fifo_bc_count_i,
650  tob_busy_cnt_32b_A => tob_busy_cnt_32b_A_i, -- o/p 32-bits
651  tob_xoff_cnt_32b_A => tob_xoff_cnt_32b_A_i, -- o/p 32-bits
652  tob_busy_cnt_32b_B => tob_busy_cnt_32b_B_i, -- o/p 32-bits
653  tob_xoff_cnt_32b_B => tob_xoff_cnt_32b_B_i, -- o/p 32-bits
654  merged_xoff_cnt_32b_A => merged_xoff_cnt_32b_A_i, -- o/p 32-bits
655  merged_xoff_cnt_32b_B => merged_xoff_cnt_32b_B_i, -- o/p 32-bits
656  raw_busy_cnt_32b => raw_busy_cnt_32b_i, -- 32-bits
657  raw_xoff_cnt_32b => raw_xoff_cnt_32b_i, -- 32-bits
658 
659  tob_busy_active_cnt_32b_A => tob_busy_active_cnt_32b_A_i, -- o/p 32-bits
660  tob_busy_active_cnt_32b_B => tob_busy_active_cnt_32b_B_i, -- o/p 32-bits
661  tob_xoff_active_cnt_32b_A => tob_xoff_active_cnt_32b_A_i, -- 32-bits
662  tob_xoff_active_cnt_32b_B => tob_xoff_active_cnt_32b_B_i, -- 32-bits
663  merged_xoff_active_cnt_32b_A => merged_xoff_active_cnt_32b_A_i, -- 32-bits
664  merged_xoff_active_cnt_32b_B => merged_xoff_active_cnt_32b_B_i, -- 32-bits
665  raw_busy_active_cnt_32b => raw_busy_active_cnt_32b_i, -- 32-bits
666  raw_xoff_active_cnt_32b => raw_xoff_active_cnt_32b_i, -- 32-bits
667 
668  tob_busy_assert_cnt_32b_A => tob_busy_assert_cnt_32b_A_i, -- o/p 32-bits
669  tob_busy_assert_cnt_32b_B => tob_busy_assert_cnt_32b_B_i, -- o/p 32-bits
670  tob_xoff_assert_cnt_32b_A => tob_xoff_assert_cnt_32b_A_i, -- 32-bits
671  tob_xoff_assert_cnt_32b_B => tob_xoff_assert_cnt_32b_B_i, -- 32-bits
672  merged_xoff_assert_cnt_32b_A => merged_xoff_assert_cnt_32b_A_i, -- 32-bits
673  merged_xoff_assert_cnt_32b_B => merged_xoff_assert_cnt_32b_B_i, -- 32-bits
674  raw_busy_assert_cnt_32b => raw_busy_assert_cnt_32b_i, -- 32-bits
675  raw_xoff_assert_cnt_32b => raw_xoff_assert_cnt_32b_i, -- 32-bits
676  -- MGT flow control => ,
677  tob_mgt_xoff_bus => tob_mgt_xoff_bus, -- o/p
678  raw_mgt_xoff_bus => raw_mgt_xoff_bus, -- o/p
679  -- BUSY control
680  tob_busy_bus => tob_busy_bus, -- o/p
681  raw_busy_bus => raw_busy_bus, -- o/p
682  -- Pause Control
683  Block_A_pause => Block_A_pause, -- o/p
684  Block_B_pause => Block_B_pause-- o/p
685  );
686 
687 packet_tide_mark_block: entity infrastructure_lib.packet_tide_mark_block
688  generic map(
689  NChannels => 46-- number of signals being monitored
690  )
691  port map (
692  clk_320 => clk_320,
693  rst_status_cntrs => rst_status_cntrs_i,
694 -- ensure correct mapping between instantaneous values and tide mark status registers!
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,
708 
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
722  );
723 
724 END Behavioral;
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.