From e493c6cdb4fd20939b7b9a613e9ab6fd7395ada2 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Wed, 17 Jan 2024 12:17:11 -0800 Subject: [PATCH 1/2] Fix FIFO output pause logic Signed-off-by: Alex Forencich --- rtl/axis_async_fifo.v | 19 +++++++++++-------- rtl/axis_fifo.v | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/rtl/axis_async_fifo.v b/rtl/axis_async_fifo.v index 76eeb8d8..b73ae6cd 100644 --- a/rtl/axis_async_fifo.v +++ b/rtl/axis_async_fifo.v @@ -861,17 +861,20 @@ if (PAUSE_ENABLE) begin : pause always @(posedge m_clk) begin if (FRAME_PAUSE) begin - if (m_axis_tvalid && m_axis_tready) begin - if (m_axis_tlast) begin + if (pause_reg) 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_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 else if (!pause_frame_reg) begin + // idle; update pause status + pause_reg <= m_pause_req || s_pause_req_sync3_reg; end end else begin pause_reg <= m_pause_req || s_pause_req_sync3_reg; diff --git a/rtl/axis_fifo.v b/rtl/axis_fifo.v index e9c9258e..acac04a6 100644 --- a/rtl/axis_fifo.v +++ b/rtl/axis_fifo.v @@ -517,17 +517,20 @@ if (PAUSE_ENABLE) begin : pause always @(posedge clk) begin if (FRAME_PAUSE) begin - if (m_axis_tvalid && m_axis_tready) begin - if (m_axis_tlast) begin + if (pause_reg) 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_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 else if (!pause_frame_reg) begin + // idle; update pause status + pause_reg <= pause_req; end end else begin pause_reg <= pause_req; From a29282cddada7d678629b1b0fecddaeaa3229c46 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Wed, 17 Jan 2024 15:08:57 -0800 Subject: [PATCH 2/2] Remove stall cycle in axis_arb_mux Signed-off-by: Alex Forencich --- rtl/axis_arb_mux.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/axis_arb_mux.v b/rtl/axis_arb_mux.v index 4cf06905..1953313b 100644 --- a/rtl/axis_arb_mux.v +++ b/rtl/axis_arb_mux.v @@ -168,7 +168,7 @@ arb_inst ( .grant_encoded(grant_encoded) ); -assign request = (s_axis_tvalid_reg & ~grant) | (s_axis_tvalid & grant); +assign request = s_axis_tvalid | (s_axis_tvalid_reg & ~grant); assign acknowledge = grant & s_axis_tvalid_reg & {S_COUNT{m_axis_tready_int_reg}} & (LAST_ENABLE ? s_axis_tlast_reg : {S_COUNT{1'b1}}); always @* begin