common_cells icon indicating copy to clipboard operation
common_cells copied to clipboard

a bug in lzc module?

Open allensted opened this issue 2 years ago • 0 comments

in lzc module the comment says: /// If the input does not contain a zero, empty_o is asserted. Additionally cnt_o contains /// the maximum number of zeros - 1. if the WIDTH is power of 2, it works fine image

but if the WIDTH is not the power of 2,i.e WIDTH is 29 when in_i is empty, cnt_o is zero instead of 29-1 image

because in the rtl // if index is out of range if (unsigned'(k) * 2 > WIDTH - 1) begin : g_out_of_range assign sel_nodes[2 ** level - 1 + k] = 1'b0; assign index_nodes[2 ** level - 1 + k] = '0; // why not assign index_nodes[2 ** level - 1 + k] = WIDTH-1; end

allensted avatar Apr 26 '23 03:04 allensted