B
Benjamin Couillard
Hi everyone,
I have a simple question. Assuming we have this process :
MY_PROCESS : process(CLK)
variable cnt : natural range 0 to 255;
begin
if rising_edge(CLK) then
output_signal <= '0';
if (srst = '1') then
cnt := 0;
else
if (cnt = 100) then
output_signal <= '1';
end if;
cnt := cnt + 1;
end if;
end if;
end process;
In simulation, I will get an error at the rising edge of CLK when cnt
is 255. However, what happens in synthesis? Will the synthesizer add
logic to prevent cnt from wrapping aroung ? Or will it simply
implement the "usual" wraparound behavior? Is it synthesizer
specific?
Best regards.
Benjamin
I have a simple question. Assuming we have this process :
MY_PROCESS : process(CLK)
variable cnt : natural range 0 to 255;
begin
if rising_edge(CLK) then
output_signal <= '0';
if (srst = '1') then
cnt := 0;
else
if (cnt = 100) then
output_signal <= '1';
end if;
cnt := cnt + 1;
end if;
end if;
end process;
In simulation, I will get an error at the rising edge of CLK when cnt
is 255. However, what happens in synthesis? Will the synthesizer add
logic to prevent cnt from wrapping aroung ? Or will it simply
implement the "usual" wraparound behavior? Is it synthesizer
specific?
Best regards.
Benjamin