ERROR:HDLCompiler:545 - "<file>.vhd" Line xx: Initial value for constant declaration is not constant
コード例 :
library ieee; use ieee.std_logic_1164.all;
entity ex_0009 is port(clk,a : in std_logic; res : out std_logic ); end ex_0009;
architecture bhv of ex_0009 is constant my_const: std_logic:='0'; signal tmp: std_logic; begin tmp <= my_const;
process (clk) constant local_const: std_logic := tmp; -- Note: Error points here begin if clk'event and clk='1' then res <= a or local_const; end if; end process;
entity ex_0009 is port(clk,a : in std_logic; res : out std_logic ); end ex_0009;
architecture bhv of ex_0009 is constant my_const: std_logic:='0'; signal tmp: std_logic; begin tmp <= my_const;
process (clk) constant local_const: std_logic := my_const; -- Note: Error points here begin if clk'event and clk='1' then res <= a or local_const; end if; end process;