From: Sebastien Bourdeauducq Date: Tue, 16 Apr 2013 20:21:03 +0000 (+0200) Subject: dvisampler/chansync: set synced to 0 when control tokens do not arrive at the same... X-Git-Tag: 24jan2021_ls180~2973 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b018fcedc48003dc2fa3c69d0246daecadf1598f;p=litex.git dvisampler/chansync: set synced to 0 when control tokens do not arrive at the same time --- diff --git a/milkymist/dvisampler/chansync.py b/milkymist/dvisampler/chansync.py index 2a046b65..5f53de18 100644 --- a/milkymist/dvisampler/chansync.py +++ b/milkymist/dvisampler/chansync.py @@ -45,8 +45,20 @@ class ChanSync(Module, AutoCSR): ] lst_control_starts.append(control_starts) - self.comb += all_control_starts.eq(optree("&", lst_control_starts)) + some_control_starts = Signal() + self.comb += [ + all_control_starts.eq(optree("&", lst_control_starts)), + some_control_starts.eq(optree("|", lst_control_starts)) + ] self.sync.pix += If(~self.valid_i, self.chan_synced.eq(0) - ).Elif(all_control_starts, self.chan_synced.eq(1)) + ).Else( + If(some_control_starts, + If(all_control_starts, + self.chan_synced.eq(1) + ).Else( + self.chan_synced.eq(0) + ) + ) + ) self.specials += MultiReg(self.chan_synced, self._r_channels_synced.status)