common: add TappedDelayLine to simplify delays on control signals.

This commit is contained in:
Florent Kermarrec 2020-10-01 18:29:35 +02:00
parent a5a4a422dd
commit d12caf1e0c
1 changed files with 9 additions and 0 deletions

View File

@ -136,6 +136,15 @@ class BitSlip(Module):
cases[i] = self.o.eq(r[i:dw+i])
self.comb += Case(value, cases)
# TappedDelayLine ----------------------------------------------------------------------------------
class TappedDelayLine(Module):
def __init__(self, signal, ntaps):
self.taps = Array(signal if i == 0 else Signal.like(signal) for i in range(ntaps))
for i in range(1, ntaps):
self.sync += self.taps[i].eq(self.taps[i-1])
self.output = self.taps[-1]
# DQS Pattern --------------------------------------------------------------------------------------
class DQSPattern(Module):