Modified log2 coding to avoid synthesis warning

This commit is contained in:
David Harris 2023-10-19 11:16:02 -07:00
parent 8f717c3254
commit 6e7c0547a1

View File

@ -70,8 +70,10 @@ module cacheLRU
// coverage off
// Excluded from coverage b/c it is untestable without varying NUMWAYS.
function integer log2 (integer value);
for (log2=0; value>0; log2=log2+1)
value = value>>1;
int val;
val = value;
for (log2 = 0; val > 0; log2 = log2+1)
val = val >> 1;
return log2;
endfunction // log2
// coverage on