liteeth/phy/gmii_mii: avoid doubling pads register on TX

This commit is contained in:
Florent Kermarrec 2015-04-12 20:11:08 +02:00
parent bc81d9d639
commit 0c27708b0a
3 changed files with 14 additions and 6 deletions

View File

@ -4,15 +4,19 @@ from misoclib.com.liteeth.common import *
from misoclib.com.liteeth.generic import * from misoclib.com.liteeth.generic import *
class LiteEthPHYGMIITX(Module): class LiteEthPHYGMIITX(Module):
def __init__(self, pads): def __init__(self, pads, pads_register):
self.sink = sink = Sink(eth_phy_description(8)) self.sink = sink = Sink(eth_phy_description(8))
### ###
if hasattr(pads, "tx_er"): if hasattr(pads, "tx_er"):
self.sync += pads.tx_er.eq(0) self.sync += pads.tx_er.eq(0)
self.sync += [ pads_eq = [
pads.tx_en.eq(sink.stb), pads.tx_en.eq(sink.stb),
pads.tx_data.eq(sink.data) pads.tx_data.eq(sink.data)
] ]
if pads_register:
self.sync += pads_eq
else:
self.comb += pads_eq
self.comb += sink.ack.eq(1) self.comb += sink.ack.eq(1)
class LiteEthPHYGMIIRX(Module): class LiteEthPHYGMIIRX(Module):

View File

@ -21,11 +21,11 @@ class LiteEthPHYGMIIMIITX(Module):
tx_pads_layout = [("tx_er", 1), ("tx_en", 1), ("tx_data", 8)] tx_pads_layout = [("tx_er", 1), ("tx_en", 1), ("tx_data", 8)]
gmii_tx_pads = Record(tx_pads_layout) gmii_tx_pads = Record(tx_pads_layout)
gmii_tx = LiteEthPHYGMIITX(gmii_tx_pads) gmii_tx = LiteEthPHYGMIITX(gmii_tx_pads, pads_register=False)
self.submodules += gmii_tx self.submodules += gmii_tx
mii_tx_pads = Record(tx_pads_layout) mii_tx_pads = Record(tx_pads_layout)
mii_tx = LiteEthPHYMIITX(mii_tx_pads) mii_tx = LiteEthPHYMIITX(mii_tx_pads, pads_register=False)
self.submodules += mii_tx self.submodules += mii_tx
demux = Demultiplexer(eth_phy_description(8), 2) demux = Demultiplexer(eth_phy_description(8), 2)

View File

@ -6,7 +6,7 @@ def converter_description(dw):
return EndpointDescription(payload_layout, packetized=True) return EndpointDescription(payload_layout, packetized=True)
class LiteEthPHYMIITX(Module): class LiteEthPHYMIITX(Module):
def __init__(self, pads): def __init__(self, pads, pads_register=True):
self.sink = sink = Sink(eth_phy_description(8)) self.sink = sink = Sink(eth_phy_description(8))
### ###
if hasattr(pads, "tx_er"): if hasattr(pads, "tx_er"):
@ -19,10 +19,14 @@ class LiteEthPHYMIITX(Module):
sink.ack.eq(converter.sink.ack), sink.ack.eq(converter.sink.ack),
converter.source.ack.eq(1) converter.source.ack.eq(1)
] ]
self.sync += [ pads_eq = [
pads.tx_en.eq(converter.source.stb), pads.tx_en.eq(converter.source.stb),
pads.tx_data.eq(converter.source.data) pads.tx_data.eq(converter.source.data)
] ]
if pads_register:
self.sync += pads_eq
else:
self.comb += pads_eq
class LiteEthPHYMIIRX(Module): class LiteEthPHYMIIRX(Module):
def __init__(self, pads): def __init__(self, pads):