11 use IEEE.STD_LOGIC_1164.
all;
12 use ieee.numeric_std.
all;
16 constant IPBUS_SEL_WIDTH: positive := 3;
17 subtype ipbus_sel_t is std_logic_vector(IPBUS_SEL_WIDTH - 1 downto 0);
18 function ipbus_sel_efex_common_id_version(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t;
21 constant N_SLV_MODULE_ID: integer := 0;
22 constant N_SLV_XML_VERSION: integer := 1;
23 constant N_SLV_BUILD_TIME_AND_DATE: integer := 2;
24 constant N_SLV_FIRMWARE_VERSION: integer := 3;
25 constant N_SLAVES: integer := 4;
33 function ipbus_sel_efex_common_id_version(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t
is
34 variable sel: ipbus_sel_t;
38 if std_match
(addr,
"-----------------------------00-") then
39 sel := ipbus_sel_t
(to_unsigned
(N_SLV_MODULE_ID, IPBUS_SEL_WIDTH
));
-- module_id / base 0x00000000 / mask 0x00000006
40 elsif std_match
(addr,
"-----------------------------01-") then
41 sel := ipbus_sel_t
(to_unsigned
(N_SLV_XML_VERSION, IPBUS_SEL_WIDTH
));
-- xml_version / base 0x00000002 / mask 0x00000006
42 elsif std_match
(addr,
"-----------------------------10-") then
43 sel := ipbus_sel_t
(to_unsigned
(N_SLV_BUILD_TIME_AND_DATE, IPBUS_SEL_WIDTH
));
-- build_time_and_date / base 0x00000004 / mask 0x00000006
44 elsif std_match
(addr,
"-----------------------------11-") then
45 sel := ipbus_sel_t
(to_unsigned
(N_SLV_FIRMWARE_VERSION, IPBUS_SEL_WIDTH
));
-- firmware_version / base 0x00000006 / mask 0x00000006
49 sel := ipbus_sel_t
(to_unsigned
(N_SLAVES, IPBUS_SEL_WIDTH
));
54 end function ipbus_sel_efex_common_id_version;