diff --git a/src/eth/rtl/taxi_eth_mac_10g.f b/src/eth/rtl/taxi_eth_mac_10g.f index 031c807..8fbded5 100644 --- a/src/eth/rtl/taxi_eth_mac_10g.f +++ b/src/eth/rtl/taxi_eth_mac_10g.f @@ -10,6 +10,7 @@ taxi_mac_pause_ctrl_tx.sv taxi_mac_pause_ctrl_rx.sv ../lib/taxi/src/lfsr/rtl/taxi_lfsr.sv ../lib/taxi/src/axis/rtl/taxi_axis_if.sv +../lib/taxi/src/axis/rtl/taxi_axis_pad.sv ../lib/taxi/src/axis/rtl/taxi_axis_null_src.sv ../lib/taxi/src/axis/rtl/taxi_axis_tie.sv ../lib/taxi/src/ptp/rtl/taxi_ptp_td_leaf.sv diff --git a/src/eth/rtl/taxi_eth_mac_10g.sv b/src/eth/rtl/taxi_eth_mac_10g.sv index 23ba70d..9e5c573 100644 --- a/src/eth/rtl/taxi_eth_mac_10g.sv +++ b/src/eth/rtl/taxi_eth_mac_10g.sv @@ -22,9 +22,7 @@ module taxi_eth_mac_10g # parameter logic TX_GBX_IF_EN = 1'b0, parameter logic RX_GBX_IF_EN = TX_GBX_IF_EN, parameter GBX_CNT = 1, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -130,6 +128,7 @@ module taxi_eth_mac_10g # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -172,10 +171,12 @@ module taxi_eth_mac_10g # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic [47:0] cfg_mcf_rx_eth_dst_mcast = 48'h01_80_C2_00_00_01, input wire logic cfg_mcf_rx_check_eth_dst_mcast = 1'b1, @@ -226,8 +227,44 @@ if (KEEP_W*8 != DATA_W || CTRL_W*8 != DATA_W) $fatal(0, "Error: Interface requires byte (8-bit) granularity (instance %m)"); taxi_axis_if #(.DATA_W(DATA_W), .KEEP_W(KEEP_W), .USER_EN(1), .USER_W(TX_USER_W_INT), .ID_EN(1), .ID_W(TX_TAG_W)) axis_tx_int(); +taxi_axis_if #(.DATA_W(DATA_W), .KEEP_W(KEEP_W), .USER_EN(1), .USER_W(TX_USER_W_INT), .ID_EN(1), .ID_W(TX_TAG_W)) axis_tx_pad(); taxi_axis_if #(.DATA_W(DATA_W), .KEEP_W(KEEP_W), .USER_EN(1), .USER_W(RX_USER_W)) axis_rx_int(); +taxi_axis_pad #( + .ID_PAD_REG_EN(1'b0), + .DEST_PAD_REG_EN(1'b0), + .USER_PAD_REG_EN(1'b1), + .MIN_LEN_W(8), + .UNDERFLOW_DROP_EN(1'b1) +) +tx_pad_inst ( + .clk(tx_clk), + .rst(tx_rst), + + /* + * AXI4-Stream input (sink) + */ + .s_axis(axis_tx_int), + + /* + * AXI4-Stream output (source) + */ + .m_axis(axis_tx_pad), + + /* + * Configuration + */ + .cfg_pad_en(cfg_tx_pad_en), + .cfg_min_pkt_len(cfg_tx_min_pkt_len), + + /* + * Status + */ + .stat_pad_frame(stat_tx_pad_frame), + .stat_err_user(), + .stat_err_underflow(stat_tx_err_underflow) +); + // PTP timestamping if (PTP_TS_EN && PTP_TD_EN) begin : ptp @@ -408,9 +445,8 @@ if (DATA_W == 64) begin .CTRL_W(CTRL_W), .GBX_IF_EN(TX_GBX_IF_EN), .GBX_CNT(GBX_CNT), - .PADDING_EN(PADDING_EN), + .PADDING_EN(1'b0), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), .PTP_TS_W(PTP_TS_W), @@ -423,7 +459,7 @@ if (DATA_W == 64) begin /* * Transmit interface (AXI stream) */ - .s_axis_tx(axis_tx_int), + .s_axis_tx(axis_tx_pad), .m_axis_tx_cpl(m_axis_tx_cpl), /* @@ -462,7 +498,7 @@ if (DATA_W == 64) begin .stat_tx_pkt_bad(stat_tx_pkt_bad), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), - .stat_tx_err_underflow(stat_tx_err_underflow) + .stat_tx_err_underflow() ); end else if (DATA_W == 32) begin @@ -530,9 +566,8 @@ end else if (DATA_W == 32) begin .CTRL_W(CTRL_W), .GBX_IF_EN(TX_GBX_IF_EN), .GBX_CNT(GBX_CNT), - .PADDING_EN(PADDING_EN), + .PADDING_EN(1'b0), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .TX_CPL_CTRL_IN_TUSER(MAC_CTRL_EN) @@ -544,7 +579,7 @@ end else if (DATA_W == 32) begin /* * Transmit interface (AXI stream) */ - .s_axis_tx(axis_tx_int), + .s_axis_tx(axis_tx_pad), .m_axis_tx_cpl(m_axis_tx_cpl), /* @@ -583,7 +618,7 @@ end else if (DATA_W == 32) begin .stat_tx_pkt_bad(stat_tx_pkt_bad), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), - .stat_tx_err_underflow(stat_tx_err_underflow) + .stat_tx_err_underflow() ); assign tx_start_packet[1] = 1'b0; diff --git a/src/eth/rtl/taxi_eth_mac_10g_fifo.sv b/src/eth/rtl/taxi_eth_mac_10g_fifo.sv index 4c23cf6..591619c 100644 --- a/src/eth/rtl/taxi_eth_mac_10g_fifo.sv +++ b/src/eth/rtl/taxi_eth_mac_10g_fifo.sv @@ -22,9 +22,7 @@ module taxi_eth_mac_10g_fifo # parameter logic TX_GBX_IF_EN = 1'b0, parameter logic RX_GBX_IF_EN = TX_GBX_IF_EN, parameter GBX_CNT = 1, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -122,10 +120,12 @@ module taxi_eth_mac_10g_fifo # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1 ); @@ -267,9 +267,7 @@ taxi_eth_mac_10g #( .TX_GBX_IF_EN(TX_GBX_IF_EN), .RX_GBX_IF_EN(RX_GBX_IF_EN), .GBX_CNT(GBX_CNT), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -375,6 +373,7 @@ eth_mac_10g_inst ( .stat_tx_pkt_vlan(), .stat_tx_pkt_good(), .stat_tx_pkt_bad(), + .stat_tx_pad_frame(), .stat_tx_err_oversize(), .stat_tx_err_user(), .stat_tx_err_underflow(tx_error_underflow_int), @@ -417,6 +416,8 @@ eth_mac_10g_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_1g.f b/src/eth/rtl/taxi_eth_mac_1g.f index 87a723e..e25df04 100644 --- a/src/eth/rtl/taxi_eth_mac_1g.f +++ b/src/eth/rtl/taxi_eth_mac_1g.f @@ -8,6 +8,7 @@ taxi_mac_pause_ctrl_tx.sv taxi_mac_pause_ctrl_rx.sv ../lib/taxi/src/lfsr/rtl/taxi_lfsr.sv ../lib/taxi/src/axis/rtl/taxi_axis_if.sv +../lib/taxi/src/axis/rtl/taxi_axis_pad.sv ../lib/taxi/src/axis/rtl/taxi_axis_null_src.sv ../lib/taxi/src/axis/rtl/taxi_axis_tie.sv ../lib/taxi/src/sync/rtl/taxi_sync_signal.sv diff --git a/src/eth/rtl/taxi_eth_mac_1g.sv b/src/eth/rtl/taxi_eth_mac_1g.sv index 629d120..6e8cc73 100644 --- a/src/eth/rtl/taxi_eth_mac_1g.sv +++ b/src/eth/rtl/taxi_eth_mac_1g.sv @@ -18,8 +18,6 @@ Authors: module taxi_eth_mac_1g # ( parameter DATA_W = 8, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter logic PFC_EN = 1'b0, @@ -117,6 +115,7 @@ module taxi_eth_mac_1g # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -159,10 +158,12 @@ module taxi_eth_mac_1g # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic [47:0] cfg_mcf_rx_eth_dst_mcast = 48'h01_80_C2_00_00_01, input wire logic cfg_mcf_rx_check_eth_dst_mcast = 1'b1, @@ -205,8 +206,44 @@ localparam MAC_CTRL_EN = PAUSE_EN || PFC_EN; localparam TX_USER_W_INT = (MAC_CTRL_EN ? 1 : 0) + TX_USER_W; taxi_axis_if #(.DATA_W(DATA_W), .USER_EN(1), .USER_W(TX_USER_W_INT), .ID_EN(1), .ID_W(TX_TAG_W)) axis_tx_int(); +taxi_axis_if #(.DATA_W(DATA_W), .USER_EN(1), .USER_W(TX_USER_W_INT), .ID_EN(1), .ID_W(TX_TAG_W)) axis_tx_pad(); taxi_axis_if #(.DATA_W(DATA_W), .USER_EN(1), .USER_W(RX_USER_W)) axis_rx_int(); +taxi_axis_pad #( + .ID_PAD_REG_EN(1'b0), + .DEST_PAD_REG_EN(1'b0), + .USER_PAD_REG_EN(1'b1), + .MIN_LEN_W(8), + .UNDERFLOW_DROP_EN(1'b1) +) +tx_pad_inst ( + .clk(tx_clk), + .rst(tx_rst), + + /* + * AXI4-Stream input (sink) + */ + .s_axis(axis_tx_int), + + /* + * AXI4-Stream output (source) + */ + .m_axis(axis_tx_pad), + + /* + * Configuration + */ + .cfg_pad_en(cfg_tx_pad_en), + .cfg_min_pkt_len(cfg_tx_min_pkt_len), + + /* + * Status + */ + .stat_pad_frame(stat_tx_pad_frame), + .stat_err_user(), + .stat_err_underflow(stat_tx_err_underflow) +); + taxi_axis_gmii_rx #( .DATA_W(DATA_W), .PTP_TS_EN(PTP_TS_EN), @@ -268,8 +305,7 @@ axis_gmii_rx_inst ( taxi_axis_gmii_tx #( .DATA_W(DATA_W), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), + .PADDING_EN(1'b0), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .TX_CPL_CTRL_IN_TUSER(MAC_CTRL_EN) @@ -281,7 +317,7 @@ axis_gmii_tx_inst ( /* * Transmit interface (AXI stream) */ - .s_axis_tx(axis_tx_int), + .s_axis_tx(axis_tx_pad), .m_axis_tx_cpl(m_axis_tx_cpl), /* @@ -323,7 +359,7 @@ axis_gmii_tx_inst ( .stat_tx_pkt_bad(stat_tx_pkt_bad), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), - .stat_tx_err_underflow(stat_tx_err_underflow) + .stat_tx_err_underflow() ); if (STAT_EN) begin : stats diff --git a/src/eth/rtl/taxi_eth_mac_1g_fifo.sv b/src/eth/rtl/taxi_eth_mac_1g_fifo.sv index 29df041..1a976b4 100644 --- a/src/eth/rtl/taxi_eth_mac_1g_fifo.sv +++ b/src/eth/rtl/taxi_eth_mac_1g_fifo.sv @@ -18,8 +18,6 @@ Authors: module taxi_eth_mac_1g_fifo # ( parameter DATA_W = 8, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic STAT_EN = 1'b0, parameter STAT_TX_LEVEL = 1, parameter STAT_RX_LEVEL = STAT_TX_LEVEL, @@ -101,10 +99,12 @@ module taxi_eth_mac_1g_fifo # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1 ); @@ -184,8 +184,6 @@ wire stat_rx_fifo_drop; taxi_eth_mac_1g #( .DATA_W(DATA_W), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(1'b0), .PFC_EN(1'b0), .PAUSE_EN(1'b0), @@ -283,6 +281,7 @@ eth_mac_1g_inst ( .stat_tx_pkt_vlan(), .stat_tx_pkt_good(), .stat_tx_pkt_bad(), + .stat_tx_pad_frame(), .stat_tx_err_oversize(), .stat_tx_err_user(), .stat_tx_err_underflow(tx_error_underflow_int), @@ -325,6 +324,8 @@ eth_mac_1g_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_1g_gmii.sv b/src/eth/rtl/taxi_eth_mac_1g_gmii.sv index 5cbc30a..06e78c5 100644 --- a/src/eth/rtl/taxi_eth_mac_1g_gmii.sv +++ b/src/eth/rtl/taxi_eth_mac_1g_gmii.sv @@ -20,8 +20,6 @@ module taxi_eth_mac_1g_gmii # parameter logic SIM = 1'b0, parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter logic PFC_EN = 1'b0, @@ -116,6 +114,7 @@ module taxi_eth_mac_1g_gmii # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -159,10 +158,12 @@ module taxi_eth_mac_1g_gmii # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic [47:0] cfg_mcf_rx_eth_dst_mcast = 48'h01_80_C2_00_00_01, input wire logic cfg_mcf_rx_check_eth_dst_mcast = 1'b1, @@ -269,8 +270,6 @@ gmii_phy_if_inst ( taxi_eth_mac_1g #( .DATA_W(8), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .PFC_EN(PFC_EN), @@ -368,6 +367,7 @@ eth_mac_1g_inst ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -410,6 +410,8 @@ eth_mac_1g_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_1g_gmii_fifo.sv b/src/eth/rtl/taxi_eth_mac_1g_gmii_fifo.sv index ca44751..3d48e61 100644 --- a/src/eth/rtl/taxi_eth_mac_1g_gmii_fifo.sv +++ b/src/eth/rtl/taxi_eth_mac_1g_gmii_fifo.sv @@ -20,8 +20,6 @@ module taxi_eth_mac_1g_gmii_fifo # parameter logic SIM = 1'b0, parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic STAT_EN = 1'b0, parameter STAT_TX_LEVEL = 1, parameter STAT_RX_LEVEL = STAT_TX_LEVEL, @@ -97,10 +95,12 @@ module taxi_eth_mac_1g_gmii_fifo # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1 ); @@ -199,8 +199,6 @@ taxi_eth_mac_1g_gmii #( .SIM(SIM), .VENDOR(VENDOR), .FAMILY(FAMILY), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(1'b0), .PFC_EN(1'b0), .PAUSE_EN(1'b0), @@ -295,6 +293,7 @@ eth_mac_1g_gmii_inst ( .stat_tx_pkt_vlan(), .stat_tx_pkt_good(), .stat_tx_pkt_bad(), + .stat_tx_pad_frame(), .stat_tx_err_oversize(), .stat_tx_err_user(), .stat_tx_err_underflow(tx_error_underflow_int), @@ -338,6 +337,8 @@ eth_mac_1g_gmii_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_1g_rgmii.sv b/src/eth/rtl/taxi_eth_mac_1g_rgmii.sv index 45d9335..15fb7fa 100644 --- a/src/eth/rtl/taxi_eth_mac_1g_rgmii.sv +++ b/src/eth/rtl/taxi_eth_mac_1g_rgmii.sv @@ -21,8 +21,6 @@ module taxi_eth_mac_1g_rgmii # parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", parameter logic USE_CLK90 = 1'b1, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter logic PFC_EN = 1'b0, @@ -115,6 +113,7 @@ module taxi_eth_mac_1g_rgmii # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -158,10 +157,12 @@ module taxi_eth_mac_1g_rgmii # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic [47:0] cfg_mcf_rx_eth_dst_mcast = 48'h01_80_C2_00_00_01, input wire logic cfg_mcf_rx_check_eth_dst_mcast = 1'b1, @@ -269,8 +270,6 @@ rgmii_phy_if_inst ( taxi_eth_mac_1g #( .DATA_W(8), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .PFC_EN(PFC_EN), @@ -368,6 +367,7 @@ eth_mac_1g_inst ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -410,6 +410,8 @@ eth_mac_1g_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_1g_rgmii_fifo.sv b/src/eth/rtl/taxi_eth_mac_1g_rgmii_fifo.sv index 1c76c33..2ff9147 100644 --- a/src/eth/rtl/taxi_eth_mac_1g_rgmii_fifo.sv +++ b/src/eth/rtl/taxi_eth_mac_1g_rgmii_fifo.sv @@ -21,8 +21,6 @@ module taxi_eth_mac_1g_rgmii_fifo # parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", parameter logic USE_CLK90 = 1'b1, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic STAT_EN = 1'b0, parameter STAT_TX_LEVEL = 1, parameter STAT_RX_LEVEL = STAT_TX_LEVEL, @@ -96,10 +94,12 @@ module taxi_eth_mac_1g_rgmii_fifo # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1 ); @@ -199,8 +199,6 @@ taxi_eth_mac_1g_rgmii #( .VENDOR(VENDOR), .FAMILY(FAMILY), .USE_CLK90(USE_CLK90), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(1'b0), .PFC_EN(1'b0), .PAUSE_EN(1'b0), @@ -293,6 +291,7 @@ eth_mac_1g_rgmii_inst ( .stat_tx_pkt_vlan(), .stat_tx_pkt_good(), .stat_tx_pkt_bad(), + .stat_tx_pad_frame(), .stat_tx_err_oversize(), .stat_tx_err_user(), .stat_tx_err_underflow(tx_error_underflow_int), @@ -336,6 +335,8 @@ eth_mac_1g_rgmii_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_mii.sv b/src/eth/rtl/taxi_eth_mac_mii.sv index 020d3f2..20d4080 100644 --- a/src/eth/rtl/taxi_eth_mac_mii.sv +++ b/src/eth/rtl/taxi_eth_mac_mii.sv @@ -20,8 +20,6 @@ module taxi_eth_mac_mii # parameter logic SIM = 1'b0, parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter logic PFC_EN = 1'b0, @@ -114,6 +112,7 @@ module taxi_eth_mac_mii # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -156,10 +155,12 @@ module taxi_eth_mac_mii # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic [47:0] cfg_mcf_rx_eth_dst_mcast = 48'h01_80_C2_00_00_01, input wire logic cfg_mcf_rx_check_eth_dst_mcast = 1'b1, @@ -240,8 +241,6 @@ assign mac_gmii_rxd[7:4] = '0; taxi_eth_mac_1g #( .DATA_W(8), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .PFC_EN(PFC_EN), @@ -339,6 +338,7 @@ eth_mac_1g_inst ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -381,6 +381,8 @@ eth_mac_1g_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_mii_fifo.sv b/src/eth/rtl/taxi_eth_mac_mii_fifo.sv index f2ffe2e..bb61c4f 100644 --- a/src/eth/rtl/taxi_eth_mac_mii_fifo.sv +++ b/src/eth/rtl/taxi_eth_mac_mii_fifo.sv @@ -94,10 +94,12 @@ module taxi_eth_mac_mii_fifo # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1 ); @@ -184,8 +186,6 @@ taxi_eth_mac_mii #( .SIM(SIM), .VENDOR(VENDOR), .FAMILY(FAMILY), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(1'b0), .PFC_EN(1'b0), .PAUSE_EN(1'b0), @@ -278,6 +278,7 @@ eth_mac_mii_inst ( .stat_tx_pkt_vlan(), .stat_tx_pkt_good(), .stat_tx_pkt_bad(), + .stat_tx_pad_frame(), .stat_tx_err_oversize(), .stat_tx_err_user(), .stat_tx_err_underflow(tx_error_underflow_int), @@ -320,6 +321,8 @@ eth_mac_mii_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_phy_10g.sv b/src/eth/rtl/taxi_eth_mac_phy_10g.sv index 010a122..114cc7e 100644 --- a/src/eth/rtl/taxi_eth_mac_phy_10g.sv +++ b/src/eth/rtl/taxi_eth_mac_phy_10g.sv @@ -21,9 +21,7 @@ module taxi_eth_mac_phy_10g # parameter HDR_W = (DATA_W/32), parameter logic TX_GBX_IF_EN = 1'b0, parameter logic RX_GBX_IF_EN = TX_GBX_IF_EN, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -141,6 +139,7 @@ module taxi_eth_mac_phy_10g # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -187,10 +186,12 @@ module taxi_eth_mac_phy_10g # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic cfg_tx_prbs31_enable = 1'b0, input wire logic cfg_rx_prbs31_enable = 1'b0, @@ -430,9 +431,7 @@ taxi_eth_mac_phy_10g_tx #( .DATA_W(DATA_W), .HDR_W(HDR_W), .GBX_IF_EN(TX_GBX_IF_EN), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), .PTP_TS_W(PTP_TS_W), @@ -480,6 +479,7 @@ eth_mac_phy_10g_tx_inst ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -487,6 +487,8 @@ eth_mac_phy_10g_tx_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_phy_10g_fifo.sv b/src/eth/rtl/taxi_eth_mac_phy_10g_fifo.sv index c5f5757..c363582 100644 --- a/src/eth/rtl/taxi_eth_mac_phy_10g_fifo.sv +++ b/src/eth/rtl/taxi_eth_mac_phy_10g_fifo.sv @@ -138,10 +138,12 @@ module taxi_eth_mac_phy_10g_fifo # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic cfg_tx_prbs31_enable = 1'b0, input wire logic cfg_rx_prbs31_enable = 1'b0 @@ -300,9 +302,7 @@ taxi_eth_mac_phy_10g #( .HDR_W(HDR_W), .TX_GBX_IF_EN(TX_GBX_IF_EN), .RX_GBX_IF_EN(RX_GBX_IF_EN), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -418,6 +418,7 @@ eth_mac_phy_10g_inst ( .stat_tx_pkt_vlan(), .stat_tx_pkt_good(), .stat_tx_pkt_bad(), + .stat_tx_pad_frame(), .stat_tx_err_oversize(), .stat_tx_err_user(), .stat_tx_err_underflow(tx_error_underflow_int), @@ -464,6 +465,8 @@ eth_mac_phy_10g_inst ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/rtl/taxi_eth_mac_phy_10g_rx.sv b/src/eth/rtl/taxi_eth_mac_phy_10g_rx.sv index d319a9c..6386b2b 100644 --- a/src/eth/rtl/taxi_eth_mac_phy_10g_rx.sv +++ b/src/eth/rtl/taxi_eth_mac_phy_10g_rx.sv @@ -82,7 +82,7 @@ module taxi_eth_mac_phy_10g_rx # /* * Configuration */ - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable, input wire logic cfg_rx_prbs31_enable ); diff --git a/src/eth/rtl/taxi_eth_mac_phy_10g_tx.f b/src/eth/rtl/taxi_eth_mac_phy_10g_tx.f index 671f31f..152a06d 100644 --- a/src/eth/rtl/taxi_eth_mac_phy_10g_tx.f +++ b/src/eth/rtl/taxi_eth_mac_phy_10g_tx.f @@ -4,3 +4,4 @@ taxi_axis_baser_tx_32.sv taxi_axis_baser_tx_64.sv ../lib/taxi/src/lfsr/rtl/taxi_lfsr.sv ../lib/taxi/src/axis/rtl/taxi_axis_if.sv +../lib/taxi/src/axis/rtl/taxi_axis_pad.sv diff --git a/src/eth/rtl/taxi_eth_mac_phy_10g_tx.sv b/src/eth/rtl/taxi_eth_mac_phy_10g_tx.sv index f2e4d49..679cc92 100644 --- a/src/eth/rtl/taxi_eth_mac_phy_10g_tx.sv +++ b/src/eth/rtl/taxi_eth_mac_phy_10g_tx.sv @@ -20,9 +20,7 @@ module taxi_eth_mac_phy_10g_tx # parameter DATA_W = 64, parameter HDR_W = (DATA_W/32), parameter logic GBX_IF_EN = 1'b0, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TS_FMT_TOD = 1'b1, parameter PTP_TS_W = PTP_TS_FMT_TOD ? 96 : 64, @@ -70,6 +68,7 @@ module taxi_eth_mac_phy_10g_tx # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -77,12 +76,17 @@ module taxi_eth_mac_phy_10g_tx # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable, input wire logic cfg_tx_prbs31_enable ); +localparam TX_USER_W = s_axis_tx.USER_W; +localparam TX_TAG_W = s_axis_tx.ID_W; + wire [DATA_W-1:0] encoded_tx_data; wire encoded_tx_data_valid; wire [HDR_W-1:0] encoded_tx_hdr; @@ -92,6 +96,43 @@ wire tx_gbx_req_sync; wire tx_gbx_req_stall; wire tx_gbx_sync; +taxi_axis_if #(.DATA_W(DATA_W), .USER_EN(1), .USER_W(TX_USER_W), .ID_EN(1), .ID_W(TX_TAG_W)) axis_tx_pad(); + +taxi_axis_pad #( + .ID_PAD_REG_EN(1'b0), + .DEST_PAD_REG_EN(1'b0), + .USER_PAD_REG_EN(1'b1), + .MIN_LEN_W(8), + .UNDERFLOW_DROP_EN(1'b1) +) +tx_pad_inst ( + .clk(clk), + .rst(rst), + + /* + * AXI4-Stream input (sink) + */ + .s_axis(s_axis_tx), + + /* + * AXI4-Stream output (source) + */ + .m_axis(axis_tx_pad), + + /* + * Configuration + */ + .cfg_pad_en(cfg_tx_pad_en), + .cfg_min_pkt_len(cfg_tx_min_pkt_len), + + /* + * Status + */ + .stat_pad_frame(stat_tx_pad_frame), + .stat_err_user(), + .stat_err_underflow(stat_tx_err_underflow) +); + if (DATA_W == 64) begin taxi_axis_baser_tx_64 #( @@ -99,9 +140,8 @@ if (DATA_W == 64) begin .HDR_W(HDR_W), .GBX_IF_EN(GBX_IF_EN), .GBX_CNT(1), - .PADDING_EN(PADDING_EN), + .PADDING_EN(1'b0), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), .PTP_TS_W(PTP_TS_W), @@ -114,7 +154,7 @@ if (DATA_W == 64) begin /* * Transmit interface (AXI stream) */ - .s_axis_tx(s_axis_tx), + .s_axis_tx(axis_tx_pad), .m_axis_tx_cpl(m_axis_tx_cpl), /* @@ -154,7 +194,7 @@ if (DATA_W == 64) begin .stat_tx_pkt_bad(stat_tx_pkt_bad), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), - .stat_tx_err_underflow(stat_tx_err_underflow) + .stat_tx_err_underflow() ); end else begin @@ -164,9 +204,8 @@ end else begin .HDR_W(HDR_W), .GBX_IF_EN(GBX_IF_EN), .GBX_CNT(1), - .PADDING_EN(PADDING_EN), + .PADDING_EN(1'b0), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .TX_CPL_CTRL_IN_TUSER(TX_CPL_CTRL_IN_TUSER) @@ -178,7 +217,7 @@ end else begin /* * Transmit interface (AXI stream) */ - .s_axis_tx(s_axis_tx), + .s_axis_tx(axis_tx_pad), .m_axis_tx_cpl(m_axis_tx_cpl), /* @@ -218,7 +257,7 @@ end else begin .stat_tx_pkt_bad(stat_tx_pkt_bad), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), - .stat_tx_err_underflow(stat_tx_err_underflow) + .stat_tx_err_underflow() ); assign tx_start_packet[1] = 1'b0; diff --git a/src/eth/rtl/us/taxi_eth_mac_25g_us.sv b/src/eth/rtl/us/taxi_eth_mac_25g_us.sv index 0d3fce8..db1469c 100644 --- a/src/eth/rtl/us/taxi_eth_mac_25g_us.sv +++ b/src/eth/rtl/us/taxi_eth_mac_25g_us.sv @@ -54,9 +54,7 @@ module taxi_eth_mac_25g_us # // MAC/PHY parameters parameter logic COMBINED_MAC_PCS = 1'b1, parameter DATA_W = 64, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -195,6 +193,7 @@ module taxi_eth_mac_25g_us # output wire logic stat_tx_pkt_vlan[CNT], output wire logic stat_tx_pkt_good[CNT], output wire logic stat_tx_pkt_bad[CNT], + output wire logic stat_tx_pad_frame[CNT], output wire logic stat_tx_err_oversize[CNT], output wire logic stat_tx_err_user[CNT], output wire logic stat_tx_err_underflow[CNT], @@ -241,10 +240,12 @@ module taxi_eth_mac_25g_us # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len[CNT] = '{CNT{16'd1518}}, + input wire logic cfg_tx_pad_en[CNT] = '{CNT{1'b1}}, + input wire logic [7:0] cfg_tx_min_pkt_len[CNT] = '{CNT{8'd60-1}}, + input wire logic [15:0] cfg_tx_max_pkt_len[CNT] = '{CNT{16'd1518-1}}, input wire logic [7:0] cfg_tx_ifg[CNT] = '{CNT{8'd12}}, input wire logic cfg_tx_enable[CNT] = '{CNT{1'b1}}, - input wire logic [15:0] cfg_rx_max_pkt_len[CNT] = '{CNT{16'd1518}}, + input wire logic [15:0] cfg_rx_max_pkt_len[CNT] = '{CNT{16'd1518-1}}, input wire logic cfg_rx_enable[CNT] = '{CNT{1'b1}}, input wire logic [7:0] cfg_ifg[CNT] = '{CNT{8'd12}}, input wire logic cfg_tx_prbs31_enable[CNT] = '{CNT{1'b0}}, @@ -425,9 +426,7 @@ for (genvar n = 0; n < CNT; n = n + 1) begin : ch // MAC/PHY parameters .COMBINED_MAC_PCS(COMBINED_MAC_PCS), .DATA_W(DATA_W), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -580,6 +579,7 @@ for (genvar n = 0; n < CNT; n = n + 1) begin : ch .stat_tx_pkt_vlan(stat_tx_pkt_vlan[n]), .stat_tx_pkt_good(stat_tx_pkt_good[n]), .stat_tx_pkt_bad(stat_tx_pkt_bad[n]), + .stat_tx_pad_frame(stat_tx_pad_frame[n]), .stat_tx_err_oversize(stat_tx_err_oversize[n]), .stat_tx_err_user(stat_tx_err_user[n]), .stat_tx_err_underflow(stat_tx_err_underflow[n]), @@ -626,6 +626,8 @@ for (genvar n = 0; n < CNT; n = n + 1) begin : ch /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en[n]), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len[n]), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len[n]), .cfg_tx_ifg(cfg_tx_ifg[n]), .cfg_tx_enable(cfg_tx_enable[n]), diff --git a/src/eth/rtl/us/taxi_eth_mac_25g_us_ch.sv b/src/eth/rtl/us/taxi_eth_mac_25g_us_ch.sv index db399c1..d5588ad 100644 --- a/src/eth/rtl/us/taxi_eth_mac_25g_us_ch.sv +++ b/src/eth/rtl/us/taxi_eth_mac_25g_us_ch.sv @@ -53,9 +53,7 @@ module taxi_eth_mac_25g_us_ch # // MAC/PHY parameters parameter logic COMBINED_MAC_PCS = 1'b1, parameter DATA_W = 64, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -208,6 +206,7 @@ module taxi_eth_mac_25g_us_ch # output wire logic stat_tx_pkt_vlan, output wire logic stat_tx_pkt_good, output wire logic stat_tx_pkt_bad, + output wire logic stat_tx_pad_frame, output wire logic stat_tx_err_oversize, output wire logic stat_tx_err_user, output wire logic stat_tx_err_underflow, @@ -254,10 +253,12 @@ module taxi_eth_mac_25g_us_ch # /* * Configuration */ - input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518, + input wire logic cfg_tx_pad_en = 1'b1, + input wire logic [7:0] cfg_tx_min_pkt_len = 8'd60-1, + input wire logic [15:0] cfg_tx_max_pkt_len = 16'd1518-1, input wire logic [7:0] cfg_tx_ifg = 8'd12, input wire logic cfg_tx_enable = 1'b1, - input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518, + input wire logic [15:0] cfg_rx_max_pkt_len = 16'd1518-1, input wire logic cfg_rx_enable = 1'b1, input wire logic cfg_tx_prbs31_enable = 1'b0, input wire logic cfg_rx_prbs31_enable = 1'b0, @@ -883,9 +884,7 @@ if (COMBINED_MAC_PCS) begin : mac .HDR_W(HDR_W), .TX_GBX_IF_EN(CFG_LOW_LATENCY), .RX_GBX_IF_EN(CFG_LOW_LATENCY), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -1003,6 +1002,7 @@ if (COMBINED_MAC_PCS) begin : mac .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -1049,6 +1049,8 @@ if (COMBINED_MAC_PCS) begin : mac /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), @@ -1177,9 +1179,7 @@ end else begin : mac .CTRL_W(CTRL_W), .TX_GBX_IF_EN(CFG_LOW_LATENCY), .RX_GBX_IF_EN(CFG_LOW_LATENCY), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -1285,6 +1285,7 @@ end else begin : mac .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -1327,6 +1328,8 @@ end else begin : mac /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_10g/Makefile b/src/eth/tb/taxi_eth_mac_10g/Makefile index 3fcd19a..3424c9b 100644 --- a/src/eth/tb/taxi_eth_mac_10g/Makefile +++ b/src/eth/tb/taxi_eth_mac_10g/Makefile @@ -36,9 +36,7 @@ export PARAM_DATA_W := 64 export PARAM_TX_GBX_IF_EN := 1 export PARAM_RX_GBX_IF_EN := $(PARAM_TX_GBX_IF_EN) export PARAM_GBX_CNT := 1 -export PARAM_PADDING_EN := 1 export PARAM_DIC_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TD_EN := $(PARAM_PTP_TS_EN) export PARAM_PTP_TS_FMT_TOD := 1 diff --git a/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.py b/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.py index f09b4d2..083a204 100644 --- a/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.py +++ b/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.py @@ -95,6 +95,8 @@ class TB: dut.stat_rx_fifo_drop.setimmediatevalue(0) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -162,7 +164,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12): tb.xgmii_source.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -217,7 +219,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12): tb = TB(dut) tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -274,7 +278,9 @@ async def run_test_tx_alignment(dut, payload_data=None, ifg=12): byte_width = tb.axis_source.width // 8 tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -369,7 +375,9 @@ async def run_test_tx_underrun(dut, ifg=12): tb = TB(dut) tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -413,7 +421,9 @@ async def run_test_tx_error(dut, ifg=12): tb = TB(dut) tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -449,10 +459,12 @@ async def run_test_lfc(dut, ifg=12): tb = TB(dut) tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -596,10 +608,12 @@ async def run_test_pfc(dut, ifg=12): tb = TB(dut) tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -810,9 +824,7 @@ def test_taxi_eth_mac_10g(request, data_w, ptp_td_en, dic_en, pfc_en): parameters['TX_GBX_IF_EN'] = 0 parameters['RX_GBX_IF_EN'] = parameters['TX_GBX_IF_EN'] parameters['GBX_CNT'] = 1 - parameters['PADDING_EN'] = 1 parameters['DIC_EN'] = dic_en - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TD_EN'] = ptp_td_en parameters['PTP_TS_FMT_TOD'] = 1 diff --git a/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.sv b/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.sv index 2872b6f..720f4cb 100644 --- a/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.sv +++ b/src/eth/tb/taxi_eth_mac_10g/test_taxi_eth_mac_10g.sv @@ -22,9 +22,7 @@ module test_taxi_eth_mac_10g # parameter logic TX_GBX_IF_EN = 1'b0, parameter logic RX_GBX_IF_EN = TX_GBX_IF_EN, parameter GBX_CNT = 1, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -109,6 +107,7 @@ logic stat_tx_pkt_bcast; logic stat_tx_pkt_vlan; logic stat_tx_pkt_good; logic stat_tx_pkt_bad; +logic stat_tx_pad_frame; logic stat_tx_err_oversize; logic stat_tx_err_user; logic stat_tx_err_underflow; @@ -148,6 +147,8 @@ logic [7:0] stat_rx_pfc_xon; logic [7:0] stat_rx_pfc_xoff; logic [7:0] stat_rx_pfc_paused; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -191,9 +192,7 @@ taxi_eth_mac_10g #( .TX_GBX_IF_EN(TX_GBX_IF_EN), .RX_GBX_IF_EN(RX_GBX_IF_EN), .GBX_CNT(GBX_CNT), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -299,6 +298,7 @@ uut ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -341,6 +341,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_10g_fifo/Makefile b/src/eth/tb/taxi_eth_mac_10g_fifo/Makefile index 5b13bc4..3ad84b7 100644 --- a/src/eth/tb/taxi_eth_mac_10g_fifo/Makefile +++ b/src/eth/tb/taxi_eth_mac_10g_fifo/Makefile @@ -37,9 +37,7 @@ export PARAM_TX_GBX_IF_EN := 1 export PARAM_RX_GBX_IF_EN := $(PARAM_TX_GBX_IF_EN) export PARAM_GBX_CNT := 1 export PARAM_AXIS_DATA_W := $(PARAM_DATA_W) -export PARAM_PADDING_EN := 1 export PARAM_DIC_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TD_EN := $(PARAM_PTP_TS_EN) export PARAM_PTP_TS_FMT_TOD := 1 diff --git a/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py b/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py index 69bab6e..329071a 100644 --- a/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py +++ b/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py @@ -78,6 +78,8 @@ class TB: period_ns=self.ptp_clk_period ) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -117,7 +119,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12): tb.xgmii_source.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -171,7 +173,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12): tb = TB(dut) tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -227,7 +231,9 @@ async def run_test_tx_alignment(dut, payload_data=None, ifg=12): byte_width = tb.axis_source.width // 8 tb.xgmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -386,9 +392,7 @@ def test_taxi_eth_mac_10g_fifo(request, data_w, dic_en): parameters['TX_GBX_IF_EN'] = 0 parameters['RX_GBX_IF_EN'] = parameters['TX_GBX_IF_EN'] parameters['GBX_CNT'] = 1 - parameters['PADDING_EN'] = 1 parameters['DIC_EN'] = dic_en - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TD_EN'] = parameters['PTP_TS_EN'] parameters['PTP_TS_FMT_TOD'] = 1 diff --git a/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.sv b/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.sv index 245bdc1..f3bd3a5 100644 --- a/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.sv +++ b/src/eth/tb/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.sv @@ -23,9 +23,7 @@ module test_taxi_eth_mac_10g_fifo # parameter logic RX_GBX_IF_EN = TX_GBX_IF_EN, parameter GBX_CNT = 1, parameter AXIS_DATA_W = 8, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -108,6 +106,8 @@ logic rx_fifo_overflow; logic rx_fifo_bad_frame; logic rx_fifo_good_frame; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -120,9 +120,7 @@ taxi_eth_mac_10g_fifo #( .TX_GBX_IF_EN(TX_GBX_IF_EN), .RX_GBX_IF_EN(RX_GBX_IF_EN), .GBX_CNT(GBX_CNT), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -220,6 +218,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_1g/Makefile b/src/eth/tb/taxi_eth_mac_1g/Makefile index c6fef87..e4bb4d2 100644 --- a/src/eth/tb/taxi_eth_mac_1g/Makefile +++ b/src/eth/tb/taxi_eth_mac_1g/Makefile @@ -33,8 +33,6 @@ VERILOG_SOURCES := $(call uniq_base,$(call process_f_files,$(VERILOG_SOURCES))) # module parameters export PARAM_DATA_W := 8 -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TS_W := 96 export PARAM_TX_TAG_W := 16 diff --git a/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.py b/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.py index b4de659..2f75b9b 100644 --- a/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.py +++ b/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.py @@ -79,6 +79,8 @@ class TB: dut.stat_rx_fifo_drop.setimmediatevalue(0) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -175,9 +177,11 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, enab tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -224,10 +228,12 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, enab tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -270,10 +276,12 @@ async def run_test_tx_underrun(dut, ifg=12, enable_gen=None, mii_sel=False): tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -326,10 +334,12 @@ async def run_test_tx_error(dut, ifg=12, enable_gen=None, mii_sel=False): tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -368,9 +378,11 @@ async def run_test_rx_oversize(dut, ifg=12, enable_gen=None, mii_sel=False): tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 1518 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 1518-1 tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 1518 + tb.dut.cfg_rx_max_pkt_len.value = 1518-1 tb.dut.cfg_rx_enable.value = 1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -411,10 +423,12 @@ async def run_test_tx_oversize(dut, ifg=12, enable_gen=None, mii_sel=False): tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 1518 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 1518-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 1518 + tb.dut.cfg_rx_max_pkt_len.value = 1518-1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -453,10 +467,12 @@ async def run_test_lfc(dut, ifg=12, enable_gen=None, mii_sel=True): tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -606,10 +622,12 @@ async def run_test_pfc(dut, ifg=12, enable_gen=None, mii_sel=True): tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -834,8 +852,6 @@ def test_taxi_eth_mac_1g(request, pfc_en): parameters = {} parameters['DATA_W'] = 8 - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TS_W'] = 96 parameters['TX_TAG_W'] = 16 diff --git a/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.sv b/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.sv index 0d55e19..3d49113 100644 --- a/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.sv +++ b/src/eth/tb/taxi_eth_mac_1g/test_taxi_eth_mac_1g.sv @@ -19,8 +19,6 @@ module test_taxi_eth_mac_1g # ( /* verilator lint_off WIDTHTRUNC */ parameter DATA_W = 8, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter TX_TAG_W = 16, @@ -93,6 +91,7 @@ logic stat_tx_pkt_bcast; logic stat_tx_pkt_vlan; logic stat_tx_pkt_good; logic stat_tx_pkt_bad; +logic stat_tx_pad_frame; logic stat_tx_err_oversize; logic stat_tx_err_user; logic stat_tx_err_underflow; @@ -132,6 +131,8 @@ logic [7:0] stat_rx_pfc_xon; logic [7:0] stat_rx_pfc_xoff; logic [7:0] stat_rx_pfc_paused; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -171,8 +172,6 @@ logic cfg_rx_pfc_en; taxi_eth_mac_1g #( .DATA_W(DATA_W), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .PFC_EN(PFC_EN), @@ -270,6 +269,7 @@ uut ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -312,6 +312,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_1g_fifo/Makefile b/src/eth/tb/taxi_eth_mac_1g_fifo/Makefile index 3db6189..de64fa3 100644 --- a/src/eth/tb/taxi_eth_mac_1g_fifo/Makefile +++ b/src/eth/tb/taxi_eth_mac_1g_fifo/Makefile @@ -34,8 +34,6 @@ VERILOG_SOURCES := $(call uniq_base,$(call process_f_files,$(VERILOG_SOURCES))) # module parameters export PARAM_DATA_W := 8 export PARAM_AXIS_DATA_W := 8 -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_TX_TAG_W := 16 export PARAM_STAT_EN := 1 export PARAM_STAT_TX_LEVEL := 2 diff --git a/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.py b/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.py index b22f706..af38863 100644 --- a/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.py +++ b/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.py @@ -52,6 +52,8 @@ class TB: self.stat_sink = AxiStreamSink(AxiStreamBus.from_entity(dut.m_axis_stat), dut.stat_clk, dut.stat_rst) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -128,7 +130,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, enab tb.gmii_source.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 tb.dut.rx_mii_select.value = mii_sel tb.dut.tx_mii_select.value = mii_sel @@ -162,7 +164,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, enab tb = TB(dut) tb.gmii_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 tb.dut.rx_mii_select.value = mii_sel @@ -254,8 +258,6 @@ def test_taxi_eth_mac_1g_fifo(request): parameters['DATA_W'] = 8 parameters['AXIS_DATA_W'] = 8 - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['TX_TAG_W'] = 16 parameters['STAT_EN'] = 1 parameters['STAT_TX_LEVEL'] = 2 diff --git a/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.sv b/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.sv index 0ec8046..80c7ed7 100644 --- a/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.sv +++ b/src/eth/tb/taxi_eth_mac_1g_fifo/test_taxi_eth_mac_1g_fifo.sv @@ -20,8 +20,6 @@ module test_taxi_eth_mac_1g_fifo # /* verilator lint_off WIDTHTRUNC */ parameter DATA_W = 8, parameter AXIS_DATA_W = 8, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter TX_TAG_W = 16, parameter logic STAT_EN = 1'b0, parameter STAT_TX_LEVEL = 1, @@ -87,6 +85,8 @@ logic rx_fifo_overflow; logic rx_fifo_bad_frame; logic rx_fifo_good_frame; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -95,8 +95,6 @@ logic cfg_rx_enable; taxi_eth_mac_1g_fifo #( .DATA_W(DATA_W), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .STAT_EN(STAT_EN), .STAT_TX_LEVEL(STAT_TX_LEVEL), .STAT_RX_LEVEL(STAT_RX_LEVEL), @@ -178,6 +176,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_1g_gmii/Makefile b/src/eth/tb/taxi_eth_mac_1g_gmii/Makefile index ba96ac9..8f2fa50 100644 --- a/src/eth/tb/taxi_eth_mac_1g_gmii/Makefile +++ b/src/eth/tb/taxi_eth_mac_1g_gmii/Makefile @@ -35,8 +35,6 @@ VERILOG_SOURCES := $(call uniq_base,$(call process_f_files,$(VERILOG_SOURCES))) export PARAM_SIM := 1 export PARAM_VENDOR := "\"XILINX\"" export PARAM_FAMILY := "\"virtex7\"" -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TS_W := 96 export PARAM_TX_TAG_W := 16 diff --git a/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.py b/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.py index 1a351a4..60c1219 100644 --- a/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.py +++ b/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.py @@ -71,6 +71,8 @@ class TB: dut.stat_rx_fifo_drop.setimmediatevalue(0) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -129,7 +131,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb.gmii_phy.rx.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -185,7 +187,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb = TB(dut, speed) tb.gmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -239,7 +243,9 @@ async def run_test_tx_underrun(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.gmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -285,7 +291,9 @@ async def run_test_tx_error(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.gmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -323,10 +331,12 @@ async def run_test_lfc(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.gmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -473,10 +483,12 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.gmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -685,8 +697,6 @@ def test_taxi_eth_mac_1g_gmii(request, pfc_en): parameters['SIM'] = 1 parameters['VENDOR'] = "\"XILINX\"" parameters['FAMILY'] = "\"virtex7\"" - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TS_W'] = 96 parameters['TX_TAG_W'] = 16 diff --git a/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.sv b/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.sv index 3aaa744..965d0b8 100644 --- a/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.sv +++ b/src/eth/tb/taxi_eth_mac_1g_gmii/test_taxi_eth_mac_1g_gmii.sv @@ -21,8 +21,6 @@ module test_taxi_eth_mac_1g_gmii # parameter logic SIM = 1'b1, parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter TX_TAG_W = 16, @@ -96,6 +94,7 @@ logic stat_tx_pkt_bcast; logic stat_tx_pkt_vlan; logic stat_tx_pkt_good; logic stat_tx_pkt_bad; +logic stat_tx_pad_frame; logic stat_tx_err_oversize; logic stat_tx_err_user; logic stat_tx_err_underflow; @@ -136,6 +135,8 @@ logic [7:0] stat_rx_pfc_xon; logic [7:0] stat_rx_pfc_xoff; logic [7:0] stat_rx_pfc_paused; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -177,8 +178,6 @@ taxi_eth_mac_1g_gmii #( .SIM(SIM), .VENDOR(VENDOR), .FAMILY(FAMILY), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .PFC_EN(PFC_EN), @@ -273,6 +272,7 @@ uut ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -316,6 +316,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/Makefile b/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/Makefile index ea9f45d..076a29a 100644 --- a/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/Makefile +++ b/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/Makefile @@ -36,8 +36,6 @@ export PARAM_SIM := 1 export PARAM_VENDOR := "\"XILINX\"" export PARAM_FAMILY := "\"virtex7\"" export PARAM_AXIS_DATA_W := 8 -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_TX_TAG_W := 16 export PARAM_STAT_EN := 1 export PARAM_STAT_TX_LEVEL := 2 diff --git a/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.py b/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.py index 85c4cad..e0f55e5 100644 --- a/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.py +++ b/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.py @@ -44,6 +44,8 @@ class TB: self.stat_sink = AxiStreamSink(AxiStreamBus.from_entity(dut.m_axis_stat), dut.stat_clk, dut.stat_rst) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -74,7 +76,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb.gmii_phy.rx.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -112,7 +114,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb = TB(dut, speed) tb.gmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -209,8 +213,6 @@ def test_taxi_eth_mac_1g_gmii_fifo(request): parameters['VENDOR'] = "\"XILINX\"" parameters['FAMILY'] = "\"virtex7\"" parameters['AXIS_DATA_W'] = 8 - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['TX_TAG_W'] = 16 parameters['STAT_EN'] = 1 parameters['STAT_TX_LEVEL'] = 2 diff --git a/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.sv b/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.sv index 37dcdb1..d5e9271 100644 --- a/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.sv +++ b/src/eth/tb/taxi_eth_mac_1g_gmii_fifo/test_taxi_eth_mac_1g_gmii_fifo.sv @@ -22,8 +22,6 @@ module test_taxi_eth_mac_1g_gmii_fifo # parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", parameter AXIS_DATA_W = 8, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter TX_TAG_W = 16, parameter logic STAT_EN = 1'b0, parameter STAT_TX_LEVEL = 1, @@ -87,6 +85,8 @@ logic rx_fifo_bad_frame; logic rx_fifo_good_frame; logic [1:0] link_speed; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -97,8 +97,6 @@ taxi_eth_mac_1g_gmii_fifo #( .SIM(SIM), .VENDOR(VENDOR), .FAMILY(FAMILY), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .STAT_EN(STAT_EN), .STAT_TX_LEVEL(STAT_TX_LEVEL), .STAT_RX_LEVEL(STAT_RX_LEVEL), @@ -174,6 +172,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_1g_rgmii/Makefile b/src/eth/tb/taxi_eth_mac_1g_rgmii/Makefile index 8e7b5cf..2445b67 100644 --- a/src/eth/tb/taxi_eth_mac_1g_rgmii/Makefile +++ b/src/eth/tb/taxi_eth_mac_1g_rgmii/Makefile @@ -36,8 +36,6 @@ export PARAM_SIM := 1 export PARAM_VENDOR := "\"XILINX\"" export PARAM_FAMILY := "\"virtex7\"" export PARAM_USE_CLK90 := 1 -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TS_W := 96 export PARAM_TX_TAG_W := 16 diff --git a/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.py b/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.py index c554401..46ab755 100644 --- a/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.py +++ b/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.py @@ -66,6 +66,8 @@ class TB: dut.stat_rx_fifo_drop.setimmediatevalue(0) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -141,7 +143,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb.rgmii_phy.rx.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -197,7 +199,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb = TB(dut, speed) tb.rgmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -236,7 +240,9 @@ async def run_test_tx_underrun(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.rgmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -288,7 +294,9 @@ async def run_test_tx_error(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.rgmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -326,10 +334,12 @@ async def run_test_lfc(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.rgmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -476,10 +486,12 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.rgmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -690,8 +702,6 @@ def test_taxi_eth_mac_1g_rgmii(request, pfc_en): parameters['VENDOR'] = "\"XILINX\"" parameters['FAMILY'] = "\"virtex7\"" parameters['USE_CLK90'] = 1 - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TS_W'] = 96 parameters['TX_TAG_W'] = 16 diff --git a/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.sv b/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.sv index 21317d7..b09895f 100644 --- a/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.sv +++ b/src/eth/tb/taxi_eth_mac_1g_rgmii/test_taxi_eth_mac_1g_rgmii.sv @@ -22,8 +22,6 @@ module test_taxi_eth_mac_1g_rgmii # parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", parameter logic USE_CLK90 = 1'b1, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter TX_TAG_W = 16, @@ -95,6 +93,7 @@ logic stat_tx_pkt_bcast; logic stat_tx_pkt_vlan; logic stat_tx_pkt_good; logic stat_tx_pkt_bad; +logic stat_tx_pad_frame; logic stat_tx_err_oversize; logic stat_tx_err_user; logic stat_tx_err_underflow; @@ -135,6 +134,8 @@ logic [7:0] stat_rx_pfc_xon; logic [7:0] stat_rx_pfc_xoff; logic [7:0] stat_rx_pfc_paused; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -177,8 +178,6 @@ taxi_eth_mac_1g_rgmii #( .VENDOR(VENDOR), .FAMILY(FAMILY), .USE_CLK90(USE_CLK90), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .PFC_EN(PFC_EN), @@ -271,6 +270,7 @@ uut ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -314,6 +314,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/Makefile b/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/Makefile index 8d7aea7..d0b56cc 100644 --- a/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/Makefile +++ b/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/Makefile @@ -37,8 +37,6 @@ export PARAM_VENDOR := "\"XILINX\"" export PARAM_FAMILY := "\"virtex7\"" export PARAM_USE_CLK90 := 1 export PARAM_AXIS_DATA_W := 8 -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_TX_TAG_W := 16 export PARAM_STAT_EN := 1 export PARAM_STAT_TX_LEVEL := 2 diff --git a/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.py b/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.py index 5cbd482..2348a1b 100644 --- a/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.py +++ b/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.py @@ -43,6 +43,8 @@ class TB: self.stat_sink = AxiStreamSink(AxiStreamBus.from_entity(dut.m_axis_stat), dut.stat_clk, dut.stat_rst) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -90,7 +92,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb.rgmii_phy.rx.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -128,7 +130,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb = TB(dut, speed) tb.rgmii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -226,8 +230,6 @@ def test_taxi_eth_mac_1g_rgmii_fifo(request): parameters['FAMILY'] = "\"virtex7\"" parameters['USE_CLK90'] = 1 parameters['AXIS_DATA_W'] = 8 - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['TX_TAG_W'] = 16 parameters['STAT_EN'] = 1 parameters['STAT_TX_LEVEL'] = 2 diff --git a/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.sv b/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.sv index 4459c19..46a83da 100644 --- a/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.sv +++ b/src/eth/tb/taxi_eth_mac_1g_rgmii_fifo/test_taxi_eth_mac_1g_rgmii_fifo.sv @@ -23,8 +23,6 @@ module test_taxi_eth_mac_1g_rgmii_fifo # parameter string FAMILY = "virtex7", parameter logic USE_CLK90 = 1'b1, parameter AXIS_DATA_W = 8, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter TX_TAG_W = 16, parameter logic STAT_EN = 1'b0, parameter STAT_TX_LEVEL = 1, @@ -86,6 +84,8 @@ logic rx_fifo_bad_frame; logic rx_fifo_good_frame; logic [1:0] link_speed; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -97,8 +97,6 @@ taxi_eth_mac_1g_rgmii_fifo #( .VENDOR(VENDOR), .FAMILY(FAMILY), .USE_CLK90(USE_CLK90), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .STAT_EN(STAT_EN), .STAT_TX_LEVEL(STAT_TX_LEVEL), .STAT_RX_LEVEL(STAT_RX_LEVEL), @@ -172,6 +170,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_25g_us/Makefile b/src/eth/tb/taxi_eth_mac_25g_us/Makefile index a5af889..cbcf6bb 100644 --- a/src/eth/tb/taxi_eth_mac_25g_us/Makefile +++ b/src/eth/tb/taxi_eth_mac_25g_us/Makefile @@ -44,9 +44,7 @@ export PARAM_QPLL0_EXT_CTRL := 0 export PARAM_QPLL1_EXT_CTRL := 0 export PARAM_COMBINED_MAC_PCS := 1 export PARAM_DATA_W := 64 -export PARAM_PADDING_EN := 1 export PARAM_DIC_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TD_EN := $(PARAM_PTP_TS_EN) export PARAM_PTP_TS_FMT_TOD := 1 diff --git a/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.py b/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.py index 45049b2..b47fed4 100644 --- a/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.py +++ b/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.py @@ -140,6 +140,8 @@ class TB: dut.stat_rx_fifo_drop.setimmediatevalue([0]*4) + dut.cfg_tx_pad_en.setimmediatevalue([0]*4) + dut.cfg_tx_min_pkt_len.setimmediatevalue([0]*4) dut.cfg_tx_max_pkt_len.setimmediatevalue([0]*4) dut.cfg_tx_ifg.setimmediatevalue([0]*4) dut.cfg_tx_enable.setimmediatevalue([0]*4) @@ -237,7 +239,7 @@ async def run_test_rx(dut, port=0, payload_lengths=None, payload_data=None, ifg= tb.serdes_sources[port].ifg = ifg tb.dut.cfg_tx_ifg[port].value = ifg - tb.dut.cfg_rx_max_pkt_len[port].value = 9218 + tb.dut.cfg_rx_max_pkt_len[port].value = 9218-1 await tb.reset() @@ -320,8 +322,10 @@ async def run_test_tx(dut, port=0, payload_lengths=None, payload_data=None, ifg= tb = TB(dut) tb.serdes_sources[port].ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = [9218]*4 - tb.dut.cfg_tx_ifg.value = [ifg]*4 + tb.dut.cfg_tx_pad_en[port].value = 1 + tb.dut.cfg_tx_min_pkt_len[port].value = 60-1 + tb.dut.cfg_tx_max_pkt_len[port].value = 9218-1 + tb.dut.cfg_tx_ifg[port].value = ifg await tb.reset() @@ -400,7 +404,9 @@ async def run_test_tx_alignment(dut, port=0, payload_data=None, ifg=12): byte_width = tb.axis_sources[port].width // 8 tb.serdes_sources[port].ifg = ifg - tb.dut.cfg_tx_max_pkt_len[port].value = 9218 + tb.dut.cfg_tx_pad_en[port].value = 1 + tb.dut.cfg_tx_min_pkt_len[port].value = 60-1 + tb.dut.cfg_tx_max_pkt_len[port].value = 9218-1 tb.dut.cfg_tx_ifg[port].value = ifg await tb.reset() @@ -506,7 +512,9 @@ async def run_test_tx_underrun(dut, port=0, ifg=12): tb = TB(dut) tb.serdes_sources[port].ifg = ifg - tb.dut.cfg_tx_max_pkt_len[port].value = 9218 + tb.dut.cfg_tx_pad_en[port].value = 1 + tb.dut.cfg_tx_min_pkt_len[port].value = 60-1 + tb.dut.cfg_tx_max_pkt_len[port].value = 9218-1 tb.dut.cfg_tx_ifg[port].value = ifg await tb.reset() @@ -561,7 +569,9 @@ async def run_test_tx_error(dut, port=0, ifg=12): tb = TB(dut) tb.serdes_sources[port].ifg = ifg - tb.dut.cfg_tx_max_pkt_len[port].value = 9218 + tb.dut.cfg_tx_pad_en[port].value = 1 + tb.dut.cfg_tx_min_pkt_len[port].value = 60-1 + tb.dut.cfg_tx_max_pkt_len[port].value = 9218-1 tb.dut.cfg_tx_ifg[port].value = ifg await tb.reset() @@ -651,9 +661,11 @@ async def run_test_lfc(dut, port=0, ifg=12): tb = TB(dut) tb.serdes_sources[port].ifg = ifg - tb.dut.cfg_tx_max_pkt_len[port].value = 9218 + tb.dut.cfg_tx_pad_en[port].value = 1 + tb.dut.cfg_tx_min_pkt_len[port].value = 60-1 + tb.dut.cfg_tx_max_pkt_len[port].value = 9218-1 tb.dut.cfg_tx_ifg[port].value = ifg - tb.dut.cfg_rx_max_pkt_len[port].value = 9218 + tb.dut.cfg_rx_max_pkt_len[port].value = 9218-1 await tb.reset() @@ -813,9 +825,11 @@ async def run_test_pfc(dut, port=0, ifg=12): tb = TB(dut) tb.serdes_sources[port].ifg = ifg - tb.dut.cfg_tx_max_pkt_len[port].value = 9218 + tb.dut.cfg_tx_pad_en[port].value = 1 + tb.dut.cfg_tx_min_pkt_len[port].value = 60-1 + tb.dut.cfg_tx_max_pkt_len[port].value = 9218-1 tb.dut.cfg_tx_ifg[port].value = ifg - tb.dut.cfg_rx_max_pkt_len[port].value = 9218 + tb.dut.cfg_rx_max_pkt_len[port].value = 9218-1 await tb.reset() @@ -1061,9 +1075,7 @@ def test_taxi_eth_mac_25g_us(request, data_w, combined_mac_pcs, low_latency, dic parameters['QPLL1_EXT_CTRL'] = 0 parameters['COMBINED_MAC_PCS'] = combined_mac_pcs parameters['DATA_W'] = data_w - parameters['PADDING_EN'] = 1 parameters['DIC_EN'] = dic_en - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TD_EN'] = parameters['PTP_TS_EN'] parameters['PTP_TS_FMT_TOD'] = 1 diff --git a/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.sv b/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.sv index e6e85b8..2e72ccf 100644 --- a/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.sv +++ b/src/eth/tb/taxi_eth_mac_25g_us/test_taxi_eth_mac_25g_us.sv @@ -43,9 +43,7 @@ module test_taxi_eth_mac_25g_us # parameter logic [CNT-1:0] GT_RX_POLARITY = '0, parameter logic COMBINED_MAC_PCS = 1'b1, parameter DATA_W = 64, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -157,6 +155,7 @@ logic stat_tx_pkt_bcast[CNT]; logic stat_tx_pkt_vlan[CNT]; logic stat_tx_pkt_good[CNT]; logic stat_tx_pkt_bad[CNT]; +logic stat_tx_pad_frame[CNT]; logic stat_tx_err_oversize[CNT]; logic stat_tx_err_user[CNT]; logic stat_tx_err_underflow[CNT]; @@ -200,6 +199,8 @@ logic [7:0] stat_rx_pfc_xon[CNT]; logic [7:0] stat_rx_pfc_xoff[CNT]; logic [7:0] stat_rx_pfc_paused[CNT]; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len[CNT]; logic [7:0] cfg_tx_ifg[CNT]; logic cfg_tx_enable[CNT]; @@ -265,9 +266,7 @@ taxi_eth_mac_25g_us #( .GT_RX_POLARITY(GT_RX_POLARITY), .COMBINED_MAC_PCS(COMBINED_MAC_PCS), .DATA_W(DATA_W), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -406,6 +405,7 @@ uut ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -452,6 +452,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_mii/Makefile b/src/eth/tb/taxi_eth_mac_mii/Makefile index 740fa0b..2adc378 100644 --- a/src/eth/tb/taxi_eth_mac_mii/Makefile +++ b/src/eth/tb/taxi_eth_mac_mii/Makefile @@ -35,8 +35,6 @@ VERILOG_SOURCES := $(call uniq_base,$(call process_f_files,$(VERILOG_SOURCES))) export PARAM_SIM := 1 export PARAM_VENDOR := "\"XILINX\"" export PARAM_FAMILY := "\"virtex7\"" -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TS_W := 96 export PARAM_TX_TAG_W := 16 diff --git a/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.py b/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.py index 9f59140..e24c348 100644 --- a/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.py +++ b/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.py @@ -66,6 +66,8 @@ class TB: dut.stat_rx_fifo_drop.setimmediatevalue(0) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -124,7 +126,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb.mii_phy.rx.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -171,7 +173,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb = TB(dut, speed) tb.mii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -203,7 +207,9 @@ async def run_test_tx_underrun(dut, ifg=12): tb = TB(dut) tb.mii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -249,7 +255,9 @@ async def run_test_tx_error(dut, ifg=12): tb = TB(dut) tb.mii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -287,10 +295,12 @@ async def run_test_lfc(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.mii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -437,10 +447,12 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6): tb = TB(dut, speed) tb.mii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -648,8 +660,6 @@ def test_taxi_eth_mac_mii(request, pfc_en): parameters['SIM'] = 1 parameters['VENDOR'] = "\"XILINX\"" parameters['FAMILY'] = "\"virtex7\"" - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TS_W'] = 96 parameters['TX_TAG_W'] = 16 diff --git a/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.sv b/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.sv index 5089de0..34ecea6 100644 --- a/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.sv +++ b/src/eth/tb/taxi_eth_mac_mii/test_taxi_eth_mac_mii.sv @@ -21,8 +21,6 @@ module test_taxi_eth_mac_mii # parameter logic SIM = 1'b1, parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter PTP_TS_W = 96, parameter TX_TAG_W = 16, @@ -94,6 +92,7 @@ logic stat_tx_pkt_bcast; logic stat_tx_pkt_vlan; logic stat_tx_pkt_good; logic stat_tx_pkt_bad; +logic stat_tx_pad_frame; logic stat_tx_err_oversize; logic stat_tx_err_user; logic stat_tx_err_underflow; @@ -133,6 +132,8 @@ logic [7:0] stat_rx_pfc_xon; logic [7:0] stat_rx_pfc_xoff; logic [7:0] stat_rx_pfc_paused; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -174,8 +175,6 @@ taxi_eth_mac_mii #( .SIM(SIM), .VENDOR(VENDOR), .FAMILY(FAMILY), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TS_W(PTP_TS_W), .PFC_EN(PFC_EN), @@ -268,6 +267,7 @@ uut ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -310,6 +310,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_mii_fifo/Makefile b/src/eth/tb/taxi_eth_mac_mii_fifo/Makefile index b341b27..69ae6ad 100644 --- a/src/eth/tb/taxi_eth_mac_mii_fifo/Makefile +++ b/src/eth/tb/taxi_eth_mac_mii_fifo/Makefile @@ -36,8 +36,6 @@ export PARAM_SIM := 1 export PARAM_VENDOR := "\"XILINX\"" export PARAM_FAMILY := "\"virtex7\"" export PARAM_AXIS_DATA_W := 8 -export PARAM_PADDING_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_TX_TAG_W := 16 export PARAM_STAT_EN := 1 export PARAM_STAT_TX_LEVEL := 2 diff --git a/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.py b/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.py index 7d78975..16d813f 100644 --- a/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.py +++ b/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.py @@ -43,6 +43,8 @@ class TB: self.stat_sink = AxiStreamSink(AxiStreamBus.from_entity(dut.m_axis_stat), dut.stat_clk, dut.stat_rst) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -70,7 +72,7 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb.mii_phy.rx.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -98,7 +100,9 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee tb = TB(dut, speed) tb.mii_phy.rx.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg tb.dut.cfg_tx_enable.value = 1 @@ -185,8 +189,6 @@ def test_taxi_eth_mac_mii_fifo(request): parameters['VENDOR'] = "\"XILINX\"" parameters['FAMILY'] = "\"virtex7\"" parameters['AXIS_DATA_W'] = 8 - parameters['PADDING_EN'] = 1 - parameters['MIN_FRAME_LEN'] = 64 parameters['TX_TAG_W'] = 16 parameters['STAT_EN'] = 1 parameters['STAT_TX_LEVEL'] = 2 diff --git a/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.sv b/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.sv index 1265988..7fdb098 100644 --- a/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.sv +++ b/src/eth/tb/taxi_eth_mac_mii_fifo/test_taxi_eth_mac_mii_fifo.sv @@ -22,8 +22,6 @@ module test_taxi_eth_mac_mii_fifo # parameter string VENDOR = "XILINX", parameter string FAMILY = "virtex7", parameter AXIS_DATA_W = 8, - parameter logic PADDING_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter TX_TAG_W = 16, parameter logic STAT_EN = 1'b0, parameter STAT_TX_LEVEL = 1, @@ -83,6 +81,8 @@ logic rx_fifo_overflow; logic rx_fifo_bad_frame; logic rx_fifo_good_frame; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -93,8 +93,6 @@ taxi_eth_mac_mii_fifo #( .SIM(SIM), .VENDOR(VENDOR), .FAMILY(FAMILY), - .PADDING_EN(PADDING_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .STAT_EN(STAT_EN), .STAT_TX_LEVEL(STAT_TX_LEVEL), .STAT_RX_LEVEL(STAT_RX_LEVEL), @@ -167,6 +165,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_phy_10g/Makefile b/src/eth/tb/taxi_eth_mac_phy_10g/Makefile index 191a55f..d1303d6 100644 --- a/src/eth/tb/taxi_eth_mac_phy_10g/Makefile +++ b/src/eth/tb/taxi_eth_mac_phy_10g/Makefile @@ -36,9 +36,7 @@ export PARAM_DATA_W := 64 export PARAM_HDR_W := 2 export PARAM_TX_GBX_IF_EN := 1 export PARAM_RX_GBX_IF_EN := $(PARAM_TX_GBX_IF_EN) -export PARAM_PADDING_EN := 1 export PARAM_DIC_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TD_EN := $(PARAM_PTP_TS_EN) export PARAM_PTP_TS_FMT_TOD := 1 diff --git a/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.py b/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.py index dad8f53..d7ad9ca 100644 --- a/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.py +++ b/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.py @@ -108,6 +108,8 @@ class TB: dut.stat_rx_fifo_drop.setimmediatevalue(0) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -182,7 +184,7 @@ async def run_test_rx(dut, gbx_cfg=None, payload_lengths=None, payload_data=None tb.serdes_source.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 await tb.reset() @@ -256,7 +258,9 @@ async def run_test_tx(dut, gbx_cfg=None, payload_lengths=None, payload_data=None tb = TB(dut, gbx_cfg) tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg await tb.reset() @@ -328,7 +332,9 @@ async def run_test_tx_alignment(dut, gbx_cfg=None, payload_data=None, ifg=12): byte_width = tb.axis_source.width // 8 tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg await tb.reset() @@ -432,7 +438,9 @@ async def run_test_tx_underrun(dut, gbx_cfg=None, ifg=12): tb = TB(dut, gbx_cfg) tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg await tb.reset() @@ -481,7 +489,9 @@ async def run_test_tx_error(dut, gbx_cfg=None, ifg=12): tb = TB(dut, gbx_cfg) tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg await tb.reset() @@ -560,9 +570,11 @@ async def run_test_lfc(dut, gbx_cfg=None, ifg=12): tb = TB(dut, gbx_cfg) tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 await tb.reset() @@ -716,9 +728,11 @@ async def run_test_pfc(dut, gbx_cfg=None, ifg=12): tb = TB(dut, gbx_cfg) tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 await tb.reset() @@ -955,9 +969,7 @@ def test_taxi_eth_mac_phy_10g(request, data_w, ptp_td_en, gbx_en, dic_en, pfc_en parameters['HDR_W'] = 2 parameters['TX_GBX_IF_EN'] = gbx_en parameters['RX_GBX_IF_EN'] = parameters['TX_GBX_IF_EN'] - parameters['PADDING_EN'] = 1 parameters['DIC_EN'] = dic_en - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TD_EN'] = ptp_td_en parameters['PTP_TS_FMT_TOD'] = 1 diff --git a/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.sv b/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.sv index d8a141f..21a448b 100644 --- a/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.sv +++ b/src/eth/tb/taxi_eth_mac_phy_10g/test_taxi_eth_mac_phy_10g.sv @@ -22,9 +22,7 @@ module test_taxi_eth_mac_phy_10g # parameter HDR_W = 2, parameter logic TX_GBX_IF_EN = 1'b0, parameter logic RX_GBX_IF_EN = TX_GBX_IF_EN, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -120,6 +118,7 @@ logic stat_tx_pkt_bcast; logic stat_tx_pkt_vlan; logic stat_tx_pkt_good; logic stat_tx_pkt_bad; +logic stat_tx_pad_frame; logic stat_tx_err_oversize; logic stat_tx_err_user; logic stat_tx_err_underflow; @@ -163,6 +162,8 @@ logic [7:0] stat_rx_pfc_xon; logic [7:0] stat_rx_pfc_xoff; logic [7:0] stat_rx_pfc_paused; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -207,9 +208,7 @@ taxi_eth_mac_phy_10g #( .HDR_W(HDR_W), .TX_GBX_IF_EN(TX_GBX_IF_EN), .RX_GBX_IF_EN(RX_GBX_IF_EN), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -327,6 +326,7 @@ uut ( .stat_tx_pkt_vlan(stat_tx_pkt_vlan), .stat_tx_pkt_good(stat_tx_pkt_good), .stat_tx_pkt_bad(stat_tx_pkt_bad), + .stat_tx_pad_frame(stat_tx_pad_frame), .stat_tx_err_oversize(stat_tx_err_oversize), .stat_tx_err_user(stat_tx_err_user), .stat_tx_err_underflow(stat_tx_err_underflow), @@ -373,6 +373,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable), diff --git a/src/eth/tb/taxi_eth_mac_phy_10g_fifo/Makefile b/src/eth/tb/taxi_eth_mac_phy_10g_fifo/Makefile index e0189c6..b3a5216 100644 --- a/src/eth/tb/taxi_eth_mac_phy_10g_fifo/Makefile +++ b/src/eth/tb/taxi_eth_mac_phy_10g_fifo/Makefile @@ -37,9 +37,7 @@ export PARAM_HDR_W := 2 export PARAM_TX_GBX_IF_EN := 1 export PARAM_RX_GBX_IF_EN := $(PARAM_TX_GBX_IF_EN) export PARAM_AXIS_DATA_W := $(PARAM_DATA_W) -export PARAM_PADDING_EN := 1 export PARAM_DIC_EN := 1 -export PARAM_MIN_FRAME_LEN := 64 export PARAM_PTP_TS_EN := 1 export PARAM_PTP_TD_EN := $(PARAM_PTP_TS_EN) export PARAM_PTP_TS_FMT_TOD := 1 diff --git a/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py b/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py index 9f9754f..1ce9124 100644 --- a/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py +++ b/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py @@ -104,6 +104,8 @@ class TB: period_ns=self.ptp_clk_period ) + dut.cfg_tx_pad_en.setimmediatevalue(0) + dut.cfg_tx_min_pkt_len.setimmediatevalue(0) dut.cfg_tx_max_pkt_len.setimmediatevalue(0) dut.cfg_tx_ifg.setimmediatevalue(0) dut.cfg_tx_enable.setimmediatevalue(0) @@ -150,7 +152,7 @@ async def run_test_rx(dut, gbx_cfg=None, payload_lengths=None, payload_data=None tb.serdes_source.ifg = ifg tb.dut.cfg_tx_ifg.value = ifg - tb.dut.cfg_rx_max_pkt_len.value = 9218 + tb.dut.cfg_rx_max_pkt_len.value = 9218-1 tb.dut.cfg_rx_enable.value = 1 await tb.reset() @@ -220,7 +222,9 @@ async def run_test_tx(dut, gbx_cfg=None, payload_lengths=None, payload_data=None tb = TB(dut, gbx_cfg) tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg await tb.reset() @@ -287,7 +291,9 @@ async def run_test_tx_alignment(dut, gbx_cfg=None, payload_data=None, ifg=12): byte_width = tb.axis_source.width // 8 tb.serdes_source.ifg = ifg - tb.dut.cfg_tx_max_pkt_len.value = 9218 + tb.dut.cfg_tx_pad_en.value = 1 + tb.dut.cfg_tx_min_pkt_len.value = 60-1 + tb.dut.cfg_tx_max_pkt_len.value = 9218-1 tb.dut.cfg_tx_ifg.value = ifg await tb.reset() @@ -504,9 +510,7 @@ def test_taxi_eth_mac_phy_10g_fifo(request, data_w, gbx_en, dic_en): parameters['TX_GBX_IF_EN'] = gbx_en parameters['RX_GBX_IF_EN'] = parameters['TX_GBX_IF_EN'] parameters['AXIS_DATA_W'] = parameters['DATA_W'] - parameters['PADDING_EN'] = 1 parameters['DIC_EN'] = dic_en - parameters['MIN_FRAME_LEN'] = 64 parameters['PTP_TS_EN'] = 1 parameters['PTP_TD_EN'] = parameters['PTP_TS_EN'] parameters['PTP_TS_FMT_TOD'] = 1 diff --git a/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.sv b/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.sv index 623a979..67e9bbb 100644 --- a/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.sv +++ b/src/eth/tb/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.sv @@ -23,9 +23,7 @@ module test_taxi_eth_mac_phy_10g_fifo # parameter logic TX_GBX_IF_EN = 1'b0, parameter logic RX_GBX_IF_EN = TX_GBX_IF_EN, parameter AXIS_DATA_W = 8, - parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, - parameter MIN_FRAME_LEN = 64, parameter logic PTP_TS_EN = 1'b0, parameter logic PTP_TD_EN = PTP_TS_EN, parameter logic PTP_TS_FMT_TOD = 1'b1, @@ -124,6 +122,8 @@ logic rx_fifo_overflow; logic rx_fifo_bad_frame; logic rx_fifo_good_frame; +logic cfg_tx_pad_en; +logic [7:0] cfg_tx_min_pkt_len; logic [15:0] cfg_tx_max_pkt_len; logic [7:0] cfg_tx_ifg; logic cfg_tx_enable; @@ -137,9 +137,7 @@ taxi_eth_mac_phy_10g_fifo #( .HDR_W(HDR_W), .TX_GBX_IF_EN(TX_GBX_IF_EN), .RX_GBX_IF_EN(RX_GBX_IF_EN), - .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), - .MIN_FRAME_LEN(MIN_FRAME_LEN), .PTP_TS_EN(PTP_TS_EN), .PTP_TD_EN(PTP_TD_EN), .PTP_TS_FMT_TOD(PTP_TS_FMT_TOD), @@ -254,6 +252,8 @@ uut ( /* * Configuration */ + .cfg_tx_pad_en(cfg_tx_pad_en), + .cfg_tx_min_pkt_len(cfg_tx_min_pkt_len), .cfg_tx_max_pkt_len(cfg_tx_max_pkt_len), .cfg_tx_ifg(cfg_tx_ifg), .cfg_tx_enable(cfg_tx_enable),