Altera_Forum
Honored Contributor
10 years agoerror: expression is not constant
Hi,
My code is as followed:signal cnt_clks : natural range 0 to 300;
...
...
cnt_clks <= conv_integer(unsigned(time)) * 25;
process(clk_50, reset)
begin
if reset = '1' then
enc_delay <= (others => '0');
enc_delay_in <= '0';
elsif rising_edge(clk_50) then
enc_delay(cnt_clks downto 0) <= enc_delay((cnt_clks -1) downto 0) & enc_in(1);
enc_delay_in <= enc_delay(cnt_clks);
end if;
end process;
Modelsim compiles it with no problem. Quartus shows the 'Expression is not constant' error (I'm using Quartus 15). How can I overcome that? I tried defining cnt_clks as Integer, no luck. Roy