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_efex_cntrl_mgt_quad(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t;
21 constant N_SLV_QUAD_MGT_CONTROL: integer := 0;
22 constant N_SLV_QUAD_SYNCH_CONTROL: integer := 1;
23 constant N_SLV_QUAD_MGT_PULSE: integer := 2;
24 constant N_SLV_QUAD_MGT_STATUS: integer := 3;
25 constant N_SLV_GT0: integer := 4;
26 constant N_SLV_GT1: integer := 5;
27 constant N_SLV_GT2: integer := 6;
28 constant N_SLV_GT3: integer := 7;
29 constant N_SLAVES: integer := 8;
37 function ipbus_sel_efex_cntrl_mgt_quad(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t
is
38 variable sel: ipbus_sel_t;
42 if std_match
(addr,
"-------------------------000--00") then
43 sel := ipbus_sel_t
(to_unsigned
(N_SLV_QUAD_MGT_CONTROL, IPBUS_SEL_WIDTH
));
-- quad.mgt_control / base 0x00000000 / mask 0x00000073
44 elsif std_match
(addr,
"-------------------------000--01") then
45 sel := ipbus_sel_t
(to_unsigned
(N_SLV_QUAD_SYNCH_CONTROL, IPBUS_SEL_WIDTH
));
-- quad.synch_control / base 0x00000001 / mask 0x00000073
46 elsif std_match
(addr,
"-------------------------000--10") then
47 sel := ipbus_sel_t
(to_unsigned
(N_SLV_QUAD_MGT_PULSE, IPBUS_SEL_WIDTH
));
-- quad.mgt_pulse / base 0x00000002 / mask 0x00000073
48 elsif std_match
(addr,
"-------------------------000--11") then
49 sel := ipbus_sel_t
(to_unsigned
(N_SLV_QUAD_MGT_STATUS, IPBUS_SEL_WIDTH
));
-- quad.mgt_status / base 0x00000003 / mask 0x00000073
50 elsif std_match
(addr,
"-------------------------001----") then
51 sel := ipbus_sel_t
(to_unsigned
(N_SLV_GT0, IPBUS_SEL_WIDTH
));
-- gt0 / base 0x00000010 / mask 0x00000070
52 elsif std_match
(addr,
"-------------------------010----") then
53 sel := ipbus_sel_t
(to_unsigned
(N_SLV_GT1, IPBUS_SEL_WIDTH
));
-- gt1 / base 0x00000020 / mask 0x00000070
54 elsif std_match
(addr,
"-------------------------011----") then
55 sel := ipbus_sel_t
(to_unsigned
(N_SLV_GT2, IPBUS_SEL_WIDTH
));
-- gt2 / base 0x00000030 / mask 0x00000070
56 elsif std_match
(addr,
"-------------------------100----") then
57 sel := ipbus_sel_t
(to_unsigned
(N_SLV_GT3, IPBUS_SEL_WIDTH
));
-- gt3 / base 0x00000040 / mask 0x00000070
61 sel := ipbus_sel_t
(to_unsigned
(N_SLAVES, IPBUS_SEL_WIDTH
));
66 end function ipbus_sel_efex_cntrl_mgt_quad;