Altera_Forum
Honored Contributor
9 years agoUse non static length constant as option in case statement
Hi,
I am writing a case statement for register definitions. The options for case statement are register addresses which I want to be of variable length. I have written a package and rtl as follows: Package content: constant reg_address_bits : integer := 9; constant addr_1 : std_logic_vector(reg_address_bits-1 downto 0) := x"00"; constant addr_2 : std_logic_vector(reg_address_bits-1 downto 0) := x"04"; RTL content: signal S_reg_addr : std_logic_vector(reg_address_bits-1 downto 0); case S_reg_addr is when addr_1 => when addr_2 => . . . Assume all the syntax that I have missed to be correct. In this implementation I am getting ncvhdl_p: CSODAS error. I am thinking that it is not considering the constant declaration in package as static constant and thus it gives this error. Kindly tell me the correct implementation.