Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dvisampler/chansync: set synced to 0 when control tokens do not arriv…

…e at the same time
  • Loading branch information...
commit b018fcedc48003dc2fa3c69d0246daecadf1598f 1 parent 1ab89d6
Sébastien Bourdeauducq authored April 16, 2013

Showing 1 changed file with 14 additions and 2 deletions. Show diff stats Hide diff stats

  1. 16  milkymist/dvisampler/chansync.py
16  milkymist/dvisampler/chansync.py
@@ -45,8 +45,20 @@ def __init__(self, nchan=3, depth=8):
45 45
 			]
46 46
 			lst_control_starts.append(control_starts)
47 47
 
48  
-		self.comb += all_control_starts.eq(optree("&", lst_control_starts))
  48
+		some_control_starts = Signal()
  49
+		self.comb += [
  50
+			all_control_starts.eq(optree("&", lst_control_starts)),
  51
+			some_control_starts.eq(optree("|", lst_control_starts))
  52
+		]
49 53
 		self.sync.pix += If(~self.valid_i,
50 54
 				self.chan_synced.eq(0)
51  
-			).Elif(all_control_starts, self.chan_synced.eq(1))
  55
+			).Else(
  56
+				If(some_control_starts,
  57
+					If(all_control_starts,
  58
+						self.chan_synced.eq(1)
  59
+					).Else(
  60
+						self.chan_synced.eq(0)
  61
+					)
  62
+				)
  63
+			)
52 64
 		self.specials += MultiReg(self.chan_synced, self._r_channels_synced.status)

0 notes on commit b018fce

Please sign in to comment.
Something went wrong with that request. Please try again.