Skip to content

Commit 61c07ff

Browse files
Istvan CsomortaniCsomi
authored andcommitted
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.
1 parent 9611be9 commit 61c07ff

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

library/util_axis_fifo/util_axis_fifo.v

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ module util_axis_fifo #(
4242
parameter [ADDRESS_WIDTH-1:0] ALMOST_EMPTY_THRESHOLD = 16,
4343
parameter [ADDRESS_WIDTH-1:0] ALMOST_FULL_THRESHOLD = 16,
4444
parameter TLAST_EN = 0,
45-
parameter TKEEP_EN = 0
45+
parameter TKEEP_EN = 0,
46+
parameter REMOVE_NULL_BEAT_EN = 0
4647
) (
4748
input m_axis_aclk,
4849
input m_axis_aresetn,
@@ -221,9 +222,9 @@ generate if (ADDRESS_WIDTH == 0) begin : zerodeep /* it's not a real FIFO, just
221222
end
222223
end
223224
assign m_axis_tkeep = axis_tkeep_d;
224-
225+
225226
end
226-
227+
227228
end /* !ASYNC_CLK */
228229

229230
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
250251
end
251252
end
252253

253-
assign s_mem_write = s_axis_ready & s_axis_valid;
254+
if (REMOVE_NULL_BEAT_EN) begin
255+
// remove NULL bytes from the stream - NOTE: TKEEP is all-LOW or all-HIGH
256+
assign s_mem_write = s_axis_ready & s_axis_valid & (&s_axis_tkeep);
257+
end else begin
258+
assign s_mem_write = s_axis_ready & s_axis_valid;
259+
end
254260
assign m_mem_read = (~valid || m_axis_ready) && _m_axis_valid;
255261

256262
util_axis_fifo_address_generator #(

0 commit comments

Comments
 (0)