common/BitSlip: shift output by one bit (allow 1 cycle latency on writes), set reset value to cycles*dw-1.

This commit is contained in:
Florent Kermarrec 2020-10-08 17:37:24 +02:00
parent 732df04413
commit 3fddff3a11
1 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ class BitSlip(Module):
# # # # # #
value = Signal(max=cycles*dw) value = Signal(max=cycles*dw, reset=cycles*dw-1)
self.sync += If(self.slp, value.eq(value + 1)) self.sync += If(self.slp, value.eq(value + 1))
self.sync += If(self.rst, value.eq(0)) self.sync += If(self.rst, value.eq(0))
@ -134,7 +134,7 @@ class BitSlip(Module):
self.sync += r.eq(Cat(r[dw:], self.i)) self.sync += r.eq(Cat(r[dw:], self.i))
cases = {} cases = {}
for i in range(cycles*dw): for i in range(cycles*dw):
cases[i] = self.o.eq(r[i:dw+i]) cases[i] = self.o.eq(r[i+1:dw+i+1])
self.comb += Case(value, cases) self.comb += Case(value, cases)
# TappedDelayLine ---------------------------------------------------------------------------------- # TappedDelayLine ----------------------------------------------------------------------------------