Skip to content
Snippets Groups Projects
Commit cd31c812 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Merge branch 'L2SDP-825' into 'master'

Increase total_block_count in dp_block_validate_err from 32b to 64b MM field.

Closes L2SDP-825

See merge request desp/hdl!282
parents 380e5238 0235c0ae
No related branches found
No related tags found
1 merge request!282Increase total_block_count in dp_block_validate_err from 32b to 64b MM field.
Pipeline #36654 passed
Showing
with 554 additions and 516 deletions
......@@ -426,7 +426,7 @@ peripherals:
- peripheral_name: dp/dp_block_validate_err
peripheral_group: bf
number_of_peripherals: c_N_beamsets
peripheral_span: ceil_pow2(c_lane_nof_err_counts + 3) * MM_BUS_SIZE # number_of_ports = 1, mm_port_span = ceil_pow2(g_nof_err_counts + 3) words
peripheral_span: 16 * MM_BUS_SIZE # number_of_ports = 1, mm_port_span = 16, fixed value can fit c_lane_nof_err_counts <= 16 - 4 = 12
parameter_overrides:
- { name: g_nof_err_counts, value: c_lane_nof_err_counts }
mm_port_names:
......
......@@ -111,7 +111,7 @@ peripherals:
- peripheral_name: dp/dp_block_validate_err
number_of_peripherals: c_nof_lanes
peripheral_span: ceil_pow2(c_nof_err_counts + 3) * MM_BUS_SIZE # number_of_ports = 1, mm_port_span = ceil_pow2(c_nof_err_counts + 3) words
peripheral_span: 16 * MM_BUS_SIZE # number_of_ports = 1, mm_port_span = 16, fixed value can fit c_lane_nof_err_counts <= 16 - 4 = 12
parameter_overrides:
- { name: g_nof_err_counts, value: c_nof_err_counts }
mm_port_names:
......
......@@ -426,7 +426,7 @@ peripherals:
- peripheral_name: dp/dp_block_validate_err
peripheral_group: bf
number_of_peripherals: c_N_beamsets
peripheral_span: ceil_pow2(c_lane_nof_err_counts + 3) * MM_BUS_SIZE # number_of_ports = 1, mm_port_span = ceil_pow2(g_nof_err_counts + 3) words
peripheral_span: 16 * MM_BUS_SIZE # number_of_ports = 1, mm_port_span = 16, fixed value can fit c_lane_nof_err_counts <= 16 - 4 = 12
parameter_overrides:
- { name: g_nof_err_counts, value: c_lane_nof_err_counts }
mm_port_names:
......
......@@ -407,6 +407,12 @@ ARCHITECTURE str OF sdp_station IS
CONSTANT c_lane_payload_nof_longwords_max : NATURAL := largest(c_lane_payload_nof_longwords_xst, c_lane_payload_nof_longwords_bf);
CONSTANT c_lane_packet_nof_longwords_max : NATURAL := c_lane_payload_nof_longwords_max + c_ring_dp_hdr_field_size; -- = 549 + 3 = 552
-- Use large enough c_lane_total_nof_packets_w, so that lane total nof packets count will not overflow:
-- . For low band XST crosslets on ring : L_packet = (P_sq - 1) * f_sub = 8 * 195312.5 = 1.5625 M packets/s,
-- so 2**48 / (1.5625e6 * 3600 * 24 *365.25) = 5.7 years.
-- . Use same value for BF beamlets on ring.
CONSTANT c_lane_total_nof_packets_w : NATURAL := 48; -- <= c_longword_w = 64
CONSTANT c_err_bi : NATURAL := 0;
CONSTANT c_nof_err_counts : NATURAL := 8;
CONSTANT c_bsn_at_sync_check_channel : NATURAL := 1;
......@@ -1172,6 +1178,7 @@ BEGIN
g_lane_direction => 1, -- transport in positive direction.
g_lane_data_w => c_longword_w,
g_lane_packet_length => c_lane_payload_nof_longwords_xst,
g_lane_total_nof_packets_w => c_lane_total_nof_packets_w,
g_use_dp_layer => TRUE,
g_nof_rx_monitors => c_sdp_N_pn_max,
g_nof_tx_monitors => c_sdp_N_pn_max,
......@@ -1223,6 +1230,7 @@ BEGIN
g_lane_direction => 1, -- transport in positive direction.
g_lane_data_w => c_longword_w,
g_lane_packet_length => c_lane_payload_nof_longwords_bf,
g_lane_total_nof_packets_w => c_lane_total_nof_packets_w,
g_use_dp_layer => TRUE,
g_nof_rx_monitors => 1,
g_nof_tx_monitors => 1,
......
......@@ -449,7 +449,7 @@ peripherals:
mm_ports:
- mm_port_name: REG_DP_BLOCK_VALIDATE_ERR
mm_port_type: REG
mm_port_span: ceil_pow2(g_nof_err_counts + 3) * MM_BUS_SIZE
mm_port_span: ceil_pow2(g_nof_err_counts + 1 + 2 + 1) * MM_BUS_SIZE
mm_port_description: ""
fields:
- - field_name: err_count_index
......@@ -464,10 +464,12 @@ peripherals:
- - field_name: total_block_count
field_description: "The total amount of DP blocks that streamed in this dp_block_validate_err."
address_offset: (g_nof_err_counts + 1) * MM_BUS_SIZE # 9 * MM_BUS_SIZE
user_width: 64
radix: uint64
access_mode: RO
- - field_name: clear
field_description: "Read or write this register to clear all counters."
address_offset: (g_nof_err_counts + 2) * MM_BUS_SIZE # 10 * MM_BUS_SIZE
address_offset: (g_nof_err_counts + 3) * MM_BUS_SIZE # 11 * MM_BUS_SIZE
access_mode: RW
......
......@@ -35,6 +35,13 @@
-- result in multiple counters increasing per block. Therefore, it should not be
-- assumed that the sum of the err counters is the total amount of discarded
-- blocks.
-- . The g_cnt_w is used for the err_counts and discarded count, where typically
-- a 32 b value is more than enough, so one MM word, because error blocks do
-- not occur often.
-- . The g_blk_cnt_w is used to count blocks and can have at most 64 b so two
-- MM words, because 32 b can easily be too small to count blocks for hours
-- or longer. The MM map always uses two MM words for total_block_count for
-- any value of g_blk_cnt_w.
-- . g_max/min_block_size indicate the minimum / maximum length of incoming blocks.
-- The ratio of max / min is used to determine a fifo size for the outgoing
-- sosi.valid signals. To minimize logic the g_min_block_size can be set to
......@@ -55,7 +62,8 @@
-- g_nof_err_counts-1 [31..0] RO err_count_index_[g_nof_err_counts-1] 0x0
-- g_nof_err_counts [31..0] RO total_discarded_blocks 0x0
-- g_nof_err_counts+1 [31..0] RO total_block_count 0x0
-- g_nof_err_counts+2 [31..0] RW clear 0x0 read or write to clear counters
-- [63.32]
-- g_nof_err_counts+3 [31..0] RW clear 0x0 read or write to clear counters
-- ====================================================================================
-------------------------------------------------------------------------------
LIBRARY IEEE, common_lib;
......@@ -68,6 +76,7 @@ USE common_lib.common_mem_pkg.ALL;
ENTITY dp_block_validate_err IS
GENERIC (
g_cnt_w : NATURAL := c_word_w; -- max is c_word_w due to mm word width
g_blk_cnt_w : NATURAL := c_longword_w; -- max is c_longword_w due to two mm word width
g_max_block_size : POSITIVE := 250; -- largest possible incoming block size.
g_min_block_size : POSITIVE := 1; -- smallest possible incoming block size.
g_nof_err_counts : NATURAL := 8;
......@@ -103,9 +112,8 @@ END dp_block_validate_err;
ARCHITECTURE rtl OF dp_block_validate_err IS
CONSTANT c_max_cnt : STD_LOGIC_VECTOR(g_cnt_w-1 DOWNTO 0) := (OTHERS => '1');
CONSTANT c_nof_err_ok : NATURAL := ceil_div(g_max_block_size, g_min_block_size);
CONSTANT c_nof_regs : NATURAL := g_nof_err_counts + 3;
CONSTANT c_nof_regs : NATURAL := g_nof_err_counts + 1 + 2 + 1;
CONSTANT c_clear_adr : NATURAL := c_nof_regs-1;
TYPE t_cnt_err_arr IS ARRAY (INTEGER RANGE <>) OF STD_LOGIC_VECTOR(g_cnt_w-1 DOWNTO 0);
......@@ -126,14 +134,14 @@ ARCHITECTURE rtl OF dp_block_validate_err IS
SIGNAL mm_cnt_clr : STD_LOGIC;
SIGNAL cnt_clr : STD_LOGIC;
SIGNAL cnt_blk : STD_LOGIC_VECTOR(g_cnt_w-1 DOWNTO 0);
SIGNAL cnt_blk : STD_LOGIC_VECTOR(g_blk_cnt_w-1 DOWNTO 0);
SIGNAL cnt_blk_en : STD_LOGIC;
SIGNAL cnt_discarded : STD_LOGIC_VECTOR(g_cnt_w-1 DOWNTO 0);
SIGNAL cnt_discarded_en : STD_LOGIC;
SIGNAL cnt_err_arr : t_cnt_err_arr(g_nof_err_counts-1 DOWNTO 0);
SIGNAL cnt_err_en_arr : STD_LOGIC_VECTOR(g_nof_err_counts-1 DOWNTO 0);
SIGNAL hold_cnt_blk : STD_LOGIC_VECTOR(g_cnt_w-1 DOWNTO 0);
SIGNAL hold_cnt_blk : STD_LOGIC_VECTOR(g_blk_cnt_w-1 DOWNTO 0);
SIGNAL hold_cnt_discarded : STD_LOGIC_VECTOR(g_cnt_w-1 DOWNTO 0);
SIGNAL hold_cnt_err_arr : t_cnt_err_arr(g_nof_err_counts-1 DOWNTO 0);
......@@ -172,7 +180,7 @@ BEGIN
cnt_blk_en <= cnt_this_eop;
u_blk_counter : ENTITY common_lib.common_counter
GENERIC MAP (
g_width => g_cnt_w,
g_width => g_blk_cnt_w,
g_clip => TRUE
)
PORT MAP (
......@@ -239,7 +247,14 @@ BEGIN
count_reg((I + 1) * c_word_w - 1 DOWNTO I * c_word_w) <= RESIZE_UVEC(hold_cnt_err_arr(I), c_word_w);
END GENERATE;
count_reg((g_nof_err_counts+1) * c_word_w - 1 DOWNTO g_nof_err_counts * c_word_w ) <= RESIZE_UVEC(hold_cnt_discarded, c_word_w);
count_reg((g_nof_err_counts+2) * c_word_w - 1 DOWNTO (g_nof_err_counts+1) * c_word_w ) <= RESIZE_UVEC(hold_cnt_blk, c_word_w);
gen_blk_cnt_32b : IF g_blk_cnt_w < c_word_w GENERATE
count_reg((g_nof_err_counts+2) * c_word_w - 1 DOWNTO (g_nof_err_counts+1) * c_word_w ) <= RESIZE_UVEC(hold_cnt_blk, c_word_w); -- low part
count_reg((g_nof_err_counts+3) * c_word_w - 1 DOWNTO (g_nof_err_counts+2) * c_word_w ) <= (OTHERS=>'0'); -- high part (not used)
END GENERATE;
gen_blk_cnt_64b : IF g_blk_cnt_w > c_word_w GENERATE
count_reg((g_nof_err_counts+2) * c_word_w - 1 DOWNTO (g_nof_err_counts+1) * c_word_w ) <= hold_cnt_blk(c_word_w-1 DOWNTO 0); -- low part
count_reg((g_nof_err_counts+3) * c_word_w - 1 DOWNTO (g_nof_err_counts+2) * c_word_w ) <= RESIZE_UVEC(hold_cnt_blk(g_blk_cnt_w-1 DOWNTO c_word_w), c_word_w); -- high part
END GENERATE;
u_reg : ENTITY common_lib.common_reg_r_w_dc
GENERIC MAP (
......
......@@ -28,6 +28,9 @@
-- expected values.
-- Usage:
-- . as 5
-- . add wave -position insertpoint \
-- sim:/tb_dp_block_validate_err/c_exp_blk_cnt \
-- sim:/tb_dp_block_validate_err/c_exp_discarded_cnt
-- . run -all
LIBRARY IEEE, common_lib;
......@@ -68,7 +71,7 @@ ARCHITECTURE tb OF tb_dp_block_validate_err IS
CONSTANT c_nof_discarded : NATURAL := c_nof_blk - ceil_div(c_nof_blk, 2**g_nof_err_counts);
CONSTANT c_max_cnt : NATURAL := 2**g_cnt_w -1;
CONSTANT c_mm_addr_dp_clear : NATURAL := g_nof_err_counts+2;
CONSTANT c_mm_addr_dp_clear : NATURAL := g_nof_err_counts+3;
CONSTANT c_mm_addr_dp_blk_cnt : NATURAL := g_nof_err_counts+1;
CONSTANT c_mm_addr_dp_discarded_cnt : NATURAL := g_nof_err_counts;
CONSTANT c_exp_blk_cnt : NATURAL := sel_a_b(c_nof_blk < c_max_cnt, c_nof_blk, c_max_cnt);
......@@ -141,6 +144,7 @@ BEGIN
u_dut : ENTITY work.dp_block_validate_err
GENERIC MAP (
g_cnt_w => g_cnt_w,
g_blk_cnt_w => g_cnt_w,
g_max_block_size => g_max_block_size,
g_nof_err_counts => g_nof_err_counts,
g_data_w => c_word_w,
......
......@@ -45,6 +45,7 @@ ENTITY ring_lane IS
g_lane_direction : NATURAL := 1;
g_lane_data_w : NATURAL := 64;
g_lane_packet_length : NATURAL := 1024;
g_lane_total_nof_packets_w : NATURAL := c_longword_w; -- <= c_longword_w = 64
g_use_dp_layer : BOOLEAN := TRUE;
g_nof_rx_monitors : NATURAL := 0;
g_nof_tx_monitors : NATURAL := 1;
......@@ -116,6 +117,7 @@ BEGIN
GENERIC MAP (
g_use_dp_layer => g_use_dp_layer,
g_lane_direction => g_lane_direction,
g_total_nof_packets_w => g_lane_total_nof_packets_w,
g_data_w => g_lane_data_w,
g_nof_rx_monitors => g_nof_rx_monitors,
g_err_bi => g_err_bi,
......
......@@ -39,6 +39,7 @@ ENTITY ring_rx IS
GENERIC (
g_use_dp_layer : BOOLEAN := TRUE;
g_lane_direction : NATURAL := 1;
g_total_nof_packets_w : NATURAL := 48; -- <= c_longword_w = 64
g_data_w : NATURAL := 64;
g_nof_rx_monitors : NATURAL := 1;
g_err_bi : NATURAL := 0;
......@@ -116,6 +117,8 @@ BEGIN
-- Validate error field
u_dp_block_validate_err : ENTITY dp_lib.dp_block_validate_err
GENERIC MAP (
g_cnt_w => c_word_w, -- <= c_word_w = 32
g_blk_cnt_w => g_total_nof_packets_w, -- <= c_longword_w = 64
g_max_block_size => c_packet_size,
g_min_block_size => c_packet_size,
g_nof_err_counts => g_nof_err_counts,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment