From c430587e91e8f4b2f6804f61592cd3df1176ef0e Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 21 Oct 2020 15:52:53 +0200 Subject: [PATCH] soc/interconnect/stream/Shifter: add shift signal as optional parameter. --- litex/soc/interconnect/stream.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litex/soc/interconnect/stream.py b/litex/soc/interconnect/stream.py index 4b1d37fad..1e9b913e9 100644 --- a/litex/soc/interconnect/stream.py +++ b/litex/soc/interconnect/stream.py @@ -571,8 +571,8 @@ class Gearbox(Module): # Shifter ------------------------------------------------------------------------------------------ class Shifter(PipelinedActor): - def __init__(self, dw): - self.shift = Signal(max=dw) + def __init__(self, dw, shift=None): + self.shift = Signal(max=dw) if shift is None else shift self.sink = sink = Endpoint([("data", dw)]) self.source = source = Endpoint([("data", dw)]) PipelinedActor.__init__(self, latency=2) @@ -582,7 +582,7 @@ class Shifter(PipelinedActor): # Accumulate current/last sink.data. r = Signal(2*dw) self.sync += If(self.pipe_ce, - r[0:dw].eq(r[dw:]), + r[:dw].eq(r[dw:]), r[dw:].eq(sink.data) )