11 use IEEE.STD_LOGIC_1164.
all;
12 use ieee.numeric_std.
all;
16 constant IPBUS_SEL_WIDTH: positive := 4;
17 subtype ipbus_sel_t is std_logic_vector(IPBUS_SEL_WIDTH - 1 downto 0);
18 function ipbus_sel_L1CaloEfexProcessor(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t;
21 constant N_SLV_COMMON_ID_VERSION: integer := 0;
22 constant N_SLV_COMMON_INFRA: integer := 1;
23 constant N_SLV_EFEX_ALGORITHM: integer := 2;
24 constant N_SLV_EFEX_SORTING: integer := 3;
25 constant N_SLV_EFEX_MGT_TOP: integer := 4;
26 constant N_SLV_EFEX_READOUT: integer := 5;
27 constant N_SLV_EFEX_LIB_VERSION: integer := 6;
28 constant N_SLV_EFEX_MERGING: integer := 7;
29 constant N_SLAVES: integer := 8;
37 function ipbus_sel_L1CaloEfexProcessor(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t
is
38 variable sel: ipbus_sel_t;
42 if std_match
(addr,
"-------------000000-------------") then
43 sel := ipbus_sel_t
(to_unsigned
(N_SLV_COMMON_ID_VERSION, IPBUS_SEL_WIDTH
));
-- common_id_version / base 0x00000000 / mask 0x0007e000
44 elsif std_match
(addr,
"-------------000001-------------") then
45 sel := ipbus_sel_t
(to_unsigned
(N_SLV_COMMON_INFRA, IPBUS_SEL_WIDTH
));
-- common_infra / base 0x00002000 / mask 0x0007e000
46 elsif std_match
(addr,
"-------------00001--------------") then
47 sel := ipbus_sel_t
(to_unsigned
(N_SLV_EFEX_ALGORITHM, IPBUS_SEL_WIDTH
));
-- efex_algorithm / base 0x00004000 / mask 0x0007c000
48 elsif std_match
(addr,
"-------------00010--------------") then
49 sel := ipbus_sel_t
(to_unsigned
(N_SLV_EFEX_SORTING, IPBUS_SEL_WIDTH
));
-- efex_sorting / base 0x00008000 / mask 0x0007c000
50 elsif std_match
(addr,
"-------------010----------------") then
51 sel := ipbus_sel_t
(to_unsigned
(N_SLV_EFEX_MGT_TOP, IPBUS_SEL_WIDTH
));
-- efex_mgt_top / base 0x00020000 / mask 0x00070000
52 elsif std_match
(addr,
"-------------1000---------------") then
53 sel := ipbus_sel_t
(to_unsigned
(N_SLV_EFEX_READOUT, IPBUS_SEL_WIDTH
));
-- efex_readout / base 0x00040000 / mask 0x00078000
54 elsif std_match
(addr,
"-------------101000-------------") then
55 sel := ipbus_sel_t
(to_unsigned
(N_SLV_EFEX_LIB_VERSION, IPBUS_SEL_WIDTH
));
-- efex_lib_version / base 0x00050000 / mask 0x0007e000
56 elsif std_match
(addr,
"-------------10101--------------") then
57 sel := ipbus_sel_t
(to_unsigned
(N_SLV_EFEX_MERGING, IPBUS_SEL_WIDTH
));
-- efex_merging / base 0x00054000 / mask 0x0007c000
61 sel := ipbus_sel_t
(to_unsigned
(N_SLAVES, IPBUS_SEL_WIDTH
));
66 end function ipbus_sel_L1CaloEfexProcessor;