Commit 07a29c81 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

adding rmon events in NIC for per-port tx frames

parent 80894325
......@@ -51,7 +51,8 @@ use work.nic_wbgen2_pkg.all;
entity nic_tx_fsm is
generic(
g_port_mask_bits : integer := 32;
g_cyc_on_stall : boolean := false);
g_cyc_on_stall : boolean := false;
g_rmon_events_pp : integer := 1);
port (
clk_sys_i : in std_logic;
rst_n_i : in std_logic;
......@@ -117,7 +118,12 @@ entity nic_tx_fsm is
buf_grant_i : in std_logic;
-- buffer address, data and write enable lines.
buf_addr_o : out std_logic_vector(c_nic_buf_size_log2-3 downto 0);
buf_data_i : in std_logic_vector(31 downto 0)
buf_data_i : in std_logic_vector(31 downto 0);
-------------------------------------------------------------------------------
-- RMON events
-------------------------------------------------------------------------------
rmon_events_o : out std_logic_vector(g_port_mask_bits*g_rmon_events_pp-1 downto 0)
);
end nic_tx_fsm;
......@@ -155,6 +161,7 @@ architecture behavioral of nic_tx_fsm is
signal rtu_valid_int : std_logic;
signal rtu_valid_int_d0 : std_logic;
signal rtu_port_mask : std_logic_vector(g_port_mask_bits-1 downto 0);
signal tx_err : std_logic;
signal default_status_reg : t_wrf_status_reg;
......@@ -182,7 +189,8 @@ begin -- behavioral
txdesc_new_o <= cur_tx_desc;
src_o.stb <= src_stb_int;
--because it's validated with rtu_rsp_valid_o and sw_core stores it to internal register on rtu_rsp_valid strobe
rtu_dst_port_mask_o <= cur_tx_desc.dpm(g_port_mask_bits-1 downto 0);
rtu_port_mask <= cur_tx_desc.dpm(g_port_mask_bits-1 downto 0);
rtu_dst_port_mask_o <= rtu_port_mask;
rtu_prio_o <= (others => '0');
rtu_drop_o <= '0';
......@@ -513,4 +521,10 @@ begin -- behavioral
end if;
end if;
end process;
GEN_RMON: for I in 0 to g_port_mask_bits-1 generate
-- don't need to check if decision is drop, because in NIC, drop is always wired to 0
rmon_events_o(I*g_rmon_events_pp) <= rtu_valid_int and rtu_port_mask(I) and rtu_rsp_ack_i;
end generate;
end behavioral;
......@@ -62,7 +62,8 @@ entity xwrsw_nic is
g_interface_mode : t_wishbone_interface_mode := CLASSIC;
g_address_granularity : t_wishbone_address_granularity := WORD;
g_src_cyc_on_stall : boolean := false;
g_port_mask_bits : integer := 32); --should be num_ports+1
g_port_mask_bits : integer := 32; --should be num_ports+1
g_rmon_events_pp : integer := 1);
port (
clk_sys_i : in std_logic;
rst_n_i : in std_logic;
......@@ -92,7 +93,12 @@ entity xwrsw_nic is
-------------------------------------------------------------------------------
wb_i : in t_wishbone_slave_in;
wb_o : out t_wishbone_slave_out
wb_o : out t_wishbone_slave_out;
-------------------------------------------------------------------------------
-- RMON events
-------------------------------------------------------------------------------
rmon_events_o : out std_logic_vector(g_port_mask_bits*g_rmon_events_pp-1 downto 0)
);
end xwrsw_nic;
......@@ -209,7 +215,8 @@ architecture rtl of xwrsw_nic is
component nic_tx_fsm
generic(
g_port_mask_bits : integer := 32;
g_cyc_on_stall : boolean := false);
g_cyc_on_stall : boolean := false;
g_rmon_events_pp : integer := 1);
port (
clk_sys_i : in std_logic;
rst_n_i : in std_logic;
......@@ -238,7 +245,8 @@ architecture rtl of xwrsw_nic is
bna_i : in std_logic;
buf_grant_i : in std_logic;
buf_addr_o : out std_logic_vector(c_nic_buf_size_log2-3 downto 0);
buf_data_i : in std_logic_vector(31 downto 0));
buf_data_i : in std_logic_vector(31 downto 0);
rmon_events_o : out std_logic_vector(g_port_mask_bits*g_rmon_events_pp-1 downto 0));
end component;
signal rxdesc_request_next : std_logic;
......@@ -542,7 +550,8 @@ begin -- rtl
U_TX_FSM : nic_tx_fsm
generic map(
g_cyc_on_stall => g_src_cyc_on_stall,
g_port_mask_bits => g_port_mask_bits)
g_port_mask_bits => g_port_mask_bits,
g_rmon_events_pp => g_rmon_events_pp)
port map (
clk_sys_i => clk_sys_i,
rst_n_i => nic_reset_n,
......@@ -576,7 +585,8 @@ begin -- rtl
bna_i => tx_bna,
buf_grant_i => mem_grant_tx,
buf_addr_o => mem_addr_tx,
buf_data_i => nic_mem_rd_data);
buf_data_i => nic_mem_rd_data,
rmon_events_o => rmon_events_o);
end rtl;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment