liteeth_gen: Add toolchain support/parameter.

LiteX code specialization/generation can be different between toolchain (For the same vendor).
Add parameter to configure it from the .yml file.
This commit is contained in:
Florent Kermarrec 2022-01-26 09:57:43 +01:00
parent b38ca8d7c0
commit f264c9d5d5
3 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,7 @@
# PHY ----------------------------------------------------------------------
phy: LiteEthS7PHYRGMII
vendor: xilinx
toolchain: vivado
# Core ---------------------------------------------------------------------
clk_freq: 125e6
core: udp

View File

@ -7,6 +7,7 @@
# PHY ----------------------------------------------------------------------
phy: LiteEthPHYMII
vendor: xilinx
toolchain: vivado
# Core ---------------------------------------------------------------------
clk_freq: 100e6
core: wishbone

View File

@ -48,9 +48,11 @@ from liteeth.core import LiteEthUDPIPCore
# IOs ----------------------------------------------------------------------------------------------
_io = [
# Clk / Rst
("sys_clock", 0, Pins(1)),
("sys_reset", 1, Pins(1)),
# Interrupt
("interrupt", 0, Pins(1)),
# MII PHY Pads
@ -324,9 +326,11 @@ def main():
if "device" not in core_config:
core_config["device"] = ""
if core_config["vendor"] == "lattice":
platform = LatticePlatform(core_config["device"], io=[], toolchain="diamond")
toolchain = core_config.get("toolchain", "diamond")
platform = LatticePlatform(core_config["device"], io=[], toolchain=toolchain)
elif core_config["vendor"] == "xilinx":
platform = XilinxPlatform(core_config["device"], io=[], toolchain="vivado")
toolchain = core_config.get("toolchain", "vivado")
platform = XilinxPlatform(core_config["device"], io=[], toolchain=toolchain)
else:
raise ValueError("Unsupported vendor: {}".format(core_config["vendor"]))
platform.add_extension(_io)