pcs: tx: Process link failure synchronously

There's no strict requirement for us to handle linke failures immediately.
The PMA's link timer will ensure the signal stays low, so we don't have to
worry about missing it. This fixes some strange Xs during initialization.

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2022-08-06 14:51:23 -04:00
parent 1d65661bd3
commit 0dea0304af
1 changed files with 7 additions and 6 deletions

View File

@ -209,14 +209,15 @@ module pcs_tx (
end
endcase
if (!link_status) begin
tx_next = 0;
code_next = `CODE_I;
state_next = IDLE;
end
end
always @(posedge clk, negedge link_status) begin
if (!link_status) begin
tx <= 0;
code <= `CODE_I;
state <= IDLE;
end else if (ce) begin
always @(posedge clk) begin
if (ce) begin
last_data <= data;
tx <= tx_next;
code <= code_next;