liteeth/mac/core: Allow PHY to enforce with_preamble_crc/with_padding parameters.
Avoid exposing these parameters up to add_ethernet since appropriate behaviour is generally directly related to the type of PHY (ex LiteEthPHYModel or custom/specialized PHY).
This commit is contained in:
parent
1d19de09ef
commit
2b0156e9b3
|
@ -10,7 +10,6 @@
|
|||
|
||||
from liteeth.common import *
|
||||
from liteeth.mac import gap, preamble, crc, padding, last_be
|
||||
from liteeth.phy.model import LiteEthPHYModel
|
||||
|
||||
from migen.genlib.cdc import PulseSynchronizer
|
||||
|
||||
|
@ -46,8 +45,12 @@ class LiteEthMACCore(Module, AutoCSR):
|
|||
cd_tx = "eth_tx"
|
||||
cd_rx = "eth_rx"
|
||||
datapath_dw = phy_dw
|
||||
if isinstance(phy, LiteEthPHYModel):
|
||||
with_preamble_crc = False # Disable Preamble/CRC with PHY Model for direct connection to the Ethernet tap.
|
||||
|
||||
# If the PHY specifies preamble, CRC, or padding behavior, use it.
|
||||
if hasattr(phy, "with_preamble_crc"):
|
||||
with_preamble_crc = phy.with_preamble_crc
|
||||
if hasattr(phy, "with_padding"):
|
||||
with_padding = phy.with_padding
|
||||
|
||||
# CSRs.
|
||||
if with_preamble_crc:
|
||||
|
|
|
@ -35,6 +35,7 @@ class LiteEthPHYModelCRG(LiteXModule):
|
|||
|
||||
class LiteEthPHYModel(LiteXModule):
|
||||
dw = 8
|
||||
with_preamble_crc = False # Disable Preamble/CRC with for direct connection to the Ethernet tap.
|
||||
def __init__(self, pads):
|
||||
self.crg = LiteEthPHYModelCRG()
|
||||
self.sink = sink = stream.Endpoint(eth_phy_description(8))
|
||||
|
|
Loading…
Reference in New Issue