com/liteethmini/phy: remove use of FlipFlop in MII
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 23 Oct 2015 18:23:33 +0000 (20:23 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 23 Oct 2015 18:23:45 +0000 (20:23 +0200)
misoclib/com/liteethmini/phy/mii.py

index 53a20a79c5df9e5f3b47b37609786982f4416e5f..6a39d9010aef0e920a5cf9359b82c506cff67eb0 100644 (file)
@@ -39,8 +39,10 @@ class LiteEthPHYMIIRX(Module):
 
         # # #
 
-        sop = FlipFlop(reset=1)
-        self.submodules += sop
+        sop = Signal(reset=1)
+        sop_set = Signal()
+        sop_clr = Signal()
+        self.sync += If(sop_set, sop.eq(1)).Elif(sop_clr, sop.eq(0))
 
         converter = Converter(converter_description(4),
                               converter_description(8))
@@ -52,10 +54,12 @@ class LiteEthPHYMIIRX(Module):
             converter.sink.stb.eq(1),
             converter.sink.data.eq(pads.rx_data)
         ]
+        self.sync += [
+            sop_set.eq(~pads.dv),
+            sop_clr.eq(pads.dv)
+        ]
         self.comb += [
-            sop.reset.eq(~pads.dv),
-            sop.ce.eq(pads.dv),
-            converter.sink.sop.eq(sop.q),
+            converter.sink.sop.eq(sop),
             converter.sink.eop.eq(~pads.dv)
         ]
         self.comb += Record.connect(converter.source, source)