12 use ieee.std_logic_1164.
all;
13 use ieee.numeric_std.
all;
18 constant IPBUS_SEL_WIDTH: positive := 3;
21 subtype ipbus_sel_t is std_logic_vector(IPBUS_SEL_WIDTH - 1 downto 0);
22 function ipbus_sel_efex_cntrl_infrastructure(addr :
in std_logic_vector(
31 downto 0))
return ipbus_sel_t;
25 constant N_SLV_MODULE_REG: integer := 0;
26 constant N_SLV_XADC: integer := 1;
27 constant N_SLV_RECONFIGURE: integer := 2;
28 constant N_SLV_I2C: integer := 3;
29 constant N_SLV_PLL_SPI_RAM: integer := 4;
30 constant N_SLV_FLASH_SPI_RAM: integer := 5;
31 constant N_SLV_RAM: integer := 6;
32 constant N_SLAVES: integer := 7;
39 function ipbus_sel_efex_cntrl_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--00-000-0--") then
45 sel := ipbus_sel_t
(to_unsigned
(N_SLV_MODULE_REG, IPBUS_SEL_WIDTH
));
-- module_reg / base 0x00000000 / mask 0x00001374
46 elsif std_match
(addr,
"-------------------0--00-01-----") then
47 sel := ipbus_sel_t
(to_unsigned
(N_SLV_XADC, IPBUS_SEL_WIDTH
));
-- xadc / base 0x00000020 / mask 0x00001360
48 elsif std_match
(addr,
"-------------------0--00-100-1--") then
49 sel := ipbus_sel_t
(to_unsigned
(N_SLV_RECONFIGURE, IPBUS_SEL_WIDTH
));
-- reconfigure / base 0x00000045 / mask 0x00001374
50 elsif std_match
(addr,
"-------------------0--00-101----") then
51 sel := ipbus_sel_t
(to_unsigned
(N_SLV_I2C, IPBUS_SEL_WIDTH
));
-- i2c / base 0x00000050 / mask 0x00001370
52 elsif std_match
(addr,
"-------------------0--01-0------") then
53 sel := ipbus_sel_t
(to_unsigned
(N_SLV_PLL_SPI_RAM, IPBUS_SEL_WIDTH
));
-- pll_spi_ram / base 0x00000100 / mask 0x00001340
54 elsif std_match
(addr,
"-------------------0--1---------") then
55 sel := ipbus_sel_t
(to_unsigned
(N_SLV_FLASH_SPI_RAM, IPBUS_SEL_WIDTH
));
-- flash_spi_ram / base 0x00000200 / mask 0x00001200
56 elsif std_match
(addr,
"-------------------1------------") then
57 sel := ipbus_sel_t
(to_unsigned
(N_SLV_RAM, IPBUS_SEL_WIDTH
));
-- ram / base 0x00001000 / mask 0x00001000
59 sel := ipbus_sel_t
(to_unsigned
(N_SLAVES, IPBUS_SEL_WIDTH
));
65 end function ipbus_sel_efex_cntrl_infrastructure;