diff --git a/library/common/ad_mem.v b/library/common/ad_mem.v index d4aa8d41c3..7150cbe39f 100644 --- a/library/common/ad_mem.v +++ b/library/common/ad_mem.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2014-2024 Analog Devices, Inc. All rights reserved. // // In this HDL repository, there are many different and unique modules, consisting // of various HDL (Verilog or VHDL) components. The individual modules are @@ -54,6 +54,14 @@ module ad_mem #( (* ram_style = "block" *) reg [(DATA_WIDTH-1):0] m_ram[0:((2**ADDRESS_WIDTH)-1)]; + integer i; + initial + for (i = 0; i < 2 ** ADDRESS_WIDTH; i = i+1) + m_ram[i] = {DATA_WIDTH{1'b0}}; + + initial + doutb <= {DATA_WIDTH{1'b0}}; + always @(posedge clka) begin if (wea == 1'b1) begin m_ram[addra] <= dina; diff --git a/library/data_offload/data_offload.v b/library/data_offload/data_offload.v index d4682f7e13..4a091e60e0 100644 --- a/library/data_offload/data_offload.v +++ b/library/data_offload/data_offload.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2021-2023 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2021-2024 Analog Devices, Inc. All rights reserved. // // In this HDL repository, there are many different and unique modules, consisting // of various HDL (Verilog or VHDL) components. The individual modules are @@ -250,7 +250,7 @@ module data_offload #( // it's supported just with the FIFO interface util_axis_fifo_asym #( .S_DATA_WIDTH (SRC_DATA_WIDTH), - .S_ADDRESS_WIDTH (SRC_ADDR_WIDTH_BYPASS), + .ADDRESS_WIDTH (SRC_ADDR_WIDTH_BYPASS), .M_DATA_WIDTH (DST_DATA_WIDTH), .ASYNC_CLK (1) ) i_bypass_fifo ( diff --git a/library/util_axis_fifo/util_axis_fifo.v b/library/util_axis_fifo/util_axis_fifo.v index a130779116..730357c077 100644 --- a/library/util_axis_fifo/util_axis_fifo.v +++ b/library/util_axis_fifo/util_axis_fifo.v @@ -154,7 +154,7 @@ module util_axis_fifo #( // TKEEP support if (TKEEP_EN) begin - reg axis_tkeep_d; + reg [DATA_WIDTH/8-1:0] axis_tkeep_d; always @(posedge s_axis_aclk) begin if (s_axis_ready == 1'b1 && s_axis_valid == 1'b1) @@ -210,7 +210,7 @@ module util_axis_fifo #( // TKEEP support if (TKEEP_EN) begin - reg axis_tkeep_d; + reg [DATA_WIDTH/8-1:0] axis_tkeep_d; always @(posedge s_axis_aclk) begin if (!s_axis_aresetn) begin 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 c297d64e81..bf7273a685 100644 --- a/library/util_axis_fifo_asym/util_axis_fifo_asym.v +++ b/library/util_axis_fifo_asym/util_axis_fifo_asym.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2021-2023 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2021-2024 Analog Devices, Inc. All rights reserved. // // In this HDL repository, there are many different and unique modules, consisting // of various HDL (Verilog or VHDL) components. The individual modules are @@ -37,13 +37,15 @@ module util_axis_fifo_asym #( parameter ASYNC_CLK = 1, parameter S_DATA_WIDTH = 64, - parameter S_ADDRESS_WIDTH = 5, + parameter ADDRESS_WIDTH = 5, parameter M_DATA_WIDTH = 128, parameter M_AXIS_REGISTERED = 1, parameter ALMOST_EMPTY_THRESHOLD = 4, parameter ALMOST_FULL_THRESHOLD = 4, parameter TLAST_EN = 0, - parameter TKEEP_EN = 0 + parameter TKEEP_EN = 0, + parameter FIFO_LIMITED = 0, + parameter ADDRESS_WIDTH_PERSPECTIVE = 0 ) ( input m_axis_aclk, input m_axis_aresetn, @@ -65,7 +67,7 @@ module util_axis_fifo_asym #( input s_axis_tlast, output s_axis_full, output s_axis_almost_full, - output [S_ADDRESS_WIDTH-1:0] s_axis_room + output [ADDRESS_WIDTH-1:0] s_axis_room ); // define which interface has a wider bus @@ -76,9 +78,11 @@ module util_axis_fifo_asym #( // atomic parameters - NOTE: depth is always defined by the slave attributes localparam A_WIDTH = (RATIO_TYPE) ? M_DATA_WIDTH : S_DATA_WIDTH; - localparam A_ADDRESS = (RATIO_TYPE) ? S_ADDRESS_WIDTH : (S_ADDRESS_WIDTH-$clog2(RATIO)); - 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_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-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; @@ -102,6 +106,8 @@ module util_axis_fifo_asym #( wire [RATIO-1:0] s_axis_almost_full_int_s; wire [RATIO*A_ADDRESS-1:0] s_axis_room_int_s; + wire m_axis_valid_int; + // instantiate the FIFOs genvar i; generate @@ -146,7 +152,17 @@ module util_axis_fifo_asym #( for (i=0; i> s_axis_counter; + // disable read enable if the TLAST arrives before address handshake occurs + assign s_axis_ready = (s_axis_tlast) ? &(s_axis_ready_int_s) : s_axis_ready_int_s >> s_axis_counter; + + // FULL/ALMOST_FULL is driven by the current atomic instance assign s_axis_almost_full = s_axis_almost_full_int_s >> s_axis_counter; // the FIFO has the same room as the last atomic instance @@ -207,7 +225,9 @@ module util_axis_fifo_asym #( assign m_axis_tkeep = m_axis_tkeep_int_s >> (m_axis_counter*A_WIDTH/8) ; // VALID/EMPTY/ALMOST_EMPTY is driven by the current atomic instance - assign m_axis_valid = m_axis_valid_int_s >> m_axis_counter; + assign m_axis_valid_int = m_axis_valid_int_s >> m_axis_counter; + assign m_axis_valid = m_axis_valid_int & (|m_axis_tkeep); + 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 @@ -219,12 +239,12 @@ module util_axis_fifo_asym #( end else begin : big_master for (i=0; i