dvisampler: connect sync polarity detection
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 5 May 2013 10:58:53 +0000 (12:58 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 5 May 2013 10:58:53 +0000 (12:58 +0200)
milkymist/dvisampler/__init__.py

index fcbcb165a9a9df9ec12c8f100ce55a2215d5c916..7858edc5f9330c9ecfe9ebbadc2f4b11dd9867e0 100644 (file)
@@ -10,6 +10,7 @@ from milkymist.dvisampler.datacapture import DataCapture
 from milkymist.dvisampler.charsync import CharSync
 from milkymist.dvisampler.decoding import Decoding
 from milkymist.dvisampler.chansync import ChanSync
+from milkymist.dvisampler.syncpol import SyncPolarity
 from milkymist.dvisampler.resdetection import ResolutionDetection
 
 class DVISampler(Module, AutoCSR):
@@ -53,18 +54,18 @@ class DVISampler(Module, AutoCSR):
                        self.chansync.data_in2.eq(self.data2_decod.output),
                ]
 
-               de = self.chansync.data_out0.de
-               r = self.chansync.data_out2.d
-               g = self.chansync.data_out1.d
-               b = self.chansync.data_out0.d
-               hsync = self.chansync.data_out0.c[0]
-               vsync = self.chansync.data_out0.c[1]
+               self.submodules.syncpol = SyncPolarity()
+               self.comb += [
+                       self.syncpol.valid_i.eq(self.chansync.chan_synced),
+                       self.syncpol.data_in0.eq(self.chansync.data_out0),
+                       self.syncpol.data_in1.eq(self.chansync.data_out1),
+                       self.syncpol.data_in2.eq(self.chansync.data_out2)
+               ]
 
                self.submodules.resdetection = ResolutionDetection()
                self.comb += [
-                       self.resdetection.de.eq(de),
-                       self.resdetection.hsync.eq(hsync),
-                       self.resdetection.vsync.eq(vsync)
+                       self.resdetection.de.eq(self.syncpol.de),
+                       self.resdetection.vsync.eq(self.syncpol.vsync)
                ]
 
 class RawDVISampler(Module, AutoCSR):