Fixed lint errors on zero and pop count. All of regression passes

This commit is contained in:
Kip Macsai-Goren 2023-02-22 20:25:51 -08:00
parent 6b047065ef
commit 67f83cda7f

View File

@ -79,9 +79,12 @@ module cnt #(parameter WIDTH = 32) (
end end
end end
//NOTE: Signal width mistmatch from log2(WIDTH) to WIDTH but deal with that later.
lzc #(WIDTH) lzc(.num(lzcA), .ZeroCnt(czResult)); lzc #(WIDTH) lzc(.num(lzcA), .ZeroCnt(czResult[$clog2(WIDTH):0]));
popcnt #(WIDTH) popcntw(.num(popcntA), .PopCnt(cpopResult)); popcnt #(WIDTH) popcntw(.num(popcntA), .PopCnt(cpopResult[$clog2(WIDTH):0]));
// zero extend these results to fit into width *** There may be a more elegant way to do this
assign czResult[WIDTH-1:$clog2(WIDTH)+1] = {(WIDTH-$clog2(WIDTH)-1){1'b0}};
assign cpopResult[WIDTH-1:$clog2(WIDTH)+1] = {(WIDTH-$clog2(WIDTH)-1){1'b0}};
assign CntResult = (B[1]) ? cpopResult : czResult; assign CntResult = (B[1]) ? cpopResult : czResult;