I have been trying to build a pulse generator to, let's say, detect when a signal has fallen. I have tried different ways to build this pulse generator using processes: my simulation hangs.
I'm posting this question, not so much seeking the code for a pulse generator, but rather hoping for an explanation of why this approach does not work. I'm trying to make the jump from sequential languages (like C++, etc) to VHDL
and I'm running into this invisible conceptual wall. Thanks in advance.
library ieee;
use ieee.std_logic_1164.all;
entity puls_on_FE is
port (signal_in : in std_logic; pulse_out : out std_logic);
end puls_on_FE;
architecture behavior of puls_on_FE is
signal epoch: std_logic := '0';
begin
process (signal_in)
begin
if falling_edge(signal_in)then
pulse_out <= '0';
wait1: loop --using loop because an after by itself hangs the sim too
exit when epoch = '1';
epoch <= '1' after 5 ns;
end loop wait1; --expect loop to execute once and exit after 5ns
pulse_out <= '1';
end if;
end process;
end behavior;