Skip to content

Commit b30d896

Browse files
committed
Merge branch 'marushchenko-feat-netmod-add_better_bcast_support' into 'devel'
A larger set of generated frames from the Hard IP side + fixes See merge request ndk/ndk-fpga!208
2 parents 1d89c3d + 443eb30 commit b30d896

File tree

9 files changed

+63
-14
lines changed

9 files changed

+63
-14
lines changed

comp/nic/mac_lite/rx_mac_lite/comp/mac_check/mac_check.vhd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ begin
224224

225225
mac_cast_err_g : for r in 0 to REGIONS-1 generate
226226
-- Possible multicast error occurence
227-
s_multicast_err(r) <= not s_ext_mac_arr(r)(0);
227+
s_multicast_err(r) <= (not s_ext_mac_arr(r)(0)) or not s_broadcast_err(r);
228228
-- Possible broadcast error occurence
229229
s_broadcast_err(r) <= nand s_ext_mac_arr(r);
230230
end generate;

comp/nic/mac_lite/rx_mac_lite/comp/stat_unit/rx_stat_unit.vhd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ begin
237237
s_reg_in_rfc_below_min <= IN_LEN_BELOW_MIN;
238238
s_reg_in_rfc_over_mtu <= IN_LEN_OVER_MTU;
239239
s_reg_in_rfc_mac_err <= IN_MAC_ERROR;
240-
s_reg_in_rfc_mac_mcast <= IN_MAC_BCAST;
241-
s_reg_in_rfc_mac_bcast <= IN_MAC_MCAST and not IN_MAC_BCAST;
240+
s_reg_in_rfc_mac_mcast <= IN_MAC_MCAST;
241+
s_reg_in_rfc_mac_bcast <= IN_MAC_BCAST;
242242
s_reg_in_rfc_fragment <= IN_CRC_ERROR and s_frame_below_64;
243243
s_reg_in_rfc_jabber <= IN_CRC_ERROR and s_frame_over_1518;
244244
s_reg_in_frame_len <= s_fixed_frame_len;

comp/uvm/packet_generators/sequence_flowtest.sv

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class sequence_flowtest #(int unsigned ITEM_WIDTH) extends uvm_common::sequence_
4040
int unsigned mac_mask_min = 24;
4141
int unsigned mac_mask_max = 48;
4242

43+
bit mac_broadcast = 1;
44+
4345
// Generator options
4446
bit generated_config = 1;
4547
bit generated_profile = 1;
@@ -117,6 +119,9 @@ class sequence_flowtest #(int unsigned ITEM_WIDTH) extends uvm_common::sequence_
117119
mac[i].mask inside { [mac_mask_min : mac_mask_max] };
118120
}
119121
}
122+
constraint c_mac_broadcast {
123+
mac_broadcast -> (mac.sum with (item.address == '1) == 1);
124+
}
120125

121126
rand int unsigned seed;
122127

@@ -172,6 +177,25 @@ class sequence_flowtest #(int unsigned ITEM_WIDTH) extends uvm_common::sequence_
172177
ipv4 = ipv4.unique() with (item.address);
173178
ipv6 = ipv6.unique() with (item.address);
174179
mac = mac .unique() with (item.address);
180+
181+
// Tool doesnt support less address that 2
182+
while (ipv4.size() < 2) begin
183+
ipv4 = new[ipv4.size()+1](ipv4);
184+
std::randomize(ipv4[ipv4.size()-1].address);
185+
std::randomize(ipv4[ipv4.size()-1].mask) with { ipv4[ipv4.size()-1].mask <= 32;};
186+
end
187+
188+
while (ipv6.size() < 2) begin
189+
ipv6 = new[ipv6.size()+1](ipv6);
190+
std::randomize(ipv6[ipv6.size()-1].address);
191+
std::randomize(ipv6[ipv6.size()-1].mask) with { ipv6[ipv6.size()-1].mask <= 128;};
192+
end
193+
194+
while (mac.size() < 2) begin
195+
mac = new[mac.size()+1](mac);
196+
std::randomize(mac[mac.size()-1].address);
197+
std::randomize(mac[mac.size()-1].mask) with { mac[mac.size()-1].mask <= 128;};
198+
end
175199
endfunction
176200

177201
function string get_ipv4_addresses();

core/comp/eth/network_mod/comp/network_mod_core/network_mod_core_cmac.vhd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ architecture CMAC of NETWORK_MOD_CORE is
564564
signal cmac_tx_lbus_sop : std_logic_vector(4-1 downto 0);
565565
signal cmac_tx_lbus_rdy : std_logic;
566566

567+
signal mfb2lbus_rx_mfb_dst_rdy : std_logic;
568+
567569
signal adap_tx_mfb_data : slv_array_t(ETH_PORT_CHAN-1 downto 0)(REGIONS*REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH-1 downto 0);
568570
signal adap_tx_mfb_crc_err : slv_array_t(ETH_PORT_CHAN-1 downto 0)(REGIONS-1 downto 0);
569571
signal adap_tx_mfb_sof_pos : slv_array_t(ETH_PORT_CHAN-1 downto 0)(REGIONS*max(1,log2(REGION_SIZE))-1 downto 0);
@@ -1449,6 +1451,10 @@ begin
14491451
-- ADAPTERS
14501452
-- =========================================================================
14511453

1454+
-- JC: This dump assignment/renaming is necessary here to synchronize
1455+
-- the delta delay (for simulators) between the clock and data signals!
1456+
RX_MFB_DST_RDY(0) <= mfb2lbus_rx_mfb_dst_rdy;
1457+
14521458
mfb2lbus_i : entity work.TX_MAC_LITE_ADAPTER_LBUS
14531459
generic map(
14541460
DEVICE => DEVICE
@@ -1463,7 +1469,7 @@ begin
14631469
IN_MFB_SOF => RX_MFB_SOF(0),
14641470
IN_MFB_EOF => RX_MFB_EOF(0),
14651471
IN_MFB_SRC_RDY => RX_MFB_SRC_RDY(0),
1466-
IN_MFB_DST_RDY => RX_MFB_DST_RDY(0),
1472+
IN_MFB_DST_RDY => mfb2lbus_rx_mfb_dst_rdy,
14671473

14681474
OUT_LBUS_DATA => cmac_tx_lbus_data,
14691475
OUT_LBUS_MTY => cmac_tx_lbus_mty,

core/comp/eth/network_mod/comp/network_mod_core/network_mod_core_etile.vhd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,8 @@ architecture ETILE of NETWORK_MOD_CORE is
523523
signal rx_avst_empty : std_logic_vector(ETH_PORT_CHAN*AVST_EMPTY_WIDTH -1 downto 0);
524524
signal rx_avst_error : std_logic_vector(ETH_PORT_CHAN*RX_AVST_ERROR_WIDTH-1 downto 0);
525525

526+
signal mfb2avst_rx_mfb_dst_rdy : std_logic_vector(ETH_PORT_CHAN-1 downto 0);
527+
526528
signal tx_adap_mfb_clk : std_logic_vector(ETH_PORT_CHAN-1 downto 0) := (others => '0');
527529
signal tx_adap_mfb_data : slv_array_t(ETH_PORT_CHAN-1 downto 0)(REGIONS*REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH-1 downto 0);
528530
signal tx_adap_mfb_crc_err : slv_array_t(ETH_PORT_CHAN-1 downto 0)(REGIONS-1 downto 0);
@@ -1377,6 +1379,10 @@ begin
13771379
mfb2avst_rx_mfb_eof <= RX_MFB_EOF(IT);
13781380
end process;
13791381

1382+
-- JC: This assignment/renaming is necessary here to synchronize
1383+
-- the delta delay (for simulators) between the clock and data signals!
1384+
RX_MFB_DST_RDY(IT) <= mfb2avst_rx_mfb_dst_rdy(IT);
1385+
13801386
-- TX adaption
13811387
mfb2avst_i : entity work.TX_MAC_LITE_ADAPTER_AVST_100G
13821388
generic map(
@@ -1394,7 +1400,7 @@ begin
13941400
RX_MFB_EOF => mfb2avst_rx_mfb_eof,
13951401
RX_MFB_EOF_POS => RX_MFB_EOF_POS(IT),
13961402
RX_MFB_SRC_RDY => RX_MFB_SRC_RDY(IT),
1397-
RX_MFB_DST_RDY => RX_MFB_DST_RDY(IT),
1403+
RX_MFB_DST_RDY => mfb2avst_rx_mfb_dst_rdy(IT),
13981404

13991405
TX_AVST_DATA => tx_ad_avst_data,
14001406
TX_AVST_SOP => tx_ad_avst_sop,

core/comp/eth/network_mod/comp/network_mod_core/network_mod_core_ftile.vhd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ architecture FULL of NETWORK_MOD_CORE is
212212
signal adap_tx_mfb_eof : slv_array_t(ETH_PORT_CHAN-1 downto 0)(REGIONS-1 downto 0);
213213
signal adap_tx_mfb_src_rdy : std_logic_vector(ETH_PORT_CHAN-1 downto 0);
214214

215+
signal adap_rx_mfb_dst_rdy : std_logic_vector(ETH_PORT_CHAN-1 downto 0);
216+
215217
begin
216218

217219
mi_splitter_i : entity work.MI_SPLITTER_PLUS_GEN
@@ -820,13 +822,18 @@ architecture FULL of NETWORK_MOD_CORE is
820822
IN_MFB_EOF_POS => RX_MFB_EOF_POS(i),
821823
IN_MFB_ERROR => (others => '0'),
822824
IN_MFB_SRC_RDY => RX_MFB_SRC_RDY(i),
823-
IN_MFB_DST_RDY => RX_MFB_DST_RDY(i),
825+
IN_MFB_DST_RDY => adap_rx_mfb_dst_rdy(i),
824826
OUT_MAC_DATA => ftile_tx_adapt_data(i),
825827
OUT_MAC_INFRAME => ftile_tx_adapt_inframe(i),
826828
OUT_MAC_EOP_EMPTY => ftile_tx_adapt_eop_empty(i),
827829
OUT_MAC_ERROR => ftile_tx_adapt_error(i),
828830
OUT_MAC_VALID => ftile_tx_adapt_valid(i),
829831
OUT_MAC_READY => ftile_tx_mac_ready(i)
830832
);
833+
834+
-- JC: This dump assignment/renaming is necessary here to synchronize
835+
-- the delta delay (for simulators) between the clock and data signals!
836+
RX_MFB_DST_RDY(i) <= adap_rx_mfb_dst_rdy(i);
837+
831838
end generate;
832839
end architecture;

core/comp/eth/network_mod/network_mod.vhd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ architecture FULL of NETWORK_MOD is
174174
signal tx_mfb_src_rdy_i : slv_array_t (ETH_PORTS-1 downto 0)(ETH_CHANNELS-1 downto 0);
175175
signal tx_mfb_dst_rdy_i : slv_array_t (ETH_PORTS-1 downto 0)(ETH_CHANNELS-1 downto 0);
176176

177+
signal core_rx_mfb_dst_rdy : slv_array_t (ETH_PORTS-1 downto 0)(ETH_CHANNELS-1 downto 0);
178+
177179
-- Control/Status signals
178180
signal sig_activity_rx : slv_array_t(ETH_PORTS-1 downto 0)(ETH_CHANNELS-1 downto 0);
179181
signal sig_activity_tx : slv_array_t(ETH_PORTS-1 downto 0)(ETH_CHANNELS-1 downto 0);
@@ -510,7 +512,7 @@ begin
510512
RX_MFB_SOF => tx_mfb_sof_i (p),
511513
RX_MFB_EOF => tx_mfb_eof_i (p),
512514
RX_MFB_SRC_RDY => tx_mfb_src_rdy_i(p),
513-
RX_MFB_DST_RDY => tx_mfb_dst_rdy_i(p),
515+
RX_MFB_DST_RDY => core_rx_mfb_dst_rdy(p),
514516

515517
RX_MVB_CHANNEL => mvb_ch (p),
516518
RX_MVB_TIMESTAMP => mvb_ts (p),
@@ -574,6 +576,10 @@ begin
574576
rx_mfb_crc_err_i <= core_tx_mfb_crc_err;
575577
rx_mfb_src_rdy_i <= core_tx_mfb_src_rdy;
576578

579+
-- JC: This assignment/renaming is necessary here to synchronize
580+
-- the delta delay (for simulators) between the clock and data signals!
581+
tx_mfb_dst_rdy_i <= core_rx_mfb_dst_rdy;
582+
577583
-- =====================================================================
578584
-- TIMESTAMP synchronization
579585
-- =====================================================================

core/comp/eth/network_mod/uvm/tbench/base/env/model.sv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ class model #(string ETH_CORE_ARCH, int unsigned ETH_PORTS, int unsigned ETH_POR
190190
drop |= error_frame | error_min_tu | error_max_tu | error_crc | error_mac;
191191

192192
case (get_mac_check_mode(index))
193-
2'h1: drop |= ~mac_hit_vld; // ONLY_VALID
194-
2'h2: drop |= ~(mac_hit_vld | broadcast); // VALID_AND_BCAST
195-
2'h3: drop |= ~(mac_hit_vld | multicast); // VALID_AND_MCAST
193+
2'h1: drop |= ~mac_hit_vld; // ONLY_VALID
194+
2'h2: drop |= ~(mac_hit_vld | broadcast); // VALID_AND_BCAST
195+
2'h3: drop |= ~(mac_hit_vld | broadcast | multicast); // VALID_AND_BCAST_AND_MCAST
196196
endcase
197197

198198
msg = $sformatf("\n\thdr input time %s", hdr.time2string());

core/comp/eth/network_mod/uvm/tbench/base/env/sequence_mac_check_configuration.sv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class sequence_mac_check_configuration #(ETH_TX_HDR_WIDTH, ETH_RX_HDR_WIDTH, ITE
1212
localparam int unsigned RX_MAC_COUNT = 16;
1313

1414
typedef enum bit[2-1 : 0] {
15-
ALL_PASS = 2'h0,
16-
ONLY_VALID = 2'h1,
17-
VALID_AND_BCAST = 2'h2,
18-
VALID_AND_MCAST = 2'h3
15+
ALL_PASS = 2'h0,
16+
ONLY_VALID = 2'h1,
17+
VALID_AND_BCAST = 2'h2,
18+
VALID_AND_BCAST_AND_MCAST = 2'h3
1919
} mode_e;
2020

2121
rand mode_e mode;

0 commit comments

Comments
 (0)