Altera_Forum
Honored Contributor
12 years agocan't infer register because its behavior depends on the edges of multiple clock
Hi
i wrote this vhdl code in Quartus II version 7.2 but when i want to compile it this error is displayed can't infer register for flag because its behavior depends on the edges of multiple distinct clocks i sure this code true because i wrote this code in modelsim software and xilinx-ise and simulated . it worked properly what is wrong ? please help me library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity delay is port( clk :in std_logic; change :in std_logic; output :out std_logic ); end delay; architecture behavior of delay is signal flag : std_logic; signal counter :integer range 0 to 100000; begin ---------------------------- process(change, clk) begin if(rising_edge(change))then flag <= '1'; output <= '0'; counter <= 0; else if(rising_edge(clk))then if(flag = '1')then if(counter < 100000)then counter <= counter + 1; output <= '0'; else output <= '1'; flag <= '0'; end if; end if; end if; end if; end process; --------------------------- end behavior;