From: Sebastien Bourdeauducq Date: Tue, 19 Nov 2013 22:38:48 +0000 (+0100) Subject: dvisampler: transfer the last word in frames correctly X-Git-Tag: 24jan2021_ls180~2788 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2eabf971478d9a2184dc9863341c32d33ee7d979;p=litex.git dvisampler: transfer the last word in frames correctly --- diff --git a/misoclib/dvisampler/analysis.py b/misoclib/dvisampler/analysis.py index 5108f8d8..7005afbd 100644 --- a/misoclib/dvisampler/analysis.py +++ b/misoclib/dvisampler/analysis.py @@ -141,11 +141,13 @@ class FrameExtraction(Module, AutoCSR): self.sync.pix += [ cur_word_valid.eq(0), If(new_frame, - pack_counter.eq(0) + cur_word_valid.eq(pack_counter == (pack_factor - 1)), + pack_counter.eq(0), ).Elif(self.valid_i & self.de, [If(pack_counter == (pack_factor-i-1), cur_word[24*i:24*(i+1)].eq(encoded_pixel)) for i in range(pack_factor)], - Cat(pack_counter, cur_word_valid).eq(pack_counter + 1) + cur_word_valid.eq(pack_counter == (pack_factor - 1)), + pack_counter.eq(pack_counter + 1) ) ] @@ -157,7 +159,11 @@ class FrameExtraction(Module, AutoCSR): fifo.din.pixels.eq(cur_word), fifo.we.eq(cur_word_valid) ] - self.sync.pix += If(new_frame, fifo.din.parity.eq(~fifo.din.parity)) + new_frame_r = Signal() + self.sync.pix += [ + If(new_frame_r, fifo.din.parity.eq(~fifo.din.parity)), + new_frame_r.eq(new_frame) + ] self.comb += [ self.frame.stb.eq(fifo.readable), self.frame.payload.eq(fifo.dout),