From 61c07ff9f112eae0e51d63c24d1eb019c7ed3fa8 Mon Sep 17 00:00:00 2001 From: Istvan Csomortani Date: Wed, 3 Mar 2021 10:41:30 +0000 Subject: [PATCH] util_axis_fifo: Add REMOVE_NULL_BEAT_EN feature If the REMOVE_NULL_BEAT_EN is set, in FIFO mode, all the beats with a NULL TKEEP will be removed from the AXI stream. This feature is used initially in data_offload, to create a continues and cyclic TX data stream for DACs, when the IPs in the path have different data widths. --- library/util_axis_fifo/util_axis_fifo.v | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/library/util_axis_fifo/util_axis_fifo.v b/library/util_axis_fifo/util_axis_fifo.v index c1f35f6b4..d4ad8b75a 100644 --- a/library/util_axis_fifo/util_axis_fifo.v +++ b/library/util_axis_fifo/util_axis_fifo.v @@ -42,7 +42,8 @@ module util_axis_fifo #( parameter [ADDRESS_WIDTH-1:0] ALMOST_EMPTY_THRESHOLD = 16, parameter [ADDRESS_WIDTH-1:0] ALMOST_FULL_THRESHOLD = 16, parameter TLAST_EN = 0, - parameter TKEEP_EN = 0 + parameter TKEEP_EN = 0, + parameter REMOVE_NULL_BEAT_EN = 0 ) ( input m_axis_aclk, input m_axis_aresetn, @@ -221,9 +222,9 @@ generate if (ADDRESS_WIDTH == 0) begin : zerodeep /* it's not a real FIFO, just end end assign m_axis_tkeep = axis_tkeep_d; - + end - + end /* !ASYNC_CLK */ end else begin : fifo /* ADDRESS_WIDTH != 0 - this is a real FIFO implementation */ @@ -250,7 +251,12 @@ end else begin : fifo /* ADDRESS_WIDTH != 0 - this is a real FIFO implementation end end - assign s_mem_write = s_axis_ready & s_axis_valid; + if (REMOVE_NULL_BEAT_EN) begin + // remove NULL bytes from the stream - NOTE: TKEEP is all-LOW or all-HIGH + assign s_mem_write = s_axis_ready & s_axis_valid & (&s_axis_tkeep); + end else begin + assign s_mem_write = s_axis_ready & s_axis_valid; + end assign m_mem_read = (~valid || m_axis_ready) && _m_axis_valid; util_axis_fifo_address_generator #(