diff --git a/docs/library/util_axis_fifo_asym/index.rst b/docs/library/util_axis_fifo_asym/index.rst index a59d973efe6..fcd00a42772 100644 --- a/docs/library/util_axis_fifo_asym/index.rst +++ b/docs/library/util_axis_fifo_asym/index.rst @@ -59,11 +59,8 @@ Configuration Parameters - Enable ``TLAST`` logical port on the AXI streaming interface. * - TKEEP_EN - Enable ``TKEEP`` logical port on the AXI streaming interface. - * - FIFO_LIMITED - - Enable the address limit that is set to the FIFO with respect to the - specified address size - * - ADDRESS_WIDTH_PERSPECTIVE - - Sets address size from the perspective of Master (1) or Slave (0) + * - REDUCED_FIFO + - Reduce the FIFO size when master and slave data widths are not equal Interface -------------------------------------------------------------------------------- @@ -112,13 +109,11 @@ blocks are calculated as follows: localparam RATIO_TYPE = (S_DATA_WIDTH >= M_DATA_WIDTH) ? 1 : 0; // bus width ratio localparam RATIO = (RATIO_TYPE) ? S_DATA_WIDTH/M_DATA_WIDTH : M_DATA_WIDTH/S_DATA_WIDTH; - // atomic parameters - NOTE: depth is defined by master or slave and limitation attributes + // atomic parameters localparam A_WIDTH = (RATIO_TYPE) ? M_DATA_WIDTH : S_DATA_WIDTH; - 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_ADDRESS = (REDUCED_FIFO) ? (ADDRESS_WIDTH-$clog2(RATIO)) : ADDRESS_WIDTH; + localparam A_ALMOST_FULL_THRESHOLD = (REDUCED_FIFO) ? ((ALMOST_FULL_THRESHOLD+RATIO-1)/RATIO) : ALMOST_FULL_THRESHOLD; + localparam A_ALMOST_EMPTY_THRESHOLD = (REDUCED_FIFO) ? ((ALMOST_EMPTY_THRESHOLD+RATIO-1)/RATIO) : ALMOST_EMPTY_THRESHOLD; Status Signal Delays ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -141,10 +136,10 @@ destination logic: empty FIFO all the read operations are suspended. - ALMOST_EMPTY/ALMOST_FULL - It can be used to foresee a potential FULL or EMPTY state, asserting before the EMPTY/FULL before a predefined number of - word. The offset between ALMOST_EMPTY and EMPTY, and between ALMOST_FULL and + words. The offset between ALMOST_EMPTY and EMPTY, and between ALMOST_FULL and FULL can be set by using the parameters ALMOST_EMPTY_THRESHOLD and - ALMOST_FULL_THRESHOLD. The offset values are automatically adjusted - according to M_DATA_WIDTH and S_DATA_WIDTH ratio. + ALMOST_FULL_THRESHOLD. The offset values are automatically adjusted according + to M_DATA_WIDTH and S_DATA_WIDTH ratio when REDUCED_FIFO is enabled. - S_AXIS_ROOM - Indicate how many word can be written in the FIFO at the current moment, until the FIFO become FULL. - M_AXIS_LEVEL - Indicate how many word can be read from the FIFO at the @@ -153,25 +148,14 @@ destination logic: FIFO Depth Calculation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The FIFO Depth is calculated based on parameters M_DATA_WIDTH, S_DATA_WIDTH, -ADDRESS_WIDTH, FIFO_LIMITED and ADDRESS_WIDTH_PERSPECTIVE: - -- ADDRESS_WIDTH_PERSPECTIVE is 1 and FIFO_LIMITED is 1 - This means that the - address specified is from the perspective of the Master interface. Since - the limit is enabled the FIFO size will be reduced if the S_DATA_WIDTH - is > M_DATA_WIDTH, leading to a smaller FIFO implementation. -- ADDRESS_WIDTH_PERSPECTIVE is 1 and FIFO_LIMITED is 0 - This means that the - address specified is from the perspective of the Master interface. Since - the limit is disabled the FIFO size will remain the same if the S_DATA_WIDTH - is > M_DATA_WIDTH, leading to a bigger FIFO implementation. -- ADDRESS_WIDTH_PERSPECTIVE is 0 and FIFO_LIMITED is 1 - This means that the - address specified is from the perspective of the Slave interface. Since - the limit is enabled the FIFO size will be reduced if the S_DATA_WIDTH - is < M_DATA_WIDTH, leading to a smaller FIFO implementation. -- ADDRESS_WIDTH_PERSPECTIVE is 0 and FIFO_LIMITED is 0 - This means that the - address specified is from the perspective of the Slave interface. Since - the limit is disabled the FIFO size will remain the same if the S_DATA_WIDTH - is < M_DATA_WIDTH, leading to a bigger FIFO implementation. +The FIFO Depth is calculated based on M_DATA_WIDTH, S_DATA_WIDTH, +ADDRESS_WIDTH and REDUCED_FIFO parameters: + +- When M_DATA_WIDTH and S_DATA_WIDTH are equal or REDUCED_FIFO is disabled, the + ADDRESS_WIDTH specified is not changed. +- When M_DATA_WIDTH and S_DATA_WIDTH are not equal and the REDUCED_FIFO is + enabled, the ADDRESS_WIDTH is reduced by log2 ratio of the master and slave + data widths. Software Support -------------------------------------------------------------------------------- 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 1e8d2e7f5fd..cb6b13f078b 100644 --- a/library/util_axis_fifo_asym/util_axis_fifo_asym.v +++ b/library/util_axis_fifo_asym/util_axis_fifo_asym.v @@ -44,8 +44,7 @@ module util_axis_fifo_asym #( parameter ALMOST_FULL_THRESHOLD = 4, parameter TLAST_EN = 0, parameter TKEEP_EN = 0, - parameter FIFO_LIMITED = 0, - parameter ADDRESS_WIDTH_PERSPECTIVE = 0 + parameter REDUCED_FIFO = 1 ) ( input m_axis_aclk, input m_axis_aresetn, @@ -76,13 +75,11 @@ module util_axis_fifo_asym #( // bus width ratio localparam RATIO = (RATIO_TYPE) ? S_DATA_WIDTH/M_DATA_WIDTH : M_DATA_WIDTH/S_DATA_WIDTH; - // atomic parameters - NOTE: depth is always defined by the slave attributes + // atomic parameters localparam A_WIDTH = (RATIO_TYPE) ? M_DATA_WIDTH : S_DATA_WIDTH; - 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; + localparam A_ADDRESS = (REDUCED_FIFO) ? (ADDRESS_WIDTH-$clog2(RATIO)) : ADDRESS_WIDTH; + localparam A_ALMOST_FULL_THRESHOLD = (REDUCED_FIFO) ? ((ALMOST_FULL_THRESHOLD+RATIO-1)/RATIO) : ALMOST_FULL_THRESHOLD; + localparam A_ALMOST_EMPTY_THRESHOLD = (REDUCED_FIFO) ? ((ALMOST_EMPTY_THRESHOLD+RATIO-1)/RATIO) : ALMOST_EMPTY_THRESHOLD; // slave and master sequencers reg [$clog2(RATIO)-1:0] s_axis_counter; diff --git a/library/util_axis_fifo_asym/util_axis_fifo_asym_ip.tcl b/library/util_axis_fifo_asym/util_axis_fifo_asym_ip.tcl index db33723d5a0..add51e7084d 100644 --- a/library/util_axis_fifo_asym/util_axis_fifo_asym_ip.tcl +++ b/library/util_axis_fifo_asym/util_axis_fifo_asym_ip.tcl @@ -49,39 +49,21 @@ adi_add_bus_clock "s_axis_aclk" "s_axis" "s_axis_aresetn" set cc [ipx::current_core] -# FIFO_LIMITED Property +# REDUCED_FIFO Property set_property -dict [list \ "value_format" "bool" \ "value" "false" \ -] [ipx::get_user_parameters FIFO_LIMITED -of_objects $cc] +] [ipx::get_user_parameters REDUCED_FIFO -of_objects $cc] set_property -dict [list \ "value_format" "bool" \ "value" "false" \ -] [ipx::get_hdl_parameters FIFO_LIMITED -of_objects $cc] +] [ipx::get_hdl_parameters REDUCED_FIFO -of_objects $cc] set_property -dict [list \ "display_name" "FIFO Sample Limited" \ "tooltip" "Limit the amount of samples the FIFO can accumulate. Enabling this bit may reduce the size of Address, Almost Empty Threshold and Almost Full Threshold depending on the Slave and Master data width ratio." \ -] [ipgui::get_guiparamspec -name "FIFO_LIMITED" -component $cc] - - -set_property -dict [list \ - "value_format" "bool" \ - "value" "false" \ -] [ipx::get_user_parameters ADDRESS_WIDTH_PERSPECTIVE -of_objects $cc] - -set_property -dict [list \ - "value_format" "bool" \ - "value" "false" \ -] [ipx::get_hdl_parameters ADDRESS_WIDTH_PERSPECTIVE -of_objects $cc] - -set_property -dict [list \ - "display_name" "Address Width Perspective" \ - "tooltip" "Sets the address width from the perspective of Master if True, or Slave if false." \ -] [ipgui::get_guiparamspec -name "ADDRESS_WIDTH_PERSPECTIVE" -component $cc] - -## TODO: Validate RD_ADDRESS_WIDTH +] [ipgui::get_guiparamspec -name "REDUCED_FIFO" -component $cc] ipx::create_xgui_files $cc ipx::save_core $cc