I am currently working on a project that generates enable pulses of extremely diverse lengths from microseconds to days and under normal operation will start execution under a trigger input.
However, I am trying to add gated triggering so that the pulses will start running when the board turns on but will only output when the trigger is pulled high.
The gated triggering should only output pulses that occur completely during the period of triggering as shown below:
As you can see if the pulse generator goes high before triggering, then that pulse should not be collected for output. Standard gating logics along the lines of
if (trigger AND pulse) do not work and because the pulses can be very long basic lookbehind methods such
if (trigger = '1' AND pulse = '1' AND prev = '0') (with
prev being the value of the pulse on the last clock cycle) do not work either.
I would attach code but since none of it achieves the correct outcome I'm not sure it would do much other than confusing.