Skip to content

Commit

Permalink
util_axis_fifo: Add REMOVE_NULL_BEAT_EN feature
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Istvan Csomortani authored and Csomi committed Mar 8, 2021
1 parent 9611be9 commit 61c07ff
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions library/util_axis_fifo/util_axis_fifo.v
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 */
Expand All @@ -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 #(
Expand Down

0 comments on commit 61c07ff

Please sign in to comment.