diff --git a/fpga/app/dma_bench/rtl/mqnic_app_block_dma_bench.v b/fpga/app/dma_bench/rtl/mqnic_app_block_dma_bench.v index 7f8ff5378..4c78ba615 100644 --- a/fpga/app/dma_bench/rtl/mqnic_app_block_dma_bench.v +++ b/fpga/app/dma_bench/rtl/mqnic_app_block_dma_bench.v @@ -296,6 +296,7 @@ module mqnic_app_block # input wire ptp_rst, input wire ptp_sample_clk, input wire ptp_pps, + input wire ptp_pps_str, input wire [PTP_TS_WIDTH-1:0] ptp_ts_96, input wire ptp_ts_step, input wire ptp_sync_pps, diff --git a/fpga/app/template/rtl/mqnic_app_block.v b/fpga/app/template/rtl/mqnic_app_block.v index 875e8c4ed..ecefd2d98 100644 --- a/fpga/app/template/rtl/mqnic_app_block.v +++ b/fpga/app/template/rtl/mqnic_app_block.v @@ -296,6 +296,7 @@ module mqnic_app_block # input wire ptp_rst, input wire ptp_sample_clk, input wire ptp_pps, + input wire ptp_pps_str, input wire [PTP_TS_WIDTH-1:0] ptp_ts_96, input wire ptp_ts_step, input wire ptp_sync_pps, diff --git a/fpga/common/rtl/mqnic_core.v b/fpga/common/rtl/mqnic_core.v index c5d326866..47334d76f 100644 --- a/fpga/common/rtl/mqnic_core.v +++ b/fpga/common/rtl/mqnic_core.v @@ -360,6 +360,7 @@ module mqnic_core # input wire ptp_rst, input wire ptp_sample_clk, output wire ptp_pps, + output wire ptp_pps_str, output wire [PTP_TS_WIDTH-1:0] ptp_ts_96, output wire ptp_ts_step, output wire ptp_sync_pps, @@ -701,6 +702,7 @@ mqnic_ptp_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), @@ -3131,6 +3133,7 @@ if (APP_ENABLE) begin : app .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/common/rtl/mqnic_core_axi.v b/fpga/common/rtl/mqnic_core_axi.v index bd4d70c82..903b317cf 100644 --- a/fpga/common/rtl/mqnic_core_axi.v +++ b/fpga/common/rtl/mqnic_core_axi.v @@ -321,6 +321,7 @@ module mqnic_core_axi # input wire ptp_rst, input wire ptp_sample_clk, output wire ptp_pps, + output wire ptp_pps_str, output wire [PTP_TS_WIDTH-1:0] ptp_ts_96, output wire ptp_ts_step, output wire ptp_sync_pps, @@ -1091,6 +1092,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/common/rtl/mqnic_core_pcie.v b/fpga/common/rtl/mqnic_core_pcie.v index 3d4b7f33a..0271092b8 100644 --- a/fpga/common/rtl/mqnic_core_pcie.v +++ b/fpga/common/rtl/mqnic_core_pcie.v @@ -345,6 +345,7 @@ module mqnic_core_pcie # input wire ptp_rst, input wire ptp_sample_clk, output wire ptp_pps, + output wire ptp_pps_str, output wire [PTP_TS_WIDTH-1:0] ptp_ts_96, output wire ptp_ts_step, output wire ptp_sync_pps, @@ -1760,6 +1761,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/common/rtl/mqnic_core_pcie_s10.v b/fpga/common/rtl/mqnic_core_pcie_s10.v index 47d300dc4..2d41e266e 100644 --- a/fpga/common/rtl/mqnic_core_pcie_s10.v +++ b/fpga/common/rtl/mqnic_core_pcie_s10.v @@ -283,6 +283,7 @@ module mqnic_core_pcie_s10 # input wire ptp_rst, input wire ptp_sample_clk, output wire ptp_pps, + output wire ptp_pps_str, output wire [PTP_TS_WIDTH-1:0] ptp_ts_96, output wire ptp_ts_step, output wire ptp_sync_pps, @@ -914,6 +915,7 @@ core_pcie_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/common/rtl/mqnic_core_pcie_us.v b/fpga/common/rtl/mqnic_core_pcie_us.v index d01b57e54..c840a14b0 100644 --- a/fpga/common/rtl/mqnic_core_pcie_us.v +++ b/fpga/common/rtl/mqnic_core_pcie_us.v @@ -342,6 +342,7 @@ module mqnic_core_pcie_us # input wire ptp_rst, input wire ptp_sample_clk, output wire ptp_pps, + output wire ptp_pps_str, output wire [PTP_TS_WIDTH-1:0] ptp_ts_96, output wire ptp_ts_step, output wire ptp_sync_pps, @@ -1029,6 +1030,7 @@ core_pcie_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/common/rtl/mqnic_ptp.v b/fpga/common/rtl/mqnic_ptp.v index 5ac39616b..6cb2ccc61 100644 --- a/fpga/common/rtl/mqnic_ptp.v +++ b/fpga/common/rtl/mqnic_ptp.v @@ -81,6 +81,7 @@ module mqnic_ptp # input wire ptp_rst, input wire ptp_sample_clk, output wire ptp_pps, + output wire ptp_pps_str, output wire [95:0] ptp_ts_96, output wire ptp_ts_step, output wire ptp_sync_pps, @@ -193,6 +194,7 @@ ptp_clock_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/common/rtl/mqnic_ptp_clock.v b/fpga/common/rtl/mqnic_ptp_clock.v index f2b765b87..89541b087 100644 --- a/fpga/common/rtl/mqnic_ptp_clock.v +++ b/fpga/common/rtl/mqnic_ptp_clock.v @@ -81,6 +81,7 @@ module mqnic_ptp_clock # input wire ptp_rst, input wire ptp_sample_clk, output wire ptp_pps, + output wire ptp_pps_str, output wire [95:0] ptp_ts_96, output wire ptp_ts_step, output wire ptp_sync_pps, @@ -330,6 +331,26 @@ ptp_clock_inst ( .output_pps(ptp_pps) ); +// stretched PPS output +localparam PPS_CNT_PERIOD = (64'd500_000_000*PTP_CLK_PERIOD_NS_DENOM)/PTP_CLK_PERIOD_NS_NUM; + +reg [$clog2(PPS_CNT_PERIOD)-1:0] pps_counter_reg = 0; +reg pps_str_reg = 0; + +always @(posedge ptp_clk) begin + pps_str_reg <= 1'b0; + + if (ptp_pps) begin + pps_counter_reg <= PPS_CNT_PERIOD; + pps_str_reg <= 1'b1; + end else if (pps_counter_reg > 0) begin + pps_counter_reg <= pps_counter_reg - 1; + pps_str_reg <= 1'b1; + end +end + +assign ptp_pps_str = pps_str_reg; + // sync to core clock domain ptp_clock_cdc #( .TS_WIDTH(96), diff --git a/fpga/mqnic/ADM_PCIE_9V3/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/ADM_PCIE_9V3/fpga_100g/rtl/fpga_core.v index a83f98401..6c5931b1b 100644 --- a/fpga/mqnic/ADM_PCIE_9V3/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/ADM_PCIE_9V3/fpga_100g/rtl/fpga_core.v @@ -403,6 +403,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -661,23 +662,10 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - assign user_led_g[0] = 1'b1; -assign user_led_g[1] = !pps_led_reg; +assign user_led_g[1] = !ptp_pps_str; assign user_led_r = 1'b1; -assign front_led[0] = !pps_led_reg; +assign front_led[0] = !ptp_pps_str; assign front_led[1] = 1'b0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1128,6 +1116,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/ADM_PCIE_9V3/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/ADM_PCIE_9V3/fpga_25g/rtl/fpga_core.v index 883375fe3..7b1397ed6 100644 --- a/fpga/mqnic/ADM_PCIE_9V3/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/ADM_PCIE_9V3/fpga_25g/rtl/fpga_core.v @@ -492,6 +492,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -846,19 +847,6 @@ qsfp_1_rb_drp_inst ( .drp_rdy(qsfp_1_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -935,9 +923,9 @@ end endgenerate assign user_led_g[0] = 1'b1; -assign user_led_g[1] = !pps_led_reg; +assign user_led_g[1] = !ptp_pps_str; assign user_led_r = 1'b1; -assign front_led[0] = !pps_led_reg; +assign front_led[0] = !ptp_pps_str; assign front_led[1] = 1'b0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1394,6 +1382,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU200/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/AU200/fpga_100g/rtl/fpga_core.v index 07d4f6f9f..93486ecae 100644 --- a/fpga/mqnic/AU200/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/AU200/fpga_100g/rtl/fpga_core.v @@ -420,6 +420,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -672,20 +673,7 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - -assign led[0] = pps_led_reg; +assign led[0] = ptp_pps_str; assign led[2:1] = 0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1136,6 +1124,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU200/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/AU200/fpga_25g/rtl/fpga_core.v index a9ac76e93..8ecea1036 100644 --- a/fpga/mqnic/AU200/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/AU200/fpga_25g/rtl/fpga_core.v @@ -509,6 +509,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -857,19 +858,6 @@ qsfp1_rb_drp_inst ( .drp_rdy(qsfp1_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -946,7 +934,7 @@ end endgenerate -assign led[0] = pps_led_reg; +assign led[0] = ptp_pps_str; assign led[2:1] = 0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1403,6 +1391,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU250/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/AU250/fpga_100g/rtl/fpga_core.v index 20d0b33e7..96a601b64 100644 --- a/fpga/mqnic/AU250/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/AU250/fpga_100g/rtl/fpga_core.v @@ -420,6 +420,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -672,20 +673,7 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - -assign led[0] = pps_led_reg; +assign led[0] = ptp_pps_str; assign led[2:1] = 0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1136,6 +1124,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU250/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/AU250/fpga_25g/rtl/fpga_core.v index 0949ec0ae..f12fd2809 100644 --- a/fpga/mqnic/AU250/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/AU250/fpga_25g/rtl/fpga_core.v @@ -509,6 +509,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -857,19 +858,6 @@ qsfp1_rb_drp_inst ( .drp_rdy(qsfp1_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -946,7 +934,7 @@ end endgenerate -assign led[0] = pps_led_reg; +assign led[0] = ptp_pps_str; assign led[2:1] = 0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1403,6 +1391,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU280/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/AU280/fpga_100g/rtl/fpga_core.v index 35b4b5322..e86a5cefc 100644 --- a/fpga/mqnic/AU280/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/AU280/fpga_100g/rtl/fpga_core.v @@ -392,6 +392,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -1012,6 +1013,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU280/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/AU280/fpga_25g/rtl/fpga_core.v index 1cc386d0b..2d312633e 100644 --- a/fpga/mqnic/AU280/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/AU280/fpga_25g/rtl/fpga_core.v @@ -481,6 +481,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -1279,6 +1280,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU50/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/AU50/fpga_100g/rtl/fpga_core.v index 50f16c6d0..aeeb45039 100644 --- a/fpga/mqnic/AU50/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/AU50/fpga_100g/rtl/fpga_core.v @@ -369,6 +369,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -541,20 +542,7 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - -assign qsfp_led_act = pps_led_reg; +assign qsfp_led_act = ptp_pps_str; assign qsfp_led_stat_g = 1'b0; assign qsfp_led_stat_y = 1'b0; @@ -1002,6 +990,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/AU50/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/AU50/fpga_25g/rtl/fpga_core.v index efd90cafc..d2d19446d 100644 --- a/fpga/mqnic/AU50/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/AU50/fpga_25g/rtl/fpga_core.v @@ -429,6 +429,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -649,19 +650,6 @@ qsfp_rb_drp_inst ( .drp_rdy(qsfp_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -730,7 +718,7 @@ end endgenerate -assign qsfp_led_act = pps_led_reg; +assign qsfp_led_act = ptp_pps_str; assign qsfp_led_stat_g = 1'b0; assign qsfp_led_stat_y = 1'b0; @@ -1188,6 +1176,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/DNPCIe_40G_KU_LL_2QSFP/fpga/rtl/fpga_core.v b/fpga/mqnic/DNPCIe_40G_KU_LL_2QSFP/fpga/rtl/fpga_core.v index 74216d075..b7083a8e0 100644 --- a/fpga/mqnic/DNPCIe_40G_KU_LL_2QSFP/fpga/rtl/fpga_core.v +++ b/fpga/mqnic/DNPCIe_40G_KU_LL_2QSFP/fpga/rtl/fpga_core.v @@ -499,6 +499,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -871,19 +872,6 @@ qsfp1_rb_drp_inst ( .drp_rdy(qsfp1_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -961,7 +949,7 @@ end endgenerate assign user_led[6:0] = 0; -assign user_led[7] = pps_led_reg; +assign user_led[7] = ptp_pps_str; assign qsfp0_leg_green = 1'b0; assign qsfp0_leg_red = 1'b0; @@ -1422,6 +1410,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/NetFPGA_SUME/fpga/rtl/fpga_core.v b/fpga/mqnic/NetFPGA_SUME/fpga/rtl/fpga_core.v index 9416e134a..bb893d06a 100644 --- a/fpga/mqnic/NetFPGA_SUME/fpga/rtl/fpga_core.v +++ b/fpga/mqnic/NetFPGA_SUME/fpga/rtl/fpga_core.v @@ -380,6 +380,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -550,24 +551,11 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - assign sfp_1_led = 2'b00; assign sfp_2_led = 2'b00; assign sfp_3_led = 2'b00; assign sfp_4_led = 2'b00; -assign led[0] = pps_led_reg; +assign led[0] = ptp_pps_str; assign led[1] = 1'b0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1024,6 +1012,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/Nexus_K35_S/fpga/rtl/fpga_core.v b/fpga/mqnic/Nexus_K35_S/fpga/rtl/fpga_core.v index 6ec45d7a9..bc7eadf14 100644 --- a/fpga/mqnic/Nexus_K35_S/fpga/rtl/fpga_core.v +++ b/fpga/mqnic/Nexus_K35_S/fpga/rtl/fpga_core.v @@ -382,6 +382,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -702,26 +703,13 @@ sfp_rb_drp_inst ( .drp_rdy(sfp_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - assign sma_out = ptp_perout_pulse; assign sma_out_en = 1'b0; assign sma_term_en = 1'b0; assign sfp_1_led = 2'b00; assign sfp_2_led = 2'b00; -assign sma_led[0] = pps_led_reg; +assign sma_led[0] = ptp_pps_str; assign sma_led[1] = 1'b0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1178,6 +1166,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/Nexus_K3P_Q/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/Nexus_K3P_Q/fpga_25g/rtl/fpga_core.v index a86fb19b6..c626b2750 100644 --- a/fpga/mqnic/Nexus_K3P_Q/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/Nexus_K3P_Q/fpga_25g/rtl/fpga_core.v @@ -506,6 +506,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -905,19 +906,6 @@ qsfp_1_rb_drp_inst ( .drp_rdy(qsfp_1_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -1001,7 +989,7 @@ assign qsfp_0_led_green = 1'b0; assign qsfp_0_led_orange = 1'b0; assign qsfp_1_led_green = 1'b0; assign qsfp_1_led_orange = 1'b0; -assign sma_led_green = pps_led_reg; +assign sma_led_green = ptp_pps_str; assign sma_led_red = 1'b0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1458,6 +1446,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/Nexus_K3P_S/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/Nexus_K3P_S/fpga_25g/rtl/fpga_core.v index e3d00e88c..da88b87bf 100644 --- a/fpga/mqnic/Nexus_K3P_S/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/Nexus_K3P_S/fpga_25g/rtl/fpga_core.v @@ -417,6 +417,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -737,19 +738,6 @@ sfp_rb_drp_inst ( .drp_rdy(sfp_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -819,7 +807,7 @@ assign sma_term_en = 1'b0; assign sfp_1_led = 2'b00; assign sfp_2_led = 2'b00; -assign sma_led[0] = pps_led_reg; +assign sma_led[0] = ptp_pps_str; assign sma_led[1] = 1'b0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1276,6 +1264,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/S10MX_DK/fpga_10g/rtl/fpga_core.v b/fpga/mqnic/S10MX_DK/fpga_10g/rtl/fpga_core.v index 10b3a432a..7f9af9465 100644 --- a/fpga/mqnic/S10MX_DK/fpga_10g/rtl/fpga_core.v +++ b/fpga/mqnic/S10MX_DK/fpga_10g/rtl/fpga_core.v @@ -381,6 +381,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -582,19 +583,6 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - // // BER tester // tdma_ber #( // .COUNT(8), @@ -643,10 +631,10 @@ end // .ptp_ts_step(ptp_ts_step) // ); -assign user_led[0] = pps_led_reg; +assign user_led[0] = 1'b0; assign user_led[1] = 1'b0; assign user_led[2] = 1'b0; -assign user_led[3] = 1'b0; +assign user_led[3] = ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1043,6 +1031,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/VCU108/fpga_10g/rtl/fpga_core.v b/fpga/mqnic/VCU108/fpga_10g/rtl/fpga_core.v index 0114a7b95..6e4d88c01 100644 --- a/fpga/mqnic/VCU108/fpga_10g/rtl/fpga_core.v +++ b/fpga/mqnic/VCU108/fpga_10g/rtl/fpga_core.v @@ -426,6 +426,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -686,19 +687,6 @@ qsfp_rb_drp_inst ( .drp_rdy(qsfp_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -772,7 +760,7 @@ assign pmod1[0] = ptp_perout_pulse; assign pmod1[7:1] = 0; assign led[6:0] = 0; -assign led[7] = pps_led_reg; +assign led[7] = ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1228,6 +1216,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/VCU118/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/VCU118/fpga_100g/rtl/fpga_core.v index d7464019e..026398039 100644 --- a/fpga/mqnic/VCU118/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/VCU118/fpga_100g/rtl/fpga_core.v @@ -406,6 +406,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -635,26 +636,13 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - assign pmod0[0] = ptp_perout_pulse; assign pmod0[7:1] = 0; assign pmod1[0] = ptp_perout_pulse; assign pmod1[7:1] = 0; -assign led[0] = pps_led_reg; -assign led[2:1] = 0; +assign led[6:0] = 0; +assign led[7] = ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1104,6 +1092,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/VCU118/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/VCU118/fpga_25g/rtl/fpga_core.v index 2e89fbfbd..ecd8fb682 100644 --- a/fpga/mqnic/VCU118/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/VCU118/fpga_25g/rtl/fpga_core.v @@ -495,6 +495,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -820,19 +821,6 @@ qsfp2_rb_drp_inst ( .drp_rdy(qsfp2_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -914,8 +902,8 @@ assign pmod0[7:1] = 0; assign pmod1[0] = ptp_perout_pulse; assign pmod1[7:1] = 0; -assign led[0] = pps_led_reg; -assign led[2:1] = 0; +assign led[6:0] = 0; +assign led[7] = ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1371,6 +1359,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/VCU1525/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/VCU1525/fpga_100g/rtl/fpga_core.v index f04d8ac6b..1a4cac832 100644 --- a/fpga/mqnic/VCU1525/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/VCU1525/fpga_100g/rtl/fpga_core.v @@ -395,6 +395,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -595,20 +596,7 @@ always @(posedge clk_250mhz) begin end end -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - -assign led[0] = pps_led_reg; +assign led[0] = ptp_pps_str; assign led[2:1] = 0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1059,6 +1047,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/VCU1525/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/VCU1525/fpga_25g/rtl/fpga_core.v index 54ce4d420..1f742de73 100644 --- a/fpga/mqnic/VCU1525/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/VCU1525/fpga_25g/rtl/fpga_core.v @@ -484,6 +484,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -780,19 +781,6 @@ qsfp1_rb_drp_inst ( .drp_rdy(qsfp1_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -869,7 +857,7 @@ end endgenerate -assign led[0] = pps_led_reg; +assign led[0] = ptp_pps_str; assign led[2:1] = 0; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1325,7 +1313,7 @@ core_inst ( .ptp_clk(ptp_clk), .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), - .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/XUPP3R/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/XUPP3R/fpga_100g/rtl/fpga_core.v index fb1bef79d..5d904e148 100644 --- a/fpga/mqnic/XUPP3R/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/XUPP3R/fpga_100g/rtl/fpga_core.v @@ -490,6 +490,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -843,21 +844,8 @@ always @(posedge clk_250mhz) begin end end -reg [27:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 161132812; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - assign led[2:0] = 3'b111; -assign led[3] = !pps_led_reg; +assign led[3] = !ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1315,6 +1303,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/XUPP3R/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/XUPP3R/fpga_25g/rtl/fpga_core.v index 3cbbfc9ef..0fcb328d1 100644 --- a/fpga/mqnic/XUPP3R/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/XUPP3R/fpga_25g/rtl/fpga_core.v @@ -638,6 +638,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -1183,19 +1184,6 @@ qsfp3_rb_drp_inst ( .drp_rdy(qsfp3_drp_rdy) ); -reg [27:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 161132812; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -1289,7 +1277,7 @@ end endgenerate assign led[2:0] = 3'b111; -assign led[3] = !pps_led_reg; +assign led[3] = !ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1745,6 +1733,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/ZCU106/fpga_pcie/rtl/fpga_core.v b/fpga/mqnic/ZCU106/fpga_pcie/rtl/fpga_core.v index 09d568e8d..cf85b09c0 100644 --- a/fpga/mqnic/ZCU106/fpga_pcie/rtl/fpga_core.v +++ b/fpga/mqnic/ZCU106/fpga_pcie/rtl/fpga_core.v @@ -387,6 +387,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -553,19 +554,6 @@ sfp_rb_drp_inst ( .drp_rdy(sfp_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -629,8 +617,8 @@ end endgenerate -assign led[0] = pps_led_reg; -assign led[7:1] = 0; +assign led[6:0] = 0; +assign led[7] = ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1082,6 +1070,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/ZCU106/fpga_zynqmp/rtl/fpga_core.v b/fpga/mqnic/ZCU106/fpga_zynqmp/rtl/fpga_core.v index 17c7e6c23..36010173e 100644 --- a/fpga/mqnic/ZCU106/fpga_zynqmp/rtl/fpga_core.v +++ b/fpga/mqnic/ZCU106/fpga_zynqmp/rtl/fpga_core.v @@ -376,6 +376,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -510,19 +511,6 @@ sfp_rb_drp_inst ( .drp_rdy(sfp_drp_rdy) ); -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 78125000; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -586,8 +574,8 @@ end endgenerate -assign led[0] = pps_led_reg; -assign led[7:1] = 0; +assign led[6:0] = 0; +assign led[7] = ptp_pps_str; wire [PORT_COUNT-1:0] eth_tx_clk; wire [PORT_COUNT-1:0] eth_tx_rst; @@ -1018,6 +1006,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/fb2CG/fpga_100g/rtl/fpga_core.v b/fpga/mqnic/fb2CG/fpga_100g/rtl/fpga_core.v index 49789a083..60d56cfae 100644 --- a/fpga/mqnic/fb2CG/fpga_100g/rtl/fpga_core.v +++ b/fpga/mqnic/fb2CG/fpga_100g/rtl/fpga_core.v @@ -410,6 +410,7 @@ end wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -693,24 +694,11 @@ bmc_spi_inst ( assign pps_out = ptp_perout_pulse[0]; assign pps_out_en = 1'b1; -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - assign led_red = 8'd0; assign led_green = 8'd0; -assign led_bmc[0] = pps_led_reg; +assign led_bmc[0] = ptp_pps_str; assign led_bmc[1] = 0; -assign led_exp[0] = !pps_led_reg; +assign led_exp[0] = !ptp_pps_str; assign led_exp[1] = 1'b1; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1161,6 +1149,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps), diff --git a/fpga/mqnic/fb2CG/fpga_25g/rtl/fpga_core.v b/fpga/mqnic/fb2CG/fpga_25g/rtl/fpga_core.v index 614684183..4c2dea050 100644 --- a/fpga/mqnic/fb2CG/fpga_25g/rtl/fpga_core.v +++ b/fpga/mqnic/fb2CG/fpga_25g/rtl/fpga_core.v @@ -499,6 +499,7 @@ wire axil_csr_rready; wire [PTP_TS_WIDTH-1:0] ptp_ts_96; wire ptp_ts_step; wire ptp_pps; +wire ptp_pps_str; wire [PTP_TS_WIDTH-1:0] ptp_sync_ts_96; wire ptp_sync_ts_step; wire ptp_sync_pps; @@ -878,19 +879,6 @@ qsfp_1_rb_drp_inst ( assign pps_out = ptp_perout_pulse[0]; assign pps_out_en = 1'b1; -reg [26:0] pps_led_counter_reg = 0; -reg pps_led_reg = 0; - -always @(posedge ptp_clk) begin - if (ptp_pps) begin - pps_led_counter_reg <= 80566406; - end else if (pps_led_counter_reg > 0) begin - pps_led_counter_reg <= pps_led_counter_reg - 1; - end - - pps_led_reg <= pps_led_counter_reg > 0; -end - generate if (TDMA_BER_ENABLE) begin @@ -968,9 +956,9 @@ endgenerate assign led_red = 8'd0; assign led_green = 8'd0; -assign led_bmc[0] = pps_led_reg; +assign led_bmc[0] = ptp_pps_str; assign led_bmc[1] = 0; -assign led_exp[0] = !pps_led_reg; +assign led_exp[0] = !ptp_pps_str; assign led_exp[1] = 1'b1; wire [PORT_COUNT-1:0] eth_tx_clk; @@ -1427,6 +1415,7 @@ core_inst ( .ptp_rst(ptp_rst), .ptp_sample_clk(ptp_sample_clk), .ptp_pps(ptp_pps), + .ptp_pps_str(ptp_pps_str), .ptp_ts_96(ptp_ts_96), .ptp_ts_step(ptp_ts_step), .ptp_sync_pps(ptp_sync_pps),