Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dvisampler/chansync: set synced to 0 when control tokens do not arriv…
…e at the same time
  • Loading branch information
Sebastien Bourdeauducq committed Apr 16, 2013
1 parent 1ab89d6 commit b018fce
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions milkymist/dvisampler/chansync.py
Expand Up @@ -45,8 +45,20 @@ def __init__(self, nchan=3, depth=8):
]
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)

0 comments on commit b018fce

Please sign in to comment.