diff --git a/litex_boards/platforms/__init__.py b/litex_boards/platforms/__init__.py index e69de29..4c27d15 100644 --- a/litex_boards/platforms/__init__.py +++ b/litex_boards/platforms/__init__.py @@ -0,0 +1,38 @@ +import os +import sys +import glob +import importlib + +# Boards Vendors. + +vendors = [ + "colorlight", + "digilent", + "enclustra", + "kosagi", + "lattice", + "linsn", + "numato", + "qmtech", + "terasic", + "sqrl", + "xilinx", +] + +# Get all platforms. +platforms_dir = os.path.dirname(os.path.realpath(__file__)) +platforms = glob.glob(f"{platforms_dir}/*.py") + +# For each platform: +for platform in platforms: + platform = os.path.basename(platform) + platform = platform.replace(".py", "") + # Verify if a Vendor prefix is present in platform name, if so create the short import to + # allow the platform to be imported with the full name or short name ex: + # from litex_boards.platforms import digilent_arty or + # from litex_boards.platforms import arty + if platform.split("_")[0] in vendors: + short_platform = platform[len(platform.split("_")[0])+1:] + p = importlib.import_module(f"litex_boards.platforms.{platform}") + vars()[short_platform] = p + sys.modules[f"litex_boards.platforms.{short_platform}"] = p diff --git a/litex_boards/platforms/arty.py b/litex_boards/platforms/digilent_arty.py similarity index 100% rename from litex_boards/platforms/arty.py rename to litex_boards/platforms/digilent_arty.py diff --git a/litex_boards/platforms/arty_s7.py b/litex_boards/platforms/digilent_arty_s7.py similarity index 100% rename from litex_boards/platforms/arty_s7.py rename to litex_boards/platforms/digilent_arty_s7.py diff --git a/litex_boards/platforms/genesys2.py b/litex_boards/platforms/digilent_genesys2.py similarity index 100% rename from litex_boards/platforms/genesys2.py rename to litex_boards/platforms/digilent_genesys2.py diff --git a/litex_boards/platforms/nexys4ddr.py b/litex_boards/platforms/digilent_nexys4ddr.py similarity index 100% rename from litex_boards/platforms/nexys4ddr.py rename to litex_boards/platforms/digilent_nexys4ddr.py diff --git a/litex_boards/platforms/nexys_video.py b/litex_boards/platforms/digilent_nexys_video.py similarity index 100% rename from litex_boards/platforms/nexys_video.py rename to litex_boards/platforms/digilent_nexys_video.py diff --git a/litex_boards/platforms/zedboard.py b/litex_boards/platforms/digilent_zedboard.py similarity index 100% rename from litex_boards/platforms/zedboard.py rename to litex_boards/platforms/digilent_zedboard.py diff --git a/litex_boards/platforms/zybo_z7.py b/litex_boards/platforms/digilent_zybo_z7.py similarity index 100% rename from litex_boards/platforms/zybo_z7.py rename to litex_boards/platforms/digilent_zybo_z7.py diff --git a/litex_boards/platforms/kx2.py b/litex_boards/platforms/enclustra_mercury_kx2.py similarity index 100% rename from litex_boards/platforms/kx2.py rename to litex_boards/platforms/enclustra_mercury_kx2.py diff --git a/litex_boards/platforms/mercury_xu5.py b/litex_boards/platforms/enclustra_mercury_xu5.py similarity index 100% rename from litex_boards/platforms/mercury_xu5.py rename to litex_boards/platforms/enclustra_mercury_xu5.py diff --git a/litex_boards/platforms/fomu_evt.py b/litex_boards/platforms/kosagi_fomu_evt.py similarity index 100% rename from litex_boards/platforms/fomu_evt.py rename to litex_boards/platforms/kosagi_fomu_evt.py diff --git a/litex_boards/platforms/fomu_hacker.py b/litex_boards/platforms/kosagi_fomu_hacker.py similarity index 100% rename from litex_boards/platforms/fomu_hacker.py rename to litex_boards/platforms/kosagi_fomu_hacker.py diff --git a/litex_boards/platforms/fomu_pvt.py b/litex_boards/platforms/kosagi_fomu_pvt.py similarity index 100% rename from litex_boards/platforms/fomu_pvt.py rename to litex_boards/platforms/kosagi_fomu_pvt.py diff --git a/litex_boards/platforms/netv2.py b/litex_boards/platforms/kosagi_netv2.py similarity index 100% rename from litex_boards/platforms/netv2.py rename to litex_boards/platforms/kosagi_netv2.py diff --git a/litex_boards/platforms/crosslink_nx_evn.py b/litex_boards/platforms/lattice_crosslink_nx_evn.py similarity index 100% rename from litex_boards/platforms/crosslink_nx_evn.py rename to litex_boards/platforms/lattice_crosslink_nx_evn.py diff --git a/litex_boards/platforms/crosslink_nx_vip.py b/litex_boards/platforms/lattice_crosslink_nx_vip.py similarity index 100% rename from litex_boards/platforms/crosslink_nx_vip.py rename to litex_boards/platforms/lattice_crosslink_nx_vip.py diff --git a/litex_boards/platforms/ecp5_evn.py b/litex_boards/platforms/lattice_ecp5_evn.py similarity index 100% rename from litex_boards/platforms/ecp5_evn.py rename to litex_boards/platforms/lattice_ecp5_evn.py diff --git a/litex_boards/platforms/machxo3.py b/litex_boards/platforms/lattice_machxo3.py similarity index 100% rename from litex_boards/platforms/machxo3.py rename to litex_boards/platforms/lattice_machxo3.py diff --git a/litex_boards/platforms/versa_ecp5.py b/litex_boards/platforms/lattice_versa_ecp5.py similarity index 100% rename from litex_boards/platforms/versa_ecp5.py rename to litex_boards/platforms/lattice_versa_ecp5.py diff --git a/litex_boards/platforms/aller.py b/litex_boards/platforms/numato_aller.py similarity index 100% rename from litex_boards/platforms/aller.py rename to litex_boards/platforms/numato_aller.py diff --git a/litex_boards/platforms/mimas_a7.py b/litex_boards/platforms/numato_mimas_a7.py similarity index 100% rename from litex_boards/platforms/mimas_a7.py rename to litex_boards/platforms/numato_mimas_a7.py diff --git a/litex_boards/platforms/nereid.py b/litex_boards/platforms/numato_nereid.py similarity index 100% rename from litex_boards/platforms/nereid.py rename to litex_boards/platforms/numato_nereid.py diff --git a/litex_boards/platforms/tagus.py b/litex_boards/platforms/numato_tagus.py similarity index 100% rename from litex_boards/platforms/tagus.py rename to litex_boards/platforms/numato_tagus.py diff --git a/litex_boards/platforms/acorn_cle_215.py b/litex_boards/platforms/sqrl_acorn_cle_215.py similarity index 100% rename from litex_boards/platforms/acorn_cle_215.py rename to litex_boards/platforms/sqrl_acorn_cle_215.py diff --git a/litex_boards/platforms/fk33.py b/litex_boards/platforms/sqrl_fk33.py similarity index 100% rename from litex_boards/platforms/fk33.py rename to litex_boards/platforms/sqrl_fk33.py diff --git a/litex_boards/platforms/xcu1525.py b/litex_boards/platforms/sqrl_xcu1525.py similarity index 100% rename from litex_boards/platforms/xcu1525.py rename to litex_boards/platforms/sqrl_xcu1525.py diff --git a/litex_boards/platforms/de0nano.py b/litex_boards/platforms/terasic_de0nano.py similarity index 100% rename from litex_boards/platforms/de0nano.py rename to litex_boards/platforms/terasic_de0nano.py diff --git a/litex_boards/platforms/de10lite.py b/litex_boards/platforms/terasic_de10lite.py similarity index 100% rename from litex_boards/platforms/de10lite.py rename to litex_boards/platforms/terasic_de10lite.py diff --git a/litex_boards/platforms/de10nano.py b/litex_boards/platforms/terasic_de10nano.py similarity index 100% rename from litex_boards/platforms/de10nano.py rename to litex_boards/platforms/terasic_de10nano.py diff --git a/litex_boards/platforms/de1soc.py b/litex_boards/platforms/terasic_de1soc.py similarity index 100% rename from litex_boards/platforms/de1soc.py rename to litex_boards/platforms/terasic_de1soc.py diff --git a/litex_boards/platforms/de2_115.py b/litex_boards/platforms/terasic_de2_115.py similarity index 100% rename from litex_boards/platforms/de2_115.py rename to litex_boards/platforms/terasic_de2_115.py diff --git a/litex_boards/platforms/deca.py b/litex_boards/platforms/terasic_deca.py similarity index 100% rename from litex_boards/platforms/deca.py rename to litex_boards/platforms/terasic_deca.py diff --git a/litex_boards/platforms/arrow_sockit.py b/litex_boards/platforms/terasic_sockit.py similarity index 100% rename from litex_boards/platforms/arrow_sockit.py rename to litex_boards/platforms/terasic_sockit.py diff --git a/litex_boards/platforms/c10lprefkit.py b/litex_boards/platforms/trenz_c10lprefkit.py similarity index 100% rename from litex_boards/platforms/c10lprefkit.py rename to litex_boards/platforms/trenz_c10lprefkit.py diff --git a/litex_boards/platforms/tec0117.py b/litex_boards/platforms/trenz_tec0117.py similarity index 100% rename from litex_boards/platforms/tec0117.py rename to litex_boards/platforms/trenz_tec0117.py diff --git a/litex_boards/platforms/ac701.py b/litex_boards/platforms/xilinx_ac701.py similarity index 100% rename from litex_boards/platforms/ac701.py rename to litex_boards/platforms/xilinx_ac701.py diff --git a/litex_boards/platforms/alveo_u250.py b/litex_boards/platforms/xilinx_alveo_u250.py similarity index 100% rename from litex_boards/platforms/alveo_u250.py rename to litex_boards/platforms/xilinx_alveo_u250.py diff --git a/litex_boards/platforms/alveo_u280.py b/litex_boards/platforms/xilinx_alveo_u280.py similarity index 100% rename from litex_boards/platforms/alveo_u280.py rename to litex_boards/platforms/xilinx_alveo_u280.py diff --git a/litex_boards/platforms/kc705.py b/litex_boards/platforms/xilinx_kc705.py similarity index 100% rename from litex_boards/platforms/kc705.py rename to litex_boards/platforms/xilinx_kc705.py diff --git a/litex_boards/platforms/kcu105.py b/litex_boards/platforms/xilinx_kcu105.py similarity index 100% rename from litex_boards/platforms/kcu105.py rename to litex_boards/platforms/xilinx_kcu105.py diff --git a/litex_boards/platforms/sp605.py b/litex_boards/platforms/xilinx_sp605.py similarity index 100% rename from litex_boards/platforms/sp605.py rename to litex_boards/platforms/xilinx_sp605.py diff --git a/litex_boards/platforms/vc707.py b/litex_boards/platforms/xilinx_vc707.py similarity index 100% rename from litex_boards/platforms/vc707.py rename to litex_boards/platforms/xilinx_vc707.py diff --git a/litex_boards/platforms/vcu118.py b/litex_boards/platforms/xilinx_vcu118.py similarity index 100% rename from litex_boards/platforms/vcu118.py rename to litex_boards/platforms/xilinx_vcu118.py diff --git a/litex_boards/platforms/zcu104.py b/litex_boards/platforms/xilinx_zcu104.py similarity index 100% rename from litex_boards/platforms/zcu104.py rename to litex_boards/platforms/xilinx_zcu104.py diff --git a/litex_boards/targets/__init__.py b/litex_boards/targets/__init__.py index e69de29..92ceb3d 100644 --- a/litex_boards/targets/__init__.py +++ b/litex_boards/targets/__init__.py @@ -0,0 +1,38 @@ +import os +import sys +import glob +import importlib + +# Boards Vendors. + +vendors = [ + "colorlight", + "digilent", + "enclustra", + "kosagi", + "lattice", + "linsn", + "numato", + "qmtech", + "terasic", + "sqrl", + "xilinx", +] + +# Get all targets. +targets_dir = os.path.dirname(os.path.realpath(__file__)) +targets = glob.glob(f"{targets_dir}/*.py") + +# For each target: +for target in targets: + target = os.path.basename(target) + target = target.replace(".py", "") + # Verify if a Vendor prefix is present in target name, if so create the short import to + # allow the target to be imported with the full name or short name ex: + # from litex_boards.targets import digilent_arty or + # from litex_boards.targets import arty + if target.split("_")[0] in vendors: + short_target = target[len(target.split("_")[0])+1:] + t = importlib.import_module(f"litex_boards.targets.{target}") + vars()[short_target] = t + sys.modules[f"litex_boards.targets.{short_target}"] = t diff --git a/litex_boards/targets/arty.py b/litex_boards/targets/digilent_arty.py similarity index 100% rename from litex_boards/targets/arty.py rename to litex_boards/targets/digilent_arty.py diff --git a/litex_boards/targets/arty_s7.py b/litex_boards/targets/digilent_arty_s7.py similarity index 100% rename from litex_boards/targets/arty_s7.py rename to litex_boards/targets/digilent_arty_s7.py diff --git a/litex_boards/targets/genesys2.py b/litex_boards/targets/digilent_genesys2.py similarity index 100% rename from litex_boards/targets/genesys2.py rename to litex_boards/targets/digilent_genesys2.py diff --git a/litex_boards/targets/nexys4ddr.py b/litex_boards/targets/digilent_nexys4ddr.py similarity index 100% rename from litex_boards/targets/nexys4ddr.py rename to litex_boards/targets/digilent_nexys4ddr.py diff --git a/litex_boards/targets/nexys_video.py b/litex_boards/targets/digilent_nexys_video.py similarity index 100% rename from litex_boards/targets/nexys_video.py rename to litex_boards/targets/digilent_nexys_video.py diff --git a/litex_boards/targets/kx2.py b/litex_boards/targets/enclustra_mercury_kx2.py similarity index 98% rename from litex_boards/targets/kx2.py rename to litex_boards/targets/enclustra_mercury_kx2.py index 9e845e2..21b851a 100755 --- a/litex_boards/targets/kx2.py +++ b/litex_boards/targets/enclustra_mercury_kx2.py @@ -11,7 +11,7 @@ import argparse from migen import * -from litex_boards.platforms import kx2 +from litex_boards.platforms import mercury_kx2 from litex.soc.cores.clock import * from litex.soc.integration.soc_core import * diff --git a/litex_boards/targets/mercury_xu5.py b/litex_boards/targets/enclustra_mercury_xu5.py similarity index 100% rename from litex_boards/targets/mercury_xu5.py rename to litex_boards/targets/enclustra_mercury_xu5.py diff --git a/litex_boards/targets/fomu.py b/litex_boards/targets/kosagi_fomu.py similarity index 100% rename from litex_boards/targets/fomu.py rename to litex_boards/targets/kosagi_fomu.py diff --git a/litex_boards/targets/netv2.py b/litex_boards/targets/kosagi_netv2.py similarity index 100% rename from litex_boards/targets/netv2.py rename to litex_boards/targets/kosagi_netv2.py diff --git a/litex_boards/targets/crosslink_nx_evn.py b/litex_boards/targets/lattice_crosslink_nx_evn.py similarity index 100% rename from litex_boards/targets/crosslink_nx_evn.py rename to litex_boards/targets/lattice_crosslink_nx_evn.py diff --git a/litex_boards/targets/crosslink_nx_vip.py b/litex_boards/targets/lattice_crosslink_nx_vip.py similarity index 100% rename from litex_boards/targets/crosslink_nx_vip.py rename to litex_boards/targets/lattice_crosslink_nx_vip.py diff --git a/litex_boards/targets/ecp5_evn.py b/litex_boards/targets/lattice_ecp5_evn.py similarity index 100% rename from litex_boards/targets/ecp5_evn.py rename to litex_boards/targets/lattice_ecp5_evn.py diff --git a/litex_boards/targets/aller.py b/litex_boards/targets/numato_aller.py similarity index 100% rename from litex_boards/targets/aller.py rename to litex_boards/targets/numato_aller.py diff --git a/litex_boards/targets/mimas_a7.py b/litex_boards/targets/numato_mimas_a7.py similarity index 100% rename from litex_boards/targets/mimas_a7.py rename to litex_boards/targets/numato_mimas_a7.py diff --git a/litex_boards/targets/nereid.py b/litex_boards/targets/numato_nereid.py similarity index 100% rename from litex_boards/targets/nereid.py rename to litex_boards/targets/numato_nereid.py diff --git a/litex_boards/targets/tagus.py b/litex_boards/targets/numato_tagus.py similarity index 100% rename from litex_boards/targets/tagus.py rename to litex_boards/targets/numato_tagus.py diff --git a/litex_boards/targets/acorn_cle_215.py b/litex_boards/targets/sqrl_acorn_cle_215.py similarity index 100% rename from litex_boards/targets/acorn_cle_215.py rename to litex_boards/targets/sqrl_acorn_cle_215.py diff --git a/litex_boards/targets/fk33.py b/litex_boards/targets/sqrl_fk33.py similarity index 100% rename from litex_boards/targets/fk33.py rename to litex_boards/targets/sqrl_fk33.py diff --git a/litex_boards/targets/xcu1525.py b/litex_boards/targets/sqrl_xcu1525.py similarity index 100% rename from litex_boards/targets/xcu1525.py rename to litex_boards/targets/sqrl_xcu1525.py diff --git a/litex_boards/targets/de0nano.py b/litex_boards/targets/terasic_de0nano.py similarity index 100% rename from litex_boards/targets/de0nano.py rename to litex_boards/targets/terasic_de0nano.py diff --git a/litex_boards/targets/de10lite.py b/litex_boards/targets/terasic_de10lite.py similarity index 100% rename from litex_boards/targets/de10lite.py rename to litex_boards/targets/terasic_de10lite.py diff --git a/litex_boards/targets/de10nano.py b/litex_boards/targets/terasic_de10nano.py similarity index 100% rename from litex_boards/targets/de10nano.py rename to litex_boards/targets/terasic_de10nano.py diff --git a/litex_boards/targets/de1soc.py b/litex_boards/targets/terasic_de1soc.py similarity index 100% rename from litex_boards/targets/de1soc.py rename to litex_boards/targets/terasic_de1soc.py diff --git a/litex_boards/targets/de2_115.py b/litex_boards/targets/terasic_de2_115.py similarity index 100% rename from litex_boards/targets/de2_115.py rename to litex_boards/targets/terasic_de2_115.py diff --git a/litex_boards/targets/deca.py b/litex_boards/targets/terasic_deca.py similarity index 100% rename from litex_boards/targets/deca.py rename to litex_boards/targets/terasic_deca.py diff --git a/litex_boards/targets/arrow_sockit.py b/litex_boards/targets/terasic_sockit.py similarity index 99% rename from litex_boards/targets/arrow_sockit.py rename to litex_boards/targets/terasic_sockit.py index 2ec8af2..36f3457 100755 --- a/litex_boards/targets/arrow_sockit.py +++ b/litex_boards/targets/terasic_sockit.py @@ -28,7 +28,7 @@ from litex.soc.cores.video import VideoVGAPHY from litex.build.io import DDROutput -from litex_boards.platforms import arrow_sockit +from litex_boards.platforms import terasic_sockit from litedram.modules import _TechnologyTimings, _SpeedgradeTimings, SDRModule, AS4C32M16 from litedram.phy import HalfRateGENSDRPHY, GENSDRPHY diff --git a/litex_boards/targets/c10lprefkit.py b/litex_boards/targets/trenz_c10lprefkit.py similarity index 100% rename from litex_boards/targets/c10lprefkit.py rename to litex_boards/targets/trenz_c10lprefkit.py diff --git a/litex_boards/targets/tec0117.py b/litex_boards/targets/trenz_tec0117.py similarity index 100% rename from litex_boards/targets/tec0117.py rename to litex_boards/targets/trenz_tec0117.py diff --git a/litex_boards/targets/ac701.py b/litex_boards/targets/xilinx_ac701.py similarity index 100% rename from litex_boards/targets/ac701.py rename to litex_boards/targets/xilinx_ac701.py diff --git a/litex_boards/targets/alveo_u250.py b/litex_boards/targets/xilinx_alveo_u250.py similarity index 100% rename from litex_boards/targets/alveo_u250.py rename to litex_boards/targets/xilinx_alveo_u250.py diff --git a/litex_boards/targets/alveo_u280.py b/litex_boards/targets/xilinx_alveo_u280.py similarity index 100% rename from litex_boards/targets/alveo_u280.py rename to litex_boards/targets/xilinx_alveo_u280.py diff --git a/litex_boards/targets/kc705.py b/litex_boards/targets/xilinx_kc705.py similarity index 100% rename from litex_boards/targets/kc705.py rename to litex_boards/targets/xilinx_kc705.py diff --git a/litex_boards/targets/kcu105.py b/litex_boards/targets/xilinx_kcu105.py similarity index 100% rename from litex_boards/targets/kcu105.py rename to litex_boards/targets/xilinx_kcu105.py diff --git a/litex_boards/targets/vc707.py b/litex_boards/targets/xilinx_vc707.py similarity index 100% rename from litex_boards/targets/vc707.py rename to litex_boards/targets/xilinx_vc707.py diff --git a/litex_boards/targets/vcu118.py b/litex_boards/targets/xilinx_vcu118.py similarity index 100% rename from litex_boards/targets/vcu118.py rename to litex_boards/targets/xilinx_vcu118.py diff --git a/litex_boards/targets/zcu104.py b/litex_boards/targets/xilinx_zcu104.py similarity index 100% rename from litex_boards/targets/zcu104.py rename to litex_boards/targets/xilinx_zcu104.py diff --git a/litex_boards/targets/zybo_z7.py b/litex_boards/targets/xilinx_zybo_z7.py similarity index 100% rename from litex_boards/targets/zybo_z7.py rename to litex_boards/targets/xilinx_zybo_z7.py