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.
main
Istvan Csomortani 2021-03-03 10:41:30 +00:00 committed by István Csomortáni
parent 9611be9ded
commit 61c07ff9f1
1 changed files with 10 additions and 4 deletions

View File

@ -42,7 +42,8 @@ module util_axis_fifo #(
parameter [ADDRESS_WIDTH-1:0] ALMOST_EMPTY_THRESHOLD = 16, parameter [ADDRESS_WIDTH-1:0] ALMOST_EMPTY_THRESHOLD = 16,
parameter [ADDRESS_WIDTH-1:0] ALMOST_FULL_THRESHOLD = 16, parameter [ADDRESS_WIDTH-1:0] ALMOST_FULL_THRESHOLD = 16,
parameter TLAST_EN = 0, 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_aclk,
input m_axis_aresetn, input m_axis_aresetn,
@ -250,7 +251,12 @@ end else begin : fifo /* ADDRESS_WIDTH != 0 - this is a real FIFO implementation
end end
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; assign m_mem_read = (~valid || m_axis_ready) && _m_axis_valid;
util_axis_fifo_address_generator #( util_axis_fifo_address_generator #(