Skip to content
Snippets Groups Projects
Commit 35669405 authored by Matthieu Cattin's avatar Matthieu Cattin
Browse files

Fix bug in log2_ceil function. odd numbers were leading to stack overflow during synthesis

parent 530563df
Branches
Tags
No related merge requests found
......@@ -530,12 +530,10 @@ package body gn4124_core_pkg is
begin
if N <= 2 then
return 1;
elsif N mod 2 = 0 then
return 1 + log2_ceil(N/2);
else
if N mod 2 = 0 then
return 1 + log2_ceil(N/2);
else
return 1 + log2_ceil(N+1/2);
end if;
return 1 + log2_ceil((N+1)/2);
end if;
end;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment