dvisampler/chansync: set synced to 0 when control tokens do not arrive at the same time

This commit is contained in:
Sebastien Bourdeauducq 2013-04-16 22:21:03 +02:00
parent 1ab89d6a62
commit b018fcedc4
1 changed files with 14 additions and 2 deletions

View File

@ -45,8 +45,20 @@ class ChanSync(Module, AutoCSR):
] ]
lst_control_starts.append(control_starts) 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.sync.pix += If(~self.valid_i,
self.chan_synced.eq(0) 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) self.specials += MultiReg(self.chan_synced, self._r_channels_synced.status)