I am trying to implement a counter that will inc. or dec. based on 2 clock sources. the following is the simplified code. CLK_A and CLK_B are 90 degrees out of phase.
I am getting the error "Signal Q_IN cannot be synthesized, bad synchronous description". using xilinx webpack 6.1.03i. will greatly appreciate any help.
thanks in advance,
Abdul Rafiq
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity CounterScaler is
port ( CLEAR, CLK_A, CLK_B: in std_logic;
Q : out std_logic_vector(7 downto 0));
end CounterScaler;
architecture Behavioral of CounterScaler is
signal Q_IN : std_logic_vector(7 downto 0);
begin
Q <= Q_IN;
process( CLK_A, CLK_B, CLEAR )
begin
if CLEAR='1' then
Q_IN <= "00000000";
if rising_edge(CLK_A) and CLK_B = '0' then
q_in <= q_in + '1';
elsif rising_edge(CLK_B) and CLK_A = '1' then
q_in <= q_in - '1';
END IF;
end process;
end Behavioral;
I am getting the error "Signal Q_IN cannot be synthesized, bad synchronous description". using xilinx webpack 6.1.03i. will greatly appreciate any help.
thanks in advance,
Abdul Rafiq
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity CounterScaler is
port ( CLEAR, CLK_A, CLK_B: in std_logic;
Q : out std_logic_vector(7 downto 0));
end CounterScaler;
architecture Behavioral of CounterScaler is
signal Q_IN : std_logic_vector(7 downto 0);
begin
Q <= Q_IN;
process( CLK_A, CLK_B, CLEAR )
begin
if CLEAR='1' then
Q_IN <= "00000000";
if rising_edge(CLK_A) and CLK_B = '0' then
q_in <= q_in + '1';
elsif rising_edge(CLK_B) and CLK_A = '1' then
q_in <= q_in - '1';
END IF;
end process;
end Behavioral;