Snythesis error

Hi, when I synthesize the following, I get warnings.

library IEEE; use IEEE.STD_LOGIC_1164.ALL; use ieee.numeric_std.all;

---- Uncomment the following library declaration if instantiating

---- any Xilinx primitives in this code.

--library UNISIM;

--use UNISIM.VComponents.all;

entity debounce is generic(N : integer := 20); port( clk,reset : in std_logic; button : in std_logic; debounced : out std_logic ); end debounce;

architecture Behavioral of debounce is type state_type is (s0,s1); signal state_reg,state_next : state_type; signal cnt_reg,cnt_next : unsigned(N-1 downto 0); begin process(clk,reset) begin if reset='1' then state_reg

Reply to
Thorsten Kiefer
Loading thread data ...

You have two instances of cnt_next

Reply to
John_H

THX !!

Reply to
Thorsten Kiefer

I think the line above shows how the combinatorial loop is formed, because you're making a value in a combinatorial process a function of itself. I think what you really want is:

Reply to
Kevin Neilson

cnt_next is never registered.

Don't use the two-process state machine description. It leads to exactly the problem you have.

-a

Reply to
Andy Peters

Is the a concurrent statement for the next-state-logic better ? But what if the "next-state logic" becomes more complex ?

Reply to
Thorsten Kiefer

can you convert that little example into a single process ? I have no idea how to do that... My book says, the state machine has to be separated into "register/flipflop","next-state logic" and "output logic"

-TK

Reply to
Thorsten Kiefer

I do it like this:

main : process(reset, clock) is

-- declarations begin -- process template if reset = '1' then init_regs; elsif rising_edge(clock) then update_regs; end if; update_ports; end process main; end architecture synth;

Details here:

formatting link

--Mike Treseler

Reply to
Mike Treseler

This is a good style beside the fact, that a tool i recently use (I think synopsys dc, not 100% shure) didn't accept the update_ports part of such an process. Thats why I update ports usualy outside the process.

bye Thomas

Reply to
Thomas Stanka

Thanks for the report. This style works with quartus, ise, mentor, verific and others. Updating ports outside the process works also but I resist adding wires when they are not logically required.

-- Mike Treseler

Reply to
Mike Treseler

Why am I not surprised... Synopsys synthesis support for VHDL has never been very good.

Now they own Synplicity, so it may get better (or it may get worse, if they direct Synplicity to remove incompatibilities with DC!)

Andy

Reply to
Andy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.