From 916355ca8a773994edcd10b81ae2eb30f4ce2831 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Mon, 24 Feb 2025 17:17:23 -0800 Subject: [PATCH] eth: Add TX/RX polarity control to MAC+PHY+GT wrapper Signed-off-by: Alex Forencich --- rtl/eth/us/taxi_eth_mac_25g_us.sv | 10 ++++++- rtl/eth/us/taxi_eth_mac_25g_us_ch.sv | 28 +++++++++++++++++++ .../us/taxi_eth_mac_25g_us_gth_10g_156.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gth_10g_161.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gth_10g_322.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gty_10g_156.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gty_10g_161.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gty_10g_322.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gty_25g_156.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gty_25g_161.tcl | 2 ++ .../us/taxi_eth_mac_25g_us_gty_25g_322.tcl | 2 ++ 11 files changed, 55 insertions(+), 1 deletion(-) diff --git a/rtl/eth/us/taxi_eth_mac_25g_us.sv b/rtl/eth/us/taxi_eth_mac_25g_us.sv index 9198ca9..ddcae1c 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us.sv +++ b/rtl/eth/us/taxi_eth_mac_25g_us.sv @@ -26,6 +26,10 @@ module taxi_eth_mac_25g_us # // GT type parameter string GT_TYPE = "GTY", + // GT parameters + parameter logic [CNT-1:0] GT_TX_POLARITY = '0, + parameter logic [CNT-1:0] GT_RX_POLARITY = '0, + // MAC/PHY parameters parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, @@ -219,7 +223,11 @@ for (genvar n = 0; n < CNT; n = n + 1) begin : ch // GT type .GT_TYPE(GT_TYPE), - // PHY parameters + // GT parameters + .GT_TX_POLARITY(GT_TX_POLARITY[n]), + .GT_RX_POLARITY(GT_RX_POLARITY[n]), + + // MAC/PHY parameters .PADDING_EN(PADDING_EN), .DIC_EN(DIC_EN), .MIN_FRAME_LEN(MIN_FRAME_LEN), diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_ch.sv b/rtl/eth/us/taxi_eth_mac_25g_us_ch.sv index e0f385f..38522e4 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_ch.sv +++ b/rtl/eth/us/taxi_eth_mac_25g_us_ch.sv @@ -26,6 +26,10 @@ module taxi_eth_mac_25g_us_ch # // GT type parameter string GT_TYPE = "GTY", + // GT parameters + parameter logic GT_TX_POLARITY = 1'b0, + parameter logic GT_RX_POLARITY = 1'b0, + // MAC/PHY parameters parameter logic PADDING_EN = 1'b1, parameter logic DIC_EN = 1'b1, @@ -270,6 +274,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTY" && GT_USP) begin : xcvr .txpmaresetdone_out(), .txprgdivresetdone_out(), + .txpolarity_in(GT_TX_POLARITY), + .gtwiz_userdata_tx_in(gt_txdata), .txheader_in(gt_txheader), .txsequence_in(7'b0), @@ -287,6 +293,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTY" && GT_USP) begin : xcvr .rxpmaresetdone_out(), .rxprgdivresetdone_out(), + .rxpolarity_in(GT_RX_POLARITY), + .rxgearboxslip_in(gt_rxgearboxslip), .gtwiz_userdata_rx_out(gt_rxdata), .rxdatavalid_out(gt_rxdatavalid), @@ -331,6 +339,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTH" && GT_USP) begin : xcvr .txpmaresetdone_out(), .txprgdivresetdone_out(), + .txpolarity_in(GT_TX_POLARITY), + .gtwiz_userdata_tx_in(gt_txdata), .txheader_in(gt_txheader), .txsequence_in(7'b0), @@ -348,6 +358,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTH" && GT_USP) begin : xcvr .rxpmaresetdone_out(), .rxprgdivresetdone_out(), + .rxpolarity_in(GT_RX_POLARITY), + .rxgearboxslip_in(gt_rxgearboxslip), .gtwiz_userdata_rx_out(gt_rxdata), .rxdatavalid_out(gt_rxdatavalid), @@ -392,6 +404,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTY" && !GT_USP) begin : xcvr .txpmaresetdone_out(), .txprgdivresetdone_out(), + .txpolarity_in(GT_TX_POLARITY), + .gtwiz_userdata_tx_in(gt_txdata), .txheader_in(gt_txheader), .txsequence_in(7'b0), @@ -409,6 +423,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTY" && !GT_USP) begin : xcvr .rxpmaresetdone_out(), .rxprgdivresetdone_out(), + .rxpolarity_in(GT_RX_POLARITY), + .rxgearboxslip_in(gt_rxgearboxslip), .gtwiz_userdata_rx_out(gt_rxdata), .rxdatavalid_out(gt_rxdatavalid), @@ -453,6 +469,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTH" && !GT_USP) begin : xcvr .txpmaresetdone_out(), .txprgdivresetdone_out(), + .txpolarity_in(GT_TX_POLARITY), + .gtwiz_userdata_tx_in(gt_txdata), .txheader_in(gt_txheader), .txsequence_in(7'b0), @@ -470,6 +488,8 @@ end else if (HAS_COMMON && GT_TYPE == "GTH" && !GT_USP) begin : xcvr .rxpmaresetdone_out(), .rxprgdivresetdone_out(), + .rxpolarity_in(GT_RX_POLARITY), + .rxgearboxslip_in(gt_rxgearboxslip), .gtwiz_userdata_rx_out(gt_rxdata), .rxdatavalid_out(gt_rxdatavalid), @@ -516,6 +536,8 @@ end else if (!HAS_COMMON && GT_TYPE == "GTY") begin : xcvr .txpmaresetdone_out(), .txprgdivresetdone_out(), + .txpolarity_in(GT_TX_POLARITY), + .gtwiz_userdata_tx_in(gt_txdata), .txheader_in(gt_txheader), .txsequence_in(7'b0), @@ -533,6 +555,8 @@ end else if (!HAS_COMMON && GT_TYPE == "GTY") begin : xcvr .rxpmaresetdone_out(), .rxprgdivresetdone_out(), + .rxpolarity_in(GT_RX_POLARITY), + .rxgearboxslip_in(gt_rxgearboxslip), .gtwiz_userdata_rx_out(gt_rxdata), .rxdatavalid_out(gt_rxdatavalid), @@ -581,6 +605,8 @@ end else if (!HAS_COMMON && GT_TYPE == "GTH") begin : xcvr .txpmaresetdone_out(), .txprgdivresetdone_out(), + .txpolarity_in(GT_TX_POLARITY), + .gtwiz_userdata_tx_in(gt_txdata), .txheader_in(gt_txheader), .txsequence_in(7'b0), @@ -598,6 +624,8 @@ end else if (!HAS_COMMON && GT_TYPE == "GTH") begin : xcvr .rxpmaresetdone_out(), .rxprgdivresetdone_out(), + .rxpolarity_in(GT_RX_POLARITY), + .rxgearboxslip_in(gt_rxgearboxslip), .gtwiz_userdata_rx_out(gt_rxdata), .rxdatavalid_out(gt_rxdatavalid), diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_156.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_156.tcl index 1288ae7..e87523e 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_156.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_156.tcl @@ -22,6 +22,8 @@ set int_data_width {32} set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_161.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_161.tcl index 411821d..3efe53d 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_161.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_161.tcl @@ -22,6 +22,8 @@ set int_data_width {32} set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_322.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_322.tcl index 7c93978..a486384 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_322.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gth_10g_322.tcl @@ -22,6 +22,8 @@ set int_data_width {32} set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_156.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_156.tcl index 9dba3d2..4cccfbc 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_156.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_156.tcl @@ -22,6 +22,8 @@ set int_data_width $user_data_width set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_161.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_161.tcl index 5a54af3..4327304 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_161.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_161.tcl @@ -22,6 +22,8 @@ set int_data_width $user_data_width set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_322.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_322.tcl index e21e6c8..11a2edf 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_322.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gty_10g_322.tcl @@ -22,6 +22,8 @@ set int_data_width $user_data_width set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_156.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_156.tcl index d584234..bf5e0fc 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_156.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_156.tcl @@ -22,6 +22,8 @@ set int_data_width $user_data_width set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_161.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_161.tcl index faebcbd..9f11c7b 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_161.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_161.tcl @@ -22,6 +22,8 @@ set int_data_width $user_data_width set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create] diff --git a/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_322.tcl b/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_322.tcl index 8b6ff3c..644cdd7 100644 --- a/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_322.tcl +++ b/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_322.tcl @@ -22,6 +22,8 @@ set int_data_width $user_data_width set rx_eq_mode {DFE} set extra_ports [list] set extra_pll_ports [list {qpll0lock_out}] +# channel polarity +lappend extra_ports txpolarity_in rxpolarity_in set config [dict create]