From 37e463da9abf082103218ad644e85d29599065c3 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 19 Feb 2015 11:34:20 +0100 Subject: [PATCH] fix rle when used with subsampler --- litescope/core/storage.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/litescope/core/storage.py b/litescope/core/storage.py index 6707b207..48ff9d16 100644 --- a/litescope/core/storage.py +++ b/litescope/core/storage.py @@ -45,7 +45,7 @@ class LiteScopeRunLengthEncoderUnit(Module): change = Signal() self.comb += change.eq( - (sink.stb & buf.q.stb) & + sink.stb & (sink.data != buf.q.data) ) @@ -60,6 +60,7 @@ class LiteScopeRunLengthEncoderUnit(Module): ) ) fsm.act("COUNT", + buf.q.ack.eq(1), counter.ce.eq(sink.stb), If(~self.enable, NextState("BYPASS") @@ -67,7 +68,10 @@ class LiteScopeRunLengthEncoderUnit(Module): source.stb.eq(1), source.data[:flen(counter.value)].eq(counter.value), source.data[-1].eq(1), # Set RLE bit - NextState("BYPASS") + buf.q.ack.eq(source.ack), + If(source.ack, + NextState("BYPASS") + ) ) ) -- 2.30.2