2021-03-25 11:22:33 -04:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import glob
|
|
|
|
import importlib
|
|
|
|
|
|
|
|
# Boards Vendors.
|
|
|
|
|
|
|
|
vendors = [
|
|
|
|
"1bitsquared",
|
2021-03-31 03:46:43 -04:00
|
|
|
"antmicro",
|
2021-11-04 13:42:16 -04:00
|
|
|
"berkeleylab",
|
2021-03-25 11:22:33 -04:00
|
|
|
"colorlight",
|
2021-05-06 03:45:00 -04:00
|
|
|
"decklink",
|
2021-03-25 11:22:33 -04:00
|
|
|
"digilent",
|
2021-11-12 12:03:39 -05:00
|
|
|
"efinix",
|
2021-03-25 11:22:33 -04:00
|
|
|
"enclustra",
|
|
|
|
"gsd",
|
2021-11-05 03:01:54 -04:00
|
|
|
"fairwaves",
|
2021-03-25 11:22:33 -04:00
|
|
|
"hackaday",
|
|
|
|
"kosagi",
|
2022-01-03 11:09:17 -05:00
|
|
|
"krtkl",
|
2021-03-25 11:22:33 -04:00
|
|
|
"lattice",
|
|
|
|
"lambdaconcept",
|
|
|
|
"linsn",
|
2021-05-07 03:10:51 -04:00
|
|
|
"muselab",
|
2021-09-15 00:50:57 -04:00
|
|
|
"myminieye",
|
2021-03-25 11:22:33 -04:00
|
|
|
"numato",
|
|
|
|
"qmtech",
|
2021-09-08 15:29:29 -04:00
|
|
|
"qwertyembedded",
|
2021-03-25 11:22:33 -04:00
|
|
|
"radiona",
|
|
|
|
"rhsresearchllc",
|
2021-09-21 03:55:22 -04:00
|
|
|
"rz",
|
2021-03-25 11:22:33 -04:00
|
|
|
"saanlima",
|
|
|
|
"scarabhardware",
|
|
|
|
"siglent",
|
2021-09-08 17:02:39 -04:00
|
|
|
"sipeed",
|
2022-01-06 03:06:27 -05:00
|
|
|
"seeedstudio",
|
2021-03-25 11:22:33 -04:00
|
|
|
"sqrl",
|
|
|
|
"terasic",
|
|
|
|
"trenz",
|
2021-08-13 10:23:39 -04:00
|
|
|
"tul",
|
2021-03-25 11:22:33 -04:00
|
|
|
"xilinx",
|
|
|
|
]
|
|
|
|
|
|
|
|
# Get all platforms/targets.
|
|
|
|
litex_boards_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
platforms = glob.glob(f"{litex_boards_dir}/platforms/*.py")
|
|
|
|
targets = glob.glob(f"{litex_boards_dir}/targets/*.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
|
|
|
|
|
|
|
|
# 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:
|
2021-04-10 05:41:13 -04:00
|
|
|
try:
|
|
|
|
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
|
|
|
|
except ModuleNotFoundError:
|
|
|
|
# Not all dependencies for this target is satisfied. Skip.
|
|
|
|
pass
|