From 339fabf6151018a4927260c7c24292780f8ac24a Mon Sep 17 00:00:00 2001 From: Leon Schuermann Date: Wed, 1 Sep 2021 20:42:23 +0200 Subject: [PATCH] litex/soc: support model-version of GMII PHY in add_ether{net,bone} This not only tests for the precise PHY model, but also whether there is a model attribute in the ethphy instance and whether that is set to True. Signed-off-by: Leon Schuermann --- litex/soc/integration/soc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index f6567fa64..e957aa75b 100644 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -1433,7 +1433,7 @@ class LiteXSoC(SoC): # Timing constraints eth_rx_clk = getattr(phy, "crg", phy).cd_eth_rx.clk eth_tx_clk = getattr(phy, "crg", phy).cd_eth_tx.clk - if not isinstance(phy, LiteEthPHYModel): + if not isinstance(phy, LiteEthPHYModel) and not getattr(phy, "model", False): self.platform.add_period_constraint(eth_rx_clk, 1e9/phy.rx_clk_freq) self.platform.add_period_constraint(eth_tx_clk, 1e9/phy.tx_clk_freq) self.platform.add_false_path_constraints(self.crg.cd_sys.clk, eth_rx_clk, eth_tx_clk) @@ -1485,7 +1485,7 @@ class LiteXSoC(SoC): # Timing constraints eth_rx_clk = getattr(phy, "crg", phy).cd_eth_rx.clk eth_tx_clk = getattr(phy, "crg", phy).cd_eth_tx.clk - if not isinstance(phy, LiteEthPHYModel): + if not isinstance(phy, LiteEthPHYModel) and not getattr(phy, "model", False): self.platform.add_period_constraint(eth_rx_clk, 1e9/phy.rx_clk_freq) self.platform.add_period_constraint(eth_tx_clk, 1e9/phy.tx_clk_freq) self.platform.add_false_path_constraints(self.crg.cd_sys.clk, eth_rx_clk, eth_tx_clk)