I have to delay a pulse train by a given number of clocks on the same domain as the pulse to be delayed.
The best approach I can think of is to run a counter of sufficient width and log pulse transitions and states into a circular "pulse transition list" of sufficient depth. After waiting for the desired number of clock transitions (the delay) an output counter of the same width as the input sample counter is allowed to start counting. This counter is used to address the "pulse transition list" to generate a delayed output that matches the input.
Using SelectRAM memory for delay is out of the question as too much memory would be required and it is needed elsewhere in the design.
Can anyone suggest a better way to do this? The incoming pulses are relatively regular and can be of any duration, from a few clocks to hundreds.
Thanks,
-Martin