Hi,
I am trying to synthesise the following VHDL description of a 16-bit counter using XST (in Xilinx ISE Webpack), but I am getting a synthesis error - "Bad synchronous description" on signal 'tmpcount'. Could anyone please give me a clue as to where I have gone wrong?
Thanks,
Chris.
------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity counter16 is
Port ( reset : in std_logic;
clock : in std_logic;
hold : in std_logic;
count : out std_logic_vector(15 downto 0);
overflow : out std_logic);
end counter16;
architecture Behavioral of counter16 is
signal holding : boolean;
signal missed : boolean;
signal tmpcount : std_logic_vector(15 downto 0);
signal tmpoverflow : std_logic;
begin
process (clock, hold)
begin
if clock'event then
if reset='1' then
tmpcount <= "0000000000000000";
tmpoverflow <= '0';
holding <= false;
missed <= false;
elsif clock='1' then
if holding then
missed <= true;
else
if tmpcount = "1111111111111111" then
tmpoverflow <= '1';
end if;
tmpcount <= tmpcount + 1;
end if;
end if;
elsif hold'event then
if hold = '0' then
-- hold has just gone low
-- increment count if missed an edge
if missed then
if tmpcount = "1111111111111111" then
tmpoverflow <= '1';
end if;
tmpcount <= tmpcount + 1;
missed <= false;
end if;
-- no longer holding
holding <= false;
else
-- hold has just gone high
holding <= true;
end if;
end if;
end process;
count <= tmpcount;
overflow <= tmpoverflow;
end Behavioral;
------------
=========================================================================
* HDL Compilation *
=========================================================================
Compiling vhdl file C:/Xilinx/bin/testproject/counter16.vhd in Library work.
Entity <counter16> (Architecture <behavioral>) compiled.
=========================================================================
* HDL Analysis *
=========================================================================
Analyzing Entity <counter16> (Architecture <behavioral>).
ERROR:Xst:827 - C:/Xilinx/bin/testproject/counter16.vhd line 23: Signal tmpcount cannot be synthesized, bad synchronous description.
-->
Total memory usage is 57280 kilobytes
I am trying to synthesise the following VHDL description of a 16-bit counter using XST (in Xilinx ISE Webpack), but I am getting a synthesis error - "Bad synchronous description" on signal 'tmpcount'. Could anyone please give me a clue as to where I have gone wrong?
Thanks,
Chris.
------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity counter16 is
Port ( reset : in std_logic;
clock : in std_logic;
hold : in std_logic;
count : out std_logic_vector(15 downto 0);
overflow : out std_logic);
end counter16;
architecture Behavioral of counter16 is
signal holding : boolean;
signal missed : boolean;
signal tmpcount : std_logic_vector(15 downto 0);
signal tmpoverflow : std_logic;
begin
process (clock, hold)
begin
if clock'event then
if reset='1' then
tmpcount <= "0000000000000000";
tmpoverflow <= '0';
holding <= false;
missed <= false;
elsif clock='1' then
if holding then
missed <= true;
else
if tmpcount = "1111111111111111" then
tmpoverflow <= '1';
end if;
tmpcount <= tmpcount + 1;
end if;
end if;
elsif hold'event then
if hold = '0' then
-- hold has just gone low
-- increment count if missed an edge
if missed then
if tmpcount = "1111111111111111" then
tmpoverflow <= '1';
end if;
tmpcount <= tmpcount + 1;
missed <= false;
end if;
-- no longer holding
holding <= false;
else
-- hold has just gone high
holding <= true;
end if;
end if;
end process;
count <= tmpcount;
overflow <= tmpoverflow;
end Behavioral;
------------
=========================================================================
* HDL Compilation *
=========================================================================
Compiling vhdl file C:/Xilinx/bin/testproject/counter16.vhd in Library work.
Entity <counter16> (Architecture <behavioral>) compiled.
=========================================================================
* HDL Analysis *
=========================================================================
Analyzing Entity <counter16> (Architecture <behavioral>).
ERROR:Xst:827 - C:/Xilinx/bin/testproject/counter16.vhd line 23: Signal tmpcount cannot be synthesized, bad synchronous description.
-->
Total memory usage is 57280 kilobytes