liteeth/phy/mii: assign tx_er only if exists (as it's done on GMII)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 12 Apr 2015 12:43:35 +0000 (14:43 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 12 Apr 2015 12:43:35 +0000 (14:43 +0200)
misoclib/com/liteeth/phy/mii.py

index 13d39ffb0d45f921b8d5e695475d03669183ffa6..f42768fe3ad87e2b0c561489057f1dadf4000d03 100644 (file)
@@ -5,12 +5,13 @@ class LiteEthPHYMIITX(Module):
        def __init__(self, pads):
                self.sink = sink = Sink(eth_phy_description(8))
                ###
+               if hasattr(pads, "tx_er"):
+                       self.sync += pads.tx_er.eq(0)
                tx_en_r = Signal()
                tx_data_r = Signal(4)
                self.sync += [
-                       pads.tx_er.eq(0),
                        pads.tx_en.eq(tx_en_r),
-                       pads.tx_data.eq(tx_data_r),
+                       pads.tx_data.eq(tx_data_r)
                ]
 
                fsm = FSM(reset_state="IDLE")