9 use IEEE.STD_LOGIC_1164.
all;
10 use ieee.numeric_std.
all;
13 use ipbus_lib.ipbus.
all;
15 library infrastructure_lib;
22 TOB_FIFO_MAX_ADDR_WIDTH: positive := 12;
32 clk_320 : in std_logic;
44 ipbus_in_tob_mgt_rbus_array : in ipb_rbus_array(3 downto 0);
47 ipbus_in_raw_mgt_rbus_array : in ipb_rbus_array(3 downto 0);
50 ipbus_in_merger_spy_rbus_array : in ipb_rbus_array(1 downto 0);
53 ipbus_in_built_fifo_rbus_array : in ipb_rbus_array(1 downto 0);
57 ecr_320 : in std_logic;
58 readout_delay : out std_logic_vector(31 downto 0);
59 counter_control : out std_logic_vector(31 downto 0);
60 spy_ram_rst_wr_addr : out std_logic_vector (31 downto 0);
61 wraparound_enable : out std_logic_vector(31 downto 0);
65 tob_fifo_prog_full_thresh_negate : out std_logic_vector(15 downto 0);
66 raw_fifo_prog_full_thresh_assert : out std_logic_vector(15 downto 0);
67 raw_fifo_prog_full_thresh_negate : out std_logic_vector(15 downto 0);
71 tob_fifo_XOFF_thresh_negate : out std_logic_vector(15 downto 0);
72 raw_fifo_XOFF_thresh_assert : out std_logic_vector(15 downto 0);
73 raw_fifo_XOFF_thresh_negate : out std_logic_vector(15 downto 0);
74 merged_fifo_XOFF_thresh_assert : out std_logic_vector(15 downto 0);
75 merged_fifo_XOFF_thresh_negate : out std_logic_vector(15 downto 0);
76 dbg_fifo_XOFF_thresh_assert : out std_logic_vector(15 downto 0);
77 dbg_fifo_XOFF_thresh_negate : out std_logic_vector(15 downto 0);
80 tob_mgt_packet_received_cnt_bus : in mgt_data_array(3 downto 0);
81 tob_mgt_safe_mode_cnt_bus : in mgt_data_array(3 downto 0);
82 tob_mgt_packet_err_cnt_bus : in mgt_data_array(3 downto 0);
83 tob_mgt_length_err_cnt_bus : in mgt_data_array(3 downto 0);
84 tob_mgt_bcn_err_cnt_bus : in mgt_data_array(3 downto 0);
85 tob_mgt_last_l1id_bus : in mgt_data_array(3 downto 0);
86 tob_mgt_last_error_l1id_bus : in mgt_data_array(3 downto 0);
87 raw_mgt_packet_received_cnt_bus : in mgt_data_array(3 downto 0);
88 raw_mgt_safe_mode_cnt_bus : in mgt_data_array(3 downto 0);
89 raw_mgt_packet_err_cnt_bus : in mgt_data_array(3 downto 0);
90 raw_mgt_length_err_cnt_bus : in mgt_data_array(3 downto 0);
91 raw_mgt_last_l1id_bus : in mgt_data_array(3 downto 0);
92 raw_mgt_last_error_l1id_bus : in mgt_data_array(3 downto 0);
95 tob_fifo_fill_level_A_bus : in fifo_status_array(3 downto 0);
96 tob_packet_count_A_bus : in fifo_status_array(3 downto 0);
97 tob_fifo_tide_mark_A_bus : in fifo_status_array(3 downto 0);
98 tob_packet_tide_mark_A_bus : in fifo_status_array(3 downto 0);
99 tob_fifo_err_cnt_A_bus : in mgt_data_array(3 downto 0);
100 tob_fifo_fill_level_B_bus : in fifo_status_array(3 downto 0);
101 tob_packet_count_B_bus : in fifo_status_array(3 downto 0);
102 tob_fifo_tide_mark_B_bus : in fifo_status_array(3 downto 0);
103 tob_packet_tide_mark_B_bus : in fifo_status_array(3 downto 0);
104 tob_fifo_err_cnt_B_bus : in mgt_data_array(3 downto 0);
107 merged_fifo_fill_level_A_bus: in fifo_status_array(1 downto 0);
108 merged_packet_count_A_bus : in fifo_status_array(1 downto 0);
109 merged_fifo_tide_mark_A_bus : in fifo_status_array(1 downto 0);
110 merged_packet_tide_mark_A_bus : in fifo_status_array(1 downto 0);
111 merged_fifo_err_cnt_A_bus : in mgt_data_array(1 downto 0);
112 merged_fifo_fill_level_B_bus: in fifo_status_array(1 downto 0);
113 merged_packet_count_B_bus : in fifo_status_array(1 downto 0);
114 merged_fifo_tide_mark_B_bus : in fifo_status_array(1 downto 0);
115 merged_packet_tide_mark_B_bus : in fifo_status_array(1 downto 0);
116 merged_fifo_err_cnt_B_bus : in mgt_data_array(1 downto 0);
119 raw_fifo_fill_level_bus : in fifo_status_array(3 downto 0);
120 raw_packet_count_bus : in fifo_status_array(3 downto 0);
121 raw_fifo_tide_mark_bus : in fifo_status_array(3 downto 0);
122 raw_packet_tide_mark_bus : in fifo_status_array(3 downto 0);
123 raw_fifo_err_cnt_bus : in mgt_data_array(3 downto 0);
126 L1A_cnt_merger_A : in std_logic_vector(31 downto 0);
127 L1A_cnt_merger_B : in std_logic_vector(31 downto 0);
128 Last_L1ID_merger_A : in std_logic_vector(31 downto 0);
129 Last_L1ID_merger_B : in std_logic_vector(31 downto 0);
131 TOB_packet_merged_cnt_A_bus : in mgt_data_array(3 downto 0);
132 TOB_packet_missing_cnt_A_bus : in mgt_data_array(3 downto 0);
133 debug_packet_created_cnt_A_bus : in mgt_data_array(3 downto 0);
134 TOB_packet_merged_cnt_B_bus : in mgt_data_array(3 downto 0);
135 TOB_packet_missing_cnt_B_bus : in mgt_data_array(3 downto 0);
136 debug_packet_created_cnt_B_bus : in mgt_data_array(3 downto 0);
139 mux_orbit_active_bus : in fifo_status_array(1 downto 0);
140 mux_orbit_active_tide_mark_bus : in fifo_status_array(1 downto 0);
141 mux_a_active_bus : in fifo_status_array(5 downto 0);
142 mux_b_active_bus : in fifo_status_array(5 downto 0);
143 mux_a_active_tide_mark_bus : in fifo_status_array(5 downto 0);
144 mux_b_active_tide_mark_bus : in fifo_status_array(5 downto 0);
145 mux_a_pkt_cnt_bus : in mgt_data_array(5 downto 0);
146 mux_b_pkt_cnt_bus : in mgt_data_array(5 downto 0);
147 mux_a_last_l1id_bus : in mgt_data_array(5 downto 0);
148 mux_b_last_l1id_bus : in mgt_data_array(5 downto 0);
151 fifo_bc_count : in std_logic_vector(31 downto 0);
152 tob_busy_cnt_32b_A : in mgt_data_array(3 downto 0);
153 tob_busy_cnt_32b_B : in mgt_data_array(3 downto 0);
154 raw_busy_cnt_32b : in mgt_data_array(3 downto 0);
156 tob_busy_active_cnt_32b_A : in mgt_data_array(3 downto 0);
157 tob_busy_active_cnt_32b_B : in mgt_data_array(3 downto 0);
158 raw_busy_active_cnt_32b : in mgt_data_array(3 downto 0);
160 tob_busy_assert_cnt_32b_A : in mgt_data_array(3 downto 0);
161 tob_busy_assert_cnt_32b_B : in mgt_data_array(3 downto 0);
162 raw_busy_assert_cnt_32b : in mgt_data_array(3 downto 0);
164 tob_xoff_cnt_32b_A : in mgt_data_array(3 downto 0);
165 tob_xoff_cnt_32b_B : in mgt_data_array(3 downto 0);
166 raw_xoff_cnt_32b : in mgt_data_array(3 downto 0);
167 merged_xoff_cnt_32b_A : in mgt_data_array(1 downto 0);
168 merged_xoff_cnt_32b_B : in mgt_data_array(1 downto 0);
170 tob_xoff_active_cnt_32b_A : in mgt_data_array(3 downto 0);
171 tob_xoff_active_cnt_32b_B : in mgt_data_array(3 downto 0);
172 raw_xoff_active_cnt_32b : in mgt_data_array(3 downto 0);
173 merged_xoff_active_cnt_32b_A: in mgt_data_array(1 downto 0);
174 merged_xoff_active_cnt_32b_B: in mgt_data_array(1 downto 0);
176 tob_xoff_assert_cnt_32b_A : in mgt_data_array(3 downto 0);
177 tob_xoff_assert_cnt_32b_B : in mgt_data_array(3 downto 0);
178 raw_xoff_assert_cnt_32b : in mgt_data_array(3 downto 0);
179 merged_xoff_assert_cnt_32b_A: in mgt_data_array(1 downto 0);
180 merged_xoff_assert_cnt_32b_B: in mgt_data_array(1 downto 0)
186 type integer_array is array(natural range <>) of integer range 0 to N_SLAVES;
189 signal ipbw : ipb_wbus_array(N_SLAVES - 1 downto 0);
190 signal ipbr : ipb_rbus_array(N_SLAVES - 1 downto 0);
192 signal update_counter_reg_i : std_logic_vector(31 downto 0);
193 signal update_counter_reg_1, update_counter_reg_2, update_counter_reg_3, update_counter_bcr, update_counter_reg : std_logic;
195 signal tob_fifo_prog_full_thresh_assert_i, tob_fifo_prog_full_thresh_negate_i, raw_fifo_prog_full_thresh_assert_i, raw_fifo_prog_full_thresh_negate_i: std_logic_vector(31 downto 0);
196 signal tob_fifo_xoff_thresh_assert_i, tob_fifo_xoff_thresh_negate_i, merged_fifo_xoff_thresh_assert_i, merged_fifo_xoff_thresh_negate_i: std_logic_vector(31 downto 0);
197 signal raw_fifo_xoff_thresh_assert_i, raw_fifo_xoff_thresh_negate_i, dbg_fifo_xoff_thresh_assert_i, dbg_fifo_xoff_thresh_negate_i: std_logic_vector(31 downto 0);
199 signal mgt_packet_count_bus, mgt_safe_mode_count_bus, mgt_mgt_error_count_bus, mgt_length_error_count_bus, mgt_bcn_error_count_bus, mgt_last_l1id_bus, mgt_bad_l1id_bus: mgt_data_array(7 downto 0);
200 signal fifo_fill_level_bus, fifo_fill_level_watermark_bus, fifo_packet_count_bus, fifo_packet_count_watermark_bus: fifo_status_array(15 downto 0);
201 signal fifo_bc_count_i: std_logic_vector(31 downto 0);
202 signal fifo_xoff_total_count_bus, fifo_xoff_last_count_bus, fifo_xoff_assert_count_bus, fifo_busy_total_count_bus, fifo_busy_last_count_bus, fifo_busy_assert_count_bus, fifo_error_count_bus: mgt_data_array(15 downto 0);
203 signal merger_l1a_count_bus, merger_last_l1id_bus: mgt_data_array(1 downto 0);
204 signal merger_merged_count_bus, merger_missing_count_bus, merger_debug_count_bus: mgt_data_array(7 downto 0);
205 signal mux_orbit_active_bus_i, mux_orbit_active_watermark_bus: fifo_status_array(1 downto 0);
206 signal mux_packet_active_bus, mux_packet_active_watermark_bus: fifo_status_array(11 downto 0);
207 signal mux_packet_count_bus, mux_last_l1id_bus: mgt_data_array(11 downto 0);
209 constant mgt_slv_bus: integer_array(7 downto 0) := (
210 N_SLV_RAW_MGT_STATUS_P3, N_SLV_RAW_MGT_STATUS_P2, N_SLV_RAW_MGT_STATUS_P1, N_SLV_RAW_MGT_STATUS_P0,
211 N_SLV_TOB_MGT_STATUS_P3, N_SLV_TOB_MGT_STATUS_P2, N_SLV_TOB_MGT_STATUS_P1, N_SLV_TOB_MGT_STATUS_P0);
212 constant fifo_slv_bus: integer_array(15 downto 0) := (
213 N_SLV_MERGED_FIFO_STATUS_B_DEBUG, N_SLV_MERGED_FIFO_STATUS_B_TOB, N_SLV_MERGED_FIFO_STATUS_A_DEBUG, N_SLV_MERGED_FIFO_STATUS_A_TOB,
214 N_SLV_RAW_FIFO_STATUS_P3, N_SLV_RAW_FIFO_STATUS_P2, N_SLV_RAW_FIFO_STATUS_P1, N_SLV_RAW_FIFO_STATUS_P0,
215 N_SLV_TOB_FIFO_STATUS_B_P3, N_SLV_TOB_FIFO_STATUS_B_P2, N_SLV_TOB_FIFO_STATUS_B_P1, N_SLV_TOB_FIFO_STATUS_B_P0,
216 N_SLV_TOB_FIFO_STATUS_A_P3, N_SLV_TOB_FIFO_STATUS_A_P2, N_SLV_TOB_FIFO_STATUS_A_P1, N_SLV_TOB_FIFO_STATUS_A_P0);
217 constant merger_status_slv_bus: integer_array(1 downto 0) := (N_SLV_TOB_MERGER_STATUS_B_MERGER, N_SLV_TOB_MERGER_STATUS_A_MERGER);
218 constant merger_slv_bus: integer_array(7 downto 0) := (
219 N_SLV_TOB_MERGER_STATUS_B_P3, N_SLV_TOB_MERGER_STATUS_B_P2, N_SLV_TOB_MERGER_STATUS_B_P1, N_SLV_TOB_MERGER_STATUS_B_P0,
220 N_SLV_TOB_MERGER_STATUS_A_P3, N_SLV_TOB_MERGER_STATUS_A_P2, N_SLV_TOB_MERGER_STATUS_A_P1, N_SLV_TOB_MERGER_STATUS_A_P0);
221 constant mux_active_slv_bus: integer_array(1 downto 0) := (N_SLV_MUX_STATUS_B_MUX_ACTIVE, N_SLV_MUX_STATUS_A_MUX_ACTIVE);
222 constant mux_slv_bus: integer_array(11 downto 0) := (
223 N_SLV_MUX_STATUS_B_RAW_3, N_SLV_MUX_STATUS_B_RAW_2, N_SLV_MUX_STATUS_B_RAW_1, N_SLV_MUX_STATUS_B_RAW_0, N_SLV_MUX_STATUS_B_DEBUG, N_SLV_MUX_STATUS_B_TOB,
224 N_SLV_MUX_STATUS_A_RAW_3, N_SLV_MUX_STATUS_A_RAW_2, N_SLV_MUX_STATUS_A_RAW_1, N_SLV_MUX_STATUS_A_RAW_0, N_SLV_MUX_STATUS_A_DEBUG, N_SLV_MUX_STATUS_A_TOB);
227 constant tob_fifo_default_busy_assert_threshold : std_logic_vector(31 downto 0) := (31 downto TOB_FIFO_MAX_ADDR_WIDTH => '0') & (TOB_FIFO_MAX_ADDR_WIDTH-1 downto PACKET_MAX_WIDTH => '1') & (PACKET_MAX_WIDTH-1 downto 0 => '0');
228 constant tob_fifo_default_busy_negate_threshold : std_logic_vector(31 downto 0) := (31 downto TOB_FIFO_MAX_ADDR_WIDTH => '0') & (TOB_FIFO_MAX_ADDR_WIDTH-1 downto PACKET_MAX_WIDTH+1 => '1') & (PACKET_MAX_WIDTH downto 0 => '0');
231 constant tob_fifo_default_assert_threshold : std_logic_vector(31 downto 0) := (31 downto TOB_FIFO_MAX_ADDR_WIDTH => '0') & (TOB_FIFO_MAX_ADDR_WIDTH-1 downto PACKET_MAX_WIDTH+1 => '1') & (PACKET_MAX_WIDTH downto 0 => '0');
232 constant tob_fifo_default_negate_threshold : std_logic_vector(31 downto 0) := (31 downto TOB_FIFO_MAX_ADDR_WIDTH => '0') & (TOB_FIFO_MAX_ADDR_WIDTH-1 downto PACKET_MAX_WIDTH+2 => '1') & (PACKET_MAX_WIDTH+1 downto 0 => '0');
242 ipbr(N_SLV_TOB_MGT_P0_SPY_RAM) <= ipbus_in_tob_mgt_rbus_array(0);
244 ipbr(N_SLV_TOB_MGT_P1_SPY_RAM) <= ipbus_in_tob_mgt_rbus_array(1);
246 ipbr(N_SLV_TOB_MGT_P2_SPY_RAM) <= ipbus_in_tob_mgt_rbus_array(2);
248 ipbr(N_SLV_TOB_MGT_P3_SPY_RAM) <= ipbus_in_tob_mgt_rbus_array(3);
252 ipbr(N_SLV_RAW_MGT_P0_SPY_RAM) <= ipbus_in_raw_mgt_rbus_array(0);
254 ipbr(N_SLV_RAW_MGT_P1_SPY_RAM) <= ipbus_in_raw_mgt_rbus_array(1);
256 ipbr(N_SLV_RAW_MGT_P2_SPY_RAM) <= ipbus_in_raw_mgt_rbus_array(2);
258 ipbr(N_SLV_RAW_MGT_P3_SPY_RAM) <= ipbus_in_raw_mgt_rbus_array(3);
262 ipbr(N_SLV_TOB_MERGER_A_DEBUG_SPY_RAM) <= ipbus_in_merger_spy_rbus_array(0);
264 ipbr(N_SLV_TOB_MERGER_B_DEBUG_SPY_RAM) <= ipbus_in_merger_spy_rbus_array(1);
268 ipbr(N_SLV_AURORA_CHANNEL0_SPY_RAM) <= ipbus_in_built_fifo_rbus_array(0);
270 ipbr(N_SLV_AURORA_CHANNEL1_SPY_RAM) <= ipbus_in_built_fifo_rbus_array(1);
274 tob_fifo_prog_full_thresh_negate <= tob_fifo_prog_full_thresh_negate_i(15 downto 0);
275 raw_fifo_prog_full_thresh_assert <= raw_fifo_prog_full_thresh_assert_i(15 downto 0);
276 raw_fifo_prog_full_thresh_negate <= raw_fifo_prog_full_thresh_negate_i(15 downto 0);
278 tob_fifo_xoff_thresh_assert <= tob_fifo_xoff_thresh_assert_i(15 downto 0);
279 tob_fifo_xoff_thresh_negate <= tob_fifo_xoff_thresh_negate_i(15 downto 0);
280 merged_fifo_xoff_thresh_assert <= merged_fifo_xoff_thresh_assert_i(15 downto 0);
281 merged_fifo_xoff_thresh_negate <= merged_fifo_xoff_thresh_negate_i(15 downto 0);
282 raw_fifo_xoff_thresh_assert <= raw_fifo_xoff_thresh_assert_i(15 downto 0);
283 raw_fifo_xoff_thresh_negate <= raw_fifo_xoff_thresh_negate_i(15 downto 0);
284 dbg_fifo_xoff_thresh_assert <= dbg_fifo_xoff_thresh_assert_i(15 downto 0);
285 dbg_fifo_xoff_thresh_negate <= dbg_fifo_xoff_thresh_negate_i(15 downto 0);
287 counter_control <= update_counter_reg_i;
289 ipbus_fabric:
entity ipbus_lib.ipbus_fabric_sel
290 generic map(NSLV => N_SLAVES, SEL_WIDTH => IPBUS_SEL_WIDTH
)
294 sel => ipbus_sel_efex_cntrl_data_path
(ipb_in.ipb_addr
),
295 ipb_to_slaves => ipbw,
296 ipb_from_slaves => ipbr
299 control_registers:
entity ipbus_lib.ipbus_ctrlreg_v
300 generic map(N_CTRL =>
4, N_STAT =>
1)
304 ipbus_in => ipbw
(N_SLV_CONTROL
),
305 ipbus_out => ipbr
(N_SLV_CONTROL
),
306 q
(0) => readout_delay,
307 q
(1) => update_counter_reg_i,
308 q
(2) => spy_ram_rst_wr_addr,
309 q
(3) => wraparound_enable,
310 ctrl_default
(0) => x"00000507",
311 ctrl_default
(1) => x"002bd702",
312 ctrl_default
(2) =>
(Others => '0'
),
313 ctrl_default
(3) =>
(Others => '0'
),
314 d
(0) => fifo_bc_count_i,
317 update_counter_bcr_block:
process(clk_320)
318 variable bcr_counter, bcr_match: unsigned(23 downto 0) := (Others => '0');
320 if rising_edge(clk_320) then
321 bcr_match := unsigned(update_counter_reg_i(31 downto 8));
322 if (ecr_320 = '1') then
323 update_counter_bcr <= '0';
324 bcr_counter := (Others => '0');
326 if (bcr_counter >= bcr_match) then
327 update_counter_bcr <= update_counter_reg_i(1);
328 bcr_counter := (Others => '0');
330 update_counter_bcr <= '0';
331 bcr_counter := bcr_counter + 1;
334 update_counter_bcr <= '0';
337 end process update_counter_bcr_block;
339 register_update_control:
process(clk_320)
341 if rising_edge(clk_320) then
342 update_counter_reg_1 <= update_counter_reg_i(0);
343 update_counter_reg_2 <= update_counter_reg_1;
344 update_counter_reg_3 <= update_counter_reg_i(2);
345 if (update_counter_reg_1 = '1' and update_counter_reg_2 = '0') or (update_counter_reg_3 = '1') or (update_counter_bcr = '1') then
346 update_counter_reg <= '1';
348 update_counter_reg <= '0';
351 end process register_update_control;
353 register_update:
process(clk_320)
355 if rising_edge(clk_320) then
356 if update_counter_reg = '1' then
358 mgt_packet_count_bus <= raw_mgt_packet_received_cnt_bus & tob_mgt_packet_received_cnt_bus;
359 mgt_safe_mode_count_bus <= raw_mgt_safe_mode_cnt_bus & tob_mgt_safe_mode_cnt_bus;
360 mgt_mgt_error_count_bus <= raw_mgt_packet_err_cnt_bus & tob_mgt_packet_err_cnt_bus;
361 mgt_length_error_count_bus <= raw_mgt_length_err_cnt_bus & tob_mgt_length_err_cnt_bus;
362 mgt_bcn_error_count_bus(3 downto 0) <= tob_mgt_bcn_err_cnt_bus;
363 mgt_bcn_error_count_bus(7 downto 4) <= (Others => (Others => '0'));
364 mgt_last_l1id_bus <= raw_mgt_last_l1id_bus & tob_mgt_last_l1id_bus;
365 mgt_bad_l1id_bus <= raw_mgt_last_error_l1id_bus & tob_mgt_last_error_l1id_bus;
367 fifo_fill_level_bus <= merged_fifo_fill_level_B_bus & merged_fifo_fill_level_A_bus & raw_fifo_fill_level_bus & tob_fifo_fill_level_B_bus & tob_fifo_fill_level_A_bus;
368 fifo_fill_level_watermark_bus <= merged_fifo_tide_mark_B_bus & merged_fifo_tide_mark_A_bus & raw_fifo_tide_mark_bus & tob_fifo_tide_mark_B_bus & tob_fifo_tide_mark_A_bus;
369 fifo_packet_count_bus <= merged_packet_count_B_bus & merged_packet_count_A_bus & raw_packet_count_bus & tob_packet_count_B_bus & tob_packet_count_A_bus;
370 fifo_packet_count_watermark_bus <= merged_packet_tide_mark_B_bus & merged_packet_tide_mark_A_bus & raw_packet_tide_mark_bus & tob_packet_tide_mark_B_bus & tob_packet_tide_mark_A_bus;
371 fifo_xoff_total_count_bus <= merged_xoff_cnt_32b_B & merged_xoff_cnt_32b_A & raw_xoff_cnt_32b & tob_xoff_cnt_32b_B & tob_xoff_cnt_32b_A;
372 fifo_xoff_last_count_bus <= merged_xoff_active_cnt_32b_B & merged_xoff_active_cnt_32b_A & raw_xoff_active_cnt_32b & tob_xoff_active_cnt_32b_B & tob_xoff_active_cnt_32b_A;
373 fifo_xoff_assert_count_bus <= merged_xoff_assert_cnt_32b_B & merged_xoff_assert_cnt_32b_A & raw_xoff_assert_cnt_32b & tob_xoff_assert_cnt_32b_B & tob_xoff_assert_cnt_32b_A;
374 fifo_busy_total_count_bus(15 downto 12) <= (Others => (Others => '0'));
375 fifo_busy_total_count_bus(11 downto 0) <= raw_busy_cnt_32b & tob_busy_cnt_32b_B & tob_busy_cnt_32b_A;
376 fifo_busy_last_count_bus(15 downto 12) <= (Others => (Others => '0'));
377 fifo_busy_last_count_bus(11 downto 0) <= raw_busy_active_cnt_32b & tob_busy_active_cnt_32b_B & tob_busy_active_cnt_32b_A;
378 fifo_busy_assert_count_bus(15 downto 12) <= (Others => (Others => '0'));
379 fifo_busy_assert_count_bus(11 downto 0) <= raw_busy_assert_cnt_32b & tob_busy_assert_cnt_32b_B & tob_busy_assert_cnt_32b_A;
380 fifo_error_count_bus <= merged_fifo_err_cnt_B_bus & merged_fifo_err_cnt_A_bus & raw_fifo_err_cnt_bus & tob_fifo_err_cnt_B_bus & tob_fifo_err_cnt_A_bus;
382 merger_l1a_count_bus <= L1A_cnt_merger_B & L1A_cnt_merger_A;
383 merger_last_l1id_bus <= Last_L1ID_merger_B & Last_L1ID_merger_A;
384 merger_merged_count_bus <= TOB_packet_merged_cnt_B_bus & TOB_packet_merged_cnt_A_bus;
385 merger_missing_count_bus <= TOB_packet_missing_cnt_B_bus & TOB_packet_missing_cnt_A_bus;
386 merger_debug_count_bus <= debug_packet_created_cnt_B_bus & debug_packet_created_cnt_A_bus;
388 fifo_bc_count_i <= fifo_bc_count;
389 mux_orbit_active_bus_i <= mux_orbit_active_bus;
390 mux_orbit_active_watermark_bus <= mux_orbit_active_tide_mark_bus;
391 mux_packet_active_bus <= mux_b_active_bus & mux_a_active_bus;
392 mux_packet_active_watermark_bus <= mux_b_active_tide_mark_bus & mux_a_active_tide_mark_bus;
393 mux_packet_count_bus <= mux_b_pkt_cnt_bus & mux_a_pkt_cnt_bus;
394 mux_last_l1id_bus <= mux_b_last_l1id_bus & mux_a_last_l1id_bus;
397 end process register_update;
399 mgt_status_generate_block: for i in 0 to 7 generate
400 mgt_status:
entity ipbus_lib.ipbus_ctrlreg_v
401 generic map(N_CTRL =>
0, N_STAT =>
7)
405 ipbus_in => ipbw
(mgt_slv_bus
(i
)),
406 ipbus_out => ipbr
(mgt_slv_bus
(i
)),
407 d
(0) => mgt_packet_count_bus
(i
),
408 d
(1) => mgt_safe_mode_count_bus
(i
),
409 d
(2) => mgt_mgt_error_count_bus
(i
),
410 d
(3) => mgt_length_error_count_bus
(i
),
411 d
(4) => mgt_bcn_error_count_bus
(i
),
412 d
(5) => mgt_last_l1id_bus
(i
),
413 d
(6) => mgt_bad_l1id_bus
(i
),
416 end generate mgt_status_generate_block;
418 fifo_status_generate_block: for i in 0 to 15 generate
419 fifo_status:
entity ipbus_lib.ipbus_ctrlreg_v
420 generic map(N_CTRL =>
0, N_STAT =>
9)
424 ipbus_in => ipbw
(fifo_slv_bus
(i
)),
425 ipbus_out => ipbr
(fifo_slv_bus
(i
)),
426 d
(0)(31 downto 16) => fifo_fill_level_watermark_bus
(i
),
427 d
(0)(15 downto 0) => fifo_fill_level_bus
(i
),
428 d
(1)(31 downto 16) => fifo_packet_count_watermark_bus
(i
),
429 d
(1)(15 downto 0) => fifo_packet_count_bus
(i
),
430 d
(2) => fifo_xoff_total_count_bus
(i
),
431 d
(3) => fifo_xoff_last_count_bus
(i
),
432 d
(4) => fifo_xoff_assert_count_bus
(i
),
433 d
(5) => fifo_busy_total_count_bus
(i
),
434 d
(6) => fifo_busy_last_count_bus
(i
),
435 d
(7) => fifo_busy_assert_count_bus
(i
),
436 d
(8) => fifo_error_count_bus
(i
),
439 end generate fifo_status_generate_block;
441 merger_overall_status_generate_block: for i in 0 to 1 generate
442 merger_overall_status:
entity ipbus_lib.ipbus_ctrlreg_v
443 generic map(N_CTRL =>
0, N_STAT =>
2)
447 ipbus_in => ipbw
(merger_status_slv_bus
(i
)),
448 ipbus_out => ipbr
(merger_status_slv_bus
(i
)),
449 d
(0) => merger_l1a_count_bus
(i
),
450 d
(1) => merger_last_l1id_bus
(i
),
453 end generate merger_overall_status_generate_block;
455 merger_channel_status_generate_block: for i in 0 to 7 generate
456 merger_channel_status:
entity ipbus_lib.ipbus_ctrlreg_v
457 generic map(N_CTRL =>
0, N_STAT =>
3)
461 ipbus_in => ipbw
(merger_slv_bus
(i
)),
462 ipbus_out => ipbr
(merger_slv_bus
(i
)),
463 d
(0) => merger_merged_count_bus
(i
),
464 d
(1) => merger_missing_count_bus
(i
),
465 d
(2) => merger_debug_count_bus
(i
),
468 end generate merger_channel_status_generate_block;
470 mux_orbit_status_generate_block: for i in 0 to 1 generate
471 mux_orbit_status:
entity ipbus_lib.ipbus_ctrlreg_v
472 generic map(N_CTRL =>
0, N_STAT =>
1)
476 ipbus_in => ipbw
(mux_active_slv_bus
(i
)),
477 ipbus_out => ipbr
(mux_active_slv_bus
(i
)),
478 d
(0)(31 downto 16) => mux_orbit_active_watermark_bus
(i
),
479 d
(0)(15 downto 0) => mux_orbit_active_bus_i
(i
),
482 end generate mux_orbit_status_generate_block;
484 mux_channel_status_generate_block: for i in 0 to 11 generate
485 mux_channel_status:
entity ipbus_lib.ipbus_ctrlreg_v
486 generic map(N_CTRL =>
0, N_STAT =>
3)
490 ipbus_in => ipbw
(mux_slv_bus
(i
)),
491 ipbus_out => ipbr
(mux_slv_bus
(i
)),
492 d
(0)(31 downto 16) => mux_packet_active_watermark_bus
(i
),
493 d
(0)(15 downto 0) => mux_packet_active_bus
(i
),
494 d
(1) => mux_packet_count_bus
(i
),
495 d
(2) => mux_last_l1id_bus
(i
),
498 end generate mux_channel_status_generate_block;
500 fifo_control :
entity ipbus_lib.ipbus_ctrlreg_v
501 generic map(N_CTRL =>
12, N_STAT =>
0)
505 ipbus_in => ipbw
(N_SLV_FIFO_CONTROL
),
506 ipbus_out => ipbr
(N_SLV_FIFO_CONTROL
),
507 d =>
(others =>
(others => '0'
)),
508 q
(0) => tob_fifo_prog_full_thresh_assert_i,
509 q
(1) => tob_fifo_prog_full_thresh_negate_i,
510 q
(2) => raw_fifo_prog_full_thresh_assert_i,
511 q
(3) => raw_fifo_prog_full_thresh_negate_i,
512 q
(4) => tob_fifo_xoff_thresh_assert_i,
513 q
(5) => tob_fifo_xoff_thresh_negate_i,
514 q
(6) => raw_fifo_xoff_thresh_assert_i,
515 q
(7) => raw_fifo_xoff_thresh_negate_i,
516 q
(8) => merged_fifo_xoff_thresh_assert_i,
517 q
(9) => merged_fifo_xoff_thresh_negate_i,
518 q
(10) => dbg_fifo_xoff_thresh_assert_i,
519 q
(11) => dbg_fifo_xoff_thresh_negate_i,
520 ctrl_default
(0) => tob_fifo_default_busy_assert_threshold,
521 ctrl_default
(1) => tob_fifo_default_busy_negate_threshold,
522 ctrl_default
(2) => raw_fifo_default_busy_assert_threshold,
523 ctrl_default
(3) => raw_fifo_default_busy_negate_threshold,
524 ctrl_default
(4) => tob_fifo_default_assert_threshold,
525 ctrl_default
(5) => tob_fifo_default_negate_threshold,
526 ctrl_default
(6) => raw_fifo_default_assert_threshold,
527 ctrl_default
(7) => raw_fifo_default_negate_threshold,
528 ctrl_default
(8) => merged_fifo_default_assert_threshold,
529 ctrl_default
(9) => merged_fifo_default_negate_threshold,
530 ctrl_default
(10) => merged_fifo_default_assert_threshold,
531 ctrl_default
(11) => merged_fifo_default_negate_threshold,
Control FPGA data_path slave 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 tob_fifo_XOFF_thresh_assert std_logic_vector( 15 downto 0)
XOFF FIFO partial full flag thresholds.
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.