mirror of
https://github.com/alexforencich/verilog-ethernet.git
synced 2025-01-14 06:43:18 +08:00
Fix FIFO output pause logic
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
parent
7823b916bf
commit
e493c6cdb4
@ -861,17 +861,20 @@ if (PAUSE_ENABLE) begin : pause
|
|||||||
|
|
||||||
always @(posedge m_clk) begin
|
always @(posedge m_clk) begin
|
||||||
if (FRAME_PAUSE) begin
|
if (FRAME_PAUSE) begin
|
||||||
if (m_axis_tvalid && m_axis_tready) begin
|
if (pause_reg) begin
|
||||||
if (m_axis_tlast) begin
|
// paused; update pause status
|
||||||
|
pause_reg <= m_pause_req || s_pause_req_sync3_reg;
|
||||||
|
end else if (m_axis_tvalid_out) begin
|
||||||
|
// frame transfer; set frame bit
|
||||||
|
pause_frame_reg <= 1'b1;
|
||||||
|
if (m_axis_tready && m_axis_tlast) begin
|
||||||
|
// end of frame; clear frame bit and update pause status
|
||||||
pause_frame_reg <= 1'b0;
|
pause_frame_reg <= 1'b0;
|
||||||
pause_reg <= m_pause_req || s_pause_req_sync3_reg;
|
pause_reg <= m_pause_req || s_pause_req_sync3_reg;
|
||||||
end else begin
|
|
||||||
pause_frame_reg <= 1'b1;
|
|
||||||
end
|
|
||||||
end else begin
|
|
||||||
if (!pause_frame_reg) begin
|
|
||||||
pause_reg <= m_pause_req || s_pause_req_sync3_reg;
|
|
||||||
end
|
end
|
||||||
|
end else if (!pause_frame_reg) begin
|
||||||
|
// idle; update pause status
|
||||||
|
pause_reg <= m_pause_req || s_pause_req_sync3_reg;
|
||||||
end
|
end
|
||||||
end else begin
|
end else begin
|
||||||
pause_reg <= m_pause_req || s_pause_req_sync3_reg;
|
pause_reg <= m_pause_req || s_pause_req_sync3_reg;
|
||||||
|
@ -517,17 +517,20 @@ if (PAUSE_ENABLE) begin : pause
|
|||||||
|
|
||||||
always @(posedge clk) begin
|
always @(posedge clk) begin
|
||||||
if (FRAME_PAUSE) begin
|
if (FRAME_PAUSE) begin
|
||||||
if (m_axis_tvalid && m_axis_tready) begin
|
if (pause_reg) begin
|
||||||
if (m_axis_tlast) begin
|
// paused; update pause status
|
||||||
|
pause_reg <= pause_req;
|
||||||
|
end else if (m_axis_tvalid_out) begin
|
||||||
|
// frame transfer; set frame bit
|
||||||
|
pause_frame_reg <= 1'b1;
|
||||||
|
if (m_axis_tready && m_axis_tlast) begin
|
||||||
|
// end of frame; clear frame bit and update pause status
|
||||||
pause_frame_reg <= 1'b0;
|
pause_frame_reg <= 1'b0;
|
||||||
pause_reg <= pause_req;
|
pause_reg <= pause_req;
|
||||||
end else begin
|
|
||||||
pause_frame_reg <= 1'b1;
|
|
||||||
end
|
|
||||||
end else begin
|
|
||||||
if (!pause_frame_reg) begin
|
|
||||||
pause_reg <= pause_req;
|
|
||||||
end
|
end
|
||||||
|
end else if (!pause_frame_reg) begin
|
||||||
|
// idle; update pause status
|
||||||
|
pause_reg <= pause_req;
|
||||||
end
|
end
|
||||||
end else begin
|
end else begin
|
||||||
pause_reg <= pause_req;
|
pause_reg <= pause_req;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user