Skip to content
Snippets Groups Projects
Commit 34d60bde authored by David Gabriel Monk's avatar David Gabriel Monk
Browse files

Added tracking event rate monitor

parent 43d71ad9
No related branches found
No related tags found
1 merge request!34Add functionality for multiple module types in a single image
Pipeline #6173375 failed
......@@ -22,6 +22,7 @@
</node>
<node id="rate_monitoring" address="0x004" fwinfo="endpoint;width=2">
<node id="bx_valid_count" address="0x0"/>
<node id="tracking_event_count" address="0x1"/>
</node>
<node id="monitoring" address="0x008" fwinfo="endpoint;width=3">
<node id="non_empty_count_0" address="0x0"/>
......
......@@ -4,6 +4,7 @@ src fixed_pkg_2008.vhd
src mprocessor_constants.vhd
src ecal_zsf_type_pckg.vhd
src tracking_constants.vhd
src MProcessor.vhd
src LinkAggregatorCore.vhd
......
......@@ -3,6 +3,7 @@ use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_MISC.ALL;
use work.emp_data_types.all;
use work.tracking_constants.all;
use work.ipbus.all;
use work.ipbus_reg_types.all;
......@@ -28,7 +29,7 @@ entity LinkAggregatorCore is
readout_reset : out std_logic := '0';
--- Debug Ports ---
status_bits : out std_logic_vector(15 downto 0);
--- IPBus Ports ---
debug_tracking_event_count : out std_logic_vector(31 downto 0) := (others => '0')
non_empty_counts : out ipb_reg_v(8*N_LINKS - 1 downto 0);
bx_valid_count_out : out ipb_reg_v(0 downto 0)
);
......@@ -129,7 +130,7 @@ architecture compressed of LinkAggregatorCore is
output(31 downto 28) := (others => '0');
return output;
end function;
signal packet_start_buffered : std_logic := '0';
signal output_overflow_array : std_logic_vector(cBoxcarBx - 1 downto 0) := (others => '0');
......@@ -142,6 +143,13 @@ architecture compressed of LinkAggregatorCore is
signal non_empty_fifo_count : ipb_reg_v(8*N_LINKS - 1 downto 0) := (others => (others => '0'));
signal bx_valid_count : ipb_reg_v(0 downto 0) := (others => (others => '0'));
signal pBx_counter : integer := 0;
signal readout_reset_signal : std_logic := '0';
signal track_stubs : tTrackStubs := (others => LWORD_NULL);
signal single_stub_event : std_logic_vector(N_LINKS - 1 downto 0) := (others => '0');
signal event_valid_for_tracking : std_logic := '0';
signal tracking_event_count : unsigned(31 downto 0) := (others => '0');
begin
......@@ -215,7 +223,7 @@ begin
end if;
-- Check for non-empty FIFOs at reset
if reset = '1' then
non_empty_fifo_count(N_LINKS*j + i) <= (others => '0');
non_empty_fifo_count(N_LINKS*j + i) <= (others => '0');
else
if route_reset = '1' then
if empty_route = '0' then
......@@ -241,6 +249,23 @@ begin
end if;
end process pCheckBxValidConditionPerLink;
--==============================--
genTrackingEventCheck : if j = 0 generate
--==============================--
begin
--==============================--
pCheckForTrackingEvent : process(clk_p)
--==============================--
begin
if rising_edge(clk_p) then
if unsigned(count_cache) = 1 then
single_stub_event(i) <= '1';
else
single_stub_event(i) <= '0';
end if;
end if;
end process pCheckForTrackingEvent;
end generate;
-- Enable writing of routing FIFO using the valid flag of the cache FIFO
wr_en_route <= valid_cache;
......@@ -429,9 +454,9 @@ begin
end if;
-- If counter is at the end of a packet, then start to readout the contents of the aggregated FIFOs
if counter = 48 then
readout_reset <= '1';
readout_reset_signal <= '1';
else
readout_reset <= '0';
readout_reset_signal <= '0';
end if;
end if;
end process pReadoutReset;
......@@ -463,6 +488,20 @@ begin
end if;
end if;
end process pCountValidBits;
pExtractTrackingEvent : process(clk_p)
begin
if rising_edge(clk_p) then
event_valid_for_tracking <= and_reduce(single_stub_event);
if readout_reset_signal = '1' and event_valid_for_tracking = '1' then
tracking_event_count <= tracking_event_count + 1;
end if;
end if;
end process pExtractTrackingEvent;
readout_reset <= readout_reset_signal;
--==============================--
-- Debug
......@@ -479,5 +518,6 @@ begin
status_bits(9) <= route_overflow_array(0)(0); -- link_aggregator_route_0_0_overflow;
non_empty_counts <= non_empty_fifo_count;
bx_valid_count_out <= bx_valid_count;
debug_tracking_event_count <= std_logic_vector(tracking_event_count);
end compressed;
......@@ -43,13 +43,15 @@ architecture Behavorial of LinkAggregatorIPBus is
-- signal link_aggregator_status_registers : ipb_reg_v(4 - 1 downto 0) := (others => (others => '0'));
signal control_registers : ipb_reg_v(1 downto 0) := (others => (others => '0'));
signal mprocessor_monitoring_registers : ipb_reg_v(8*N_LINKS - 1 downto 0) := (others => (others => '0'));
signal rate_monitoring_registers : ipb_reg_v(1 - 1 downto 0) := (others => (others => '0'));
signal rate_monitoring_registers : ipb_reg_v(2 - 1 downto 0) := (others => (others => '0'));
signal bx_valid_count : ipb_reg_v(1 - 1 downto 0) := (others => (others => '0'));
signal masked_links : ldata(N_LINKS - 1 downto 0) := (others => LWORD_NULL);
signal thresholds_l : tIntegerArray := (others => 0);
signal thresholds_u : tIntegerArray := (others => 0);
signal tracking_event_count : std_logic_vector(31 downto 0) := (others => '0');
begin
--==============================--
......@@ -107,7 +109,7 @@ begin
--==============================--
generic map(
N_CTRL => 0,
N_STAT => 1
N_STAT => 2
)
port map(
clk => ipb_clk,
......@@ -219,9 +221,11 @@ begin
--- Debug Ports ---
-- status_bits => link_aggregator_status_registers(3)(15 downto 0),
non_empty_counts => mprocessor_monitoring_registers,
bx_valid_count_out => bx_valid_count
bx_valid_count_out => bx_valid_count,
debug_tracking_event_count => tracking_event_count
);
rate_monitoring_registers(0) <= bx_valid_count(0);
rate_monitoring_registers(1) <= tracking_event_count;
end Behavorial;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use work.emp_data_types.all;
package tracking_constants is
type tTrackStubs is array (0 to 5) of lword;
end package tracking_constants;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment