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_infrastructure(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t;
21 constant N_SLV_MODULE_REG: integer := 0;
22 constant N_SLV_TOB_SYNCH: integer := 1;
23 constant N_SLV_XADC: integer := 2;
24 constant N_SLV_RECONFIGURE: integer := 3;
25 constant N_SLV_TTC_ORBIT_LENGTH: integer := 4;
26 constant N_SLV_BCMUXVALUE_SYNC: integer := 5;
27 constant N_SLV_TOB_DELAY: integer := 6;
28 constant N_SLV_TOB_BC_DELAY: integer := 7;
29 constant N_SLV_FLASH_SPI_RAM: integer := 8;
30 constant N_SLV_RAM: integer := 9;
31 constant N_SLAVES: integer := 10;
39 function ipbus_sel_efex_infrastructure(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t
is
40 variable sel: ipbus_sel_t;
44 if std_match
(addr,
"-------------------0--0--000-00-") then
45 sel := ipbus_sel_t
(to_unsigned
(N_SLV_MODULE_REG, IPBUS_SEL_WIDTH
));
-- module_reg / base 0x00000000 / mask 0x00001276
46 elsif std_match
(addr,
"-------------------0--0--000-01-") then
47 sel := ipbus_sel_t
(to_unsigned
(N_SLV_TOB_SYNCH, IPBUS_SEL_WIDTH
));
-- tob_synch / base 0x00000002 / mask 0x00001276
48 elsif std_match
(addr,
"-------------------0--0--01-----") then
49 sel := ipbus_sel_t
(to_unsigned
(N_SLV_XADC, IPBUS_SEL_WIDTH
));
-- xadc / base 0x00000020 / mask 0x00001260
50 elsif std_match
(addr,
"-------------------0--0--100-101") then
51 sel := ipbus_sel_t
(to_unsigned
(N_SLV_RECONFIGURE, IPBUS_SEL_WIDTH
));
-- reconfigure / base 0x00000045 / mask 0x00001277
52 elsif std_match
(addr,
"-------------------0--0--100-110") then
53 sel := ipbus_sel_t
(to_unsigned
(N_SLV_TTC_ORBIT_LENGTH, IPBUS_SEL_WIDTH
));
-- ttc_orbit_length / base 0x00000046 / mask 0x00001277
54 elsif std_match
(addr,
"-------------------0--0--100-111") then
55 sel := ipbus_sel_t
(to_unsigned
(N_SLV_BCMUXVALUE_SYNC, IPBUS_SEL_WIDTH
));
-- bcmuxvalue_sync / base 0x00000047 / mask 0x00001277
56 elsif std_match
(addr,
"-------------------0--0--101-00-") then
57 sel := ipbus_sel_t
(to_unsigned
(N_SLV_TOB_DELAY, IPBUS_SEL_WIDTH
));
-- tob_delay / base 0x00000050 / mask 0x00001276
58 elsif std_match
(addr,
"-------------------0--0--110-00-") then
59 sel := ipbus_sel_t
(to_unsigned
(N_SLV_TOB_BC_DELAY, IPBUS_SEL_WIDTH
));
-- tob_bc_delay / base 0x00000060 / mask 0x00001276
60 elsif std_match
(addr,
"-------------------0--1---------") then
61 sel := ipbus_sel_t
(to_unsigned
(N_SLV_FLASH_SPI_RAM, IPBUS_SEL_WIDTH
));
-- flash_spi_ram / base 0x00000200 / mask 0x00001200
62 elsif std_match
(addr,
"-------------------1------------") then
63 sel := ipbus_sel_t
(to_unsigned
(N_SLV_RAM, IPBUS_SEL_WIDTH
));
-- ram / base 0x00001000 / mask 0x00001000
67 sel := ipbus_sel_t
(to_unsigned
(N_SLAVES, IPBUS_SEL_WIDTH
));
72 end function ipbus_sel_efex_infrastructure;