Forum Discussion
Altera_Forum
Honored Contributor
7 years agoThe below code is counting rising clock edges in a simulation, by working of the sensitivity list. When trying to synthesize it in hardware, the sensitivity list is ignored and it doesn't work as a counter.
process (clk)
begin
if clk='1' then
count <= count +1;
end if;
end process; To achieve consistent behavior in functional simulation and synthesis, you need to write process (clk)
begin
if rising_edge(clk) then
count <= count +1;
end if;
end process;