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_lib_version(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t;
21 constant N_SLV_HOG: integer := 0;
22 constant N_SLV_CONSTRAINTS: integer := 1;
23 constant N_SLV_TOP: integer := 2;
24 constant N_SLV_INFRASTRUCTURE: integer := 3;
25 constant N_SLV_ALGORITHM: integer := 4;
26 constant N_SLV_READOUT: integer := 5;
27 constant N_SLV_IPBUS: integer := 6;
28 constant N_SLAVES: integer := 7;
36 function ipbus_sel_efex_lib_version(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t
is
37 variable sel: ipbus_sel_t;
41 if std_match
(addr,
"----------------------------000-") then
42 sel := ipbus_sel_t
(to_unsigned
(N_SLV_HOG, IPBUS_SEL_WIDTH
));
-- hog / base 0x00000000 / mask 0x0000000e
43 elsif std_match
(addr,
"----------------------------001-") then
44 sel := ipbus_sel_t
(to_unsigned
(N_SLV_CONSTRAINTS, IPBUS_SEL_WIDTH
));
-- constraints / base 0x00000002 / mask 0x0000000e
45 elsif std_match
(addr,
"----------------------------010-") then
46 sel := ipbus_sel_t
(to_unsigned
(N_SLV_TOP, IPBUS_SEL_WIDTH
));
-- top / base 0x00000004 / mask 0x0000000e
47 elsif std_match
(addr,
"----------------------------011-") then
48 sel := ipbus_sel_t
(to_unsigned
(N_SLV_INFRASTRUCTURE, IPBUS_SEL_WIDTH
));
-- infrastructure / base 0x00000006 / mask 0x0000000e
49 elsif std_match
(addr,
"----------------------------100-") then
50 sel := ipbus_sel_t
(to_unsigned
(N_SLV_ALGORITHM, IPBUS_SEL_WIDTH
));
-- algorithm / base 0x00000008 / mask 0x0000000e
51 elsif std_match
(addr,
"----------------------------101-") then
52 sel := ipbus_sel_t
(to_unsigned
(N_SLV_READOUT, IPBUS_SEL_WIDTH
));
-- readout / base 0x0000000a / mask 0x0000000e
53 elsif std_match
(addr,
"----------------------------110-") then
54 sel := ipbus_sel_t
(to_unsigned
(N_SLV_IPBUS, IPBUS_SEL_WIDTH
));
-- ipbus / base 0x0000000c / mask 0x0000000e
58 sel := ipbus_sel_t
(to_unsigned
(N_SLAVES, IPBUS_SEL_WIDTH
));
63 end function ipbus_sel_efex_lib_version;