Skip to content

Commit

Permalink
Add register on PRBS checker output in 10G PHY RX to improve timing p…
Browse files Browse the repository at this point in the history
…erformance

Signed-off-by: Alex Forencich <[email protected]>
  • Loading branch information
alexforencich committed Jan 15, 2024
1 parent a05d1a4 commit 74936e8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions rtl/eth_phy_10g_rx_if.v
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ wire [57:0] scrambler_state;
reg [30:0] prbs31_state_reg = 31'h7fffffff;
wire [30:0] prbs31_state;
wire [DATA_WIDTH+HDR_WIDTH-1:0] prbs31_data;
reg [DATA_WIDTH+HDR_WIDTH-1:0] prbs31_data_reg = 0;

reg [6:0] rx_error_count_reg = 0;
reg [5:0] rx_error_count_1_reg = 0;
Expand Down Expand Up @@ -193,9 +194,9 @@ always @* begin
rx_error_count_2_temp = 0;
for (i = 0; i < DATA_WIDTH+HDR_WIDTH; i = i + 1) begin
if (i & 1) begin
rx_error_count_1_temp = rx_error_count_1_temp + prbs31_data[i];
rx_error_count_1_temp = rx_error_count_1_temp + prbs31_data_reg[i];
end else begin
rx_error_count_2_temp = rx_error_count_2_temp + prbs31_data[i];
rx_error_count_2_temp = rx_error_count_2_temp + prbs31_data_reg[i];
end
end
end
Expand All @@ -206,12 +207,19 @@ always @(posedge clk) begin
encoded_rx_data_reg <= SCRAMBLER_DISABLE ? serdes_rx_data_int : descrambled_rx_data;
encoded_rx_hdr_reg <= serdes_rx_hdr_int;

if (PRBS31_ENABLE && cfg_rx_prbs31_enable) begin
prbs31_state_reg <= prbs31_state;
if (PRBS31_ENABLE) begin
if (cfg_rx_prbs31_enable) begin
prbs31_state_reg <= prbs31_state;
prbs31_data_reg <= prbs31_data;
end else begin
prbs31_data_reg <= 0;
end

rx_error_count_1_reg <= rx_error_count_1_temp;
rx_error_count_2_reg <= rx_error_count_2_temp;
rx_error_count_reg <= rx_error_count_1_reg + rx_error_count_2_reg;
end else begin
rx_error_count_reg <= 0;
end
end

Expand Down

0 comments on commit 74936e8

Please sign in to comment.