Moved serv to own tree
This commit is contained in:
10
rtl/util/clog2.vh
Normal file
10
rtl/util/clog2.vh
Normal file
@@ -0,0 +1,10 @@
|
||||
function integer clog2;
|
||||
input integer value;
|
||||
integer i;
|
||||
begin
|
||||
value = value - 1;
|
||||
for (i = 0; value > 0; i = i + 1)
|
||||
value = value >> 1;
|
||||
clog2 = (i < 1) ? 1 : i;
|
||||
end
|
||||
endfunction
|
||||
Reference in New Issue
Block a user