fix rle when used with subsampler

This commit is contained in:
Florent Kermarrec 2015-02-19 11:34:20 +01:00
parent e495e2f537
commit 37e463da9a
1 changed files with 6 additions and 2 deletions

View File

@ -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,9 +68,12 @@ class LiteScopeRunLengthEncoderUnit(Module):
source.stb.eq(1),
source.data[:flen(counter.value)].eq(counter.value),
source.data[-1].eq(1), # Set RLE bit
buf.q.ack.eq(source.ack),
If(source.ack,
NextState("BYPASS")
)
)
)
class LiteScopeRunLengthEncoder(LiteScopeRunLengthEncoderUnit, AutoCSR):
def __init__(self, dw, length=1024):