I have the following declaration in my architecture:
architecture behavioral of my_widget is
type register_bank_t is array(1 to 4) of std_logic_vector(31 downto 0);
-- register addresses
constant address : register_bank_t := (
x"0000_1081", -- 1
x"0000_1082", -- 2
x"0000_1083", -- 3
x"0000_1084" -- 4
);
..
Then later, in a process inside the same architecture, I do:
case bus_addr is
when address(1) =>
r_output_value <= reg(1);
when address(2) =>
r_output_value <= reg(2);
when address(3) =>
r_output_value <= reg(3);
when address(4) =>
r_output_value <= reg(4);
when others =>
r_output_value <= (others => '0');
end case;
I can't figure out why Modelsim gives me the following warning:
(vcom-1937) Choice in CASE statement alternative must be locally static.
When all the choices are clearly constants at compile time.