library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; package sdram_util is subtype uint3_t is integer range 0 to 7; subtype uint4_t is integer range 0 to 15; subtype uint8_t is integer range 0 to 255; subtype uint13_t is integer range 0 to 8191; subtype cs_n_t is std_logic_vector(0 downto 0); subtype addr_t is std_logic_vector(23 downto 0); subtype data_t is std_logic_vector(15 downto 0); subtype dqm_t is std_logic_vector(1 downto 0); function b2l_ah(constant val : in boolean) return std_logic; function l2b_ah(constant val : in std_logic) return boolean; function l2b_al(constant val : in std_logic) return boolean; end package; package body sdram_util is -- convert boolean to active high logic function b2l_ah(constant val : in boolean) return std_logic is begin if val then return '1'; else return '0'; end if; end function; -- convert active high logic to boolean value function l2b_ah(constant val : in std_logic) return boolean is begin return val='1'; end function; function l2b_al(constant val : in std_logic) return boolean is begin return val='0'; end function; end package body;