From 6e984f2f938b19f8e01b9ef30dd5b2cf96099a51 Mon Sep 17 00:00:00 2001 From: Istvan-Zsolt Szekely Date: Tue, 19 Mar 2024 07:06:40 +0000 Subject: [PATCH] util_axis_fifo_asym: Fixes - Rounded up the almost empty and full threshold values - Fixed the tlast signal on the master side Signed-off-by: Istvan-Zsolt Szekely --- library/util_axis_fifo_asym/util_axis_fifo_asym.v | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/util_axis_fifo_asym/util_axis_fifo_asym.v b/library/util_axis_fifo_asym/util_axis_fifo_asym.v index b6e548cabb..30b3564d23 100644 --- a/library/util_axis_fifo_asym/util_axis_fifo_asym.v +++ b/library/util_axis_fifo_asym/util_axis_fifo_asym.v @@ -81,8 +81,8 @@ module util_axis_fifo_asym #( localparam A_ADDRESS = (ADDRESS_WIDTH_PERSPECTIVE) ? ((FIFO_LIMITED) ? ((RATIO_TYPE) ? (ADDRESS_WIDTH-$clog2(RATIO)) : ADDRESS_WIDTH) : ADDRESS_WIDTH) : ((FIFO_LIMITED) ? ((RATIO_TYPE) ? ADDRESS_WIDTH : (ADDRESS_WIDTH-$clog2(RATIO))) : ADDRESS_WIDTH); - localparam A_ALMOST_FULL_THRESHOLD = (RATIO_TYPE) ? ALMOST_FULL_THRESHOLD : (ALMOST_FULL_THRESHOLD/RATIO); - localparam A_ALMOST_EMPTY_THRESHOLD = (RATIO_TYPE) ? (ALMOST_EMPTY_THRESHOLD/RATIO) : ALMOST_EMPTY_THRESHOLD; + localparam A_ALMOST_FULL_THRESHOLD = (RATIO_TYPE) ? ALMOST_FULL_THRESHOLD : ((ALMOST_FULL_THRESHOLD+RATIO-1)/RATIO); + localparam A_ALMOST_EMPTY_THRESHOLD = (RATIO_TYPE) ? ((ALMOST_EMPTY_THRESHOLD+RATIO-1)/RATIO) : ALMOST_EMPTY_THRESHOLD; // slave and master sequencers reg [$clog2(RATIO)-1:0] s_axis_counter; @@ -150,7 +150,7 @@ module util_axis_fifo_asym #( for (i=0; i> m_axis_counter; + assign m_axis_tlast = m_axis_tlast_int_s >> m_axis_counter; // the FIFO has the same level as the last atomic instance // (NOTE: this is not the real level value, rather the value will be updated @@ -244,9 +245,10 @@ module util_axis_fifo_asym #( // the FIFO has the same room as the atomic FIFO assign m_axis_level = m_axis_level_int_s[A_ADDRESS-1:0]; + assign m_axis_tlast = (m_axis_valid) ? |m_axis_tlast_int_s : 1'b0; + end - assign m_axis_tlast = (m_axis_valid) ? |m_axis_tlast_int_s : 1'b0; endgenerate // slave handshake counter