-- package containing hardware-oriented spec types library IEEE; use IEEE.std_logic_1164.all; package reg_file_pkg is constant depth : integer := 32; constant data_width : integer := 8; function log_2 (x : positive) return natural; type std_logic_2D_array is array (integer range <>, integer range <>) of std_logic; end reg_file_pkg; package body reg_file_pkg is function log_2 (x : positive) return natural is begin if x <= 1 then return 0; else return log_2 (x / 2) + 1; end if; end function log_2; end package body reg_file_pkg;