Commit a96c8849 authored by Dimitris Lampridis's avatar Dimitris Lampridis

[hdl] properly fix f_log2 functions from commit 888ea716

Signed-off-by: Dimitris Lampridis's avatarDimitris Lampridis <dimitris.lampridis@cern.ch>
parent 888ea716
...@@ -45,6 +45,8 @@ package gencores_pkg is ...@@ -45,6 +45,8 @@ package gencores_pkg is
function f_gray_encode(x : std_logic_vector) return std_logic_vector; function f_gray_encode(x : std_logic_vector) return std_logic_vector;
function f_gray_decode(x : std_logic_vector; step : natural) return std_logic_vector; function f_gray_decode(x : std_logic_vector; step : natural) return std_logic_vector;
function f_log2_ceil(N : natural) return positive;
-- kept for backwards compatibility, same as f_log2_ceil()
function log2_ceil(N : natural) return positive; function log2_ceil(N : natural) return positive;
function f_bool2int (b : boolean) return natural; function f_bool2int (b : boolean) return natural;
......
...@@ -26,6 +26,9 @@ library ieee; ...@@ -26,6 +26,9 @@ library ieee;
use ieee.std_logic_1164.all; use ieee.std_logic_1164.all;
use ieee.numeric_std.all; use ieee.numeric_std.all;
library work;
use work.gencores_pkg.all;
package genram_pkg is package genram_pkg is
function f_log2_size (A : natural) return natural; function f_log2_size (A : natural) return natural;
...@@ -251,7 +254,7 @@ package body genram_pkg is ...@@ -251,7 +254,7 @@ package body genram_pkg is
-- kept for backwards compatibility -- kept for backwards compatibility
function f_log2_size (A : natural) return natural is function f_log2_size (A : natural) return natural is
begin begin
return f_log2_ceil(N); return f_log2_ceil(A);
end function f_log2_size; end function f_log2_size;
function f_gen_dummy_vec (val : std_logic; size : natural) return std_logic_vector is function f_gen_dummy_vec (val : std_logic; size : natural) return std_logic_vector is
......
Markdown is supported
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