import: allow importing directly from litex_boards.platforms or litex_boards.targets

This commit is contained in:
Florent Kermarrec 2019-09-03 15:23:40 +02:00
parent ec5540454b
commit b4eefa6c33
8 changed files with 30 additions and 55 deletions

View file

@ -1,6 +0,0 @@
from litex_boards.community.platforms import ac701
from litex_boards.community.platforms import de10lite
from litex_boards.community.platforms import de1soc
from litex_boards.community.platforms import de2_115
from litex_boards.community.platforms import ecp5_evn
from litex_boards.community.platforms import sp605

View file

@ -1,5 +0,0 @@
#from litex_boards.community.targets import ac701
#from litex_boards.community.targets import de10lite
#from litex_boards.community.targets import de1soc
#from litex_boards.community.targets import de2_115
#from litex_boards.community.targets import ecp5_evn

View file

@ -1,12 +0,0 @@
from litex_boards.official.platforms import arty
from litex_boards.official.platforms import avalanche
from litex_boards.official.platforms import de0nano
from litex_boards.official.platforms import genesys2
from litex_boards.official.platforms import kc705
from litex_boards.official.platforms import kcu105
from litex_boards.official.platforms import machxo3
from litex_boards.official.platforms import minispartan6
from litex_boards.official.platforms import nexys4ddr
from litex_boards.official.platforms import nexys_video
from litex_boards.official.platforms import versa_ecp3
from litex_boards.official.platforms import versa_ecp5

View file

@ -1,10 +0,0 @@
#from litex_boards.official.targets import arty
#from litex_boards.official.targets import de0nano
#from litex_boards.official.targets import genesys2
#from litex_boards.official.targets import kc705
#from litex_boards.official.targets import kcu105
#from litex_boards.official.targets import minispartan6
#from litex_boards.official.targets import nexys4ddr
#from litex_boards.official.targets import nexys_video
#from litex_boards.official.targets import simple
#from litex_boards.official.targets import versa_ecp5

View file

@ -1,10 +0,0 @@
from litex_boards.partner.platforms import aller
from litex_boards.partner.platforms import fomu_evt
from litex_boards.partner.platforms import fomu_hacker
from litex_boards.partner.platforms import fomu_pvt
from litex_boards.partner.platforms import nereid
from litex_boards.partner.platforms import netv2
from litex_boards.partner.platforms import tagus
from litex_boards.partner.platforms import tinyfpga_bx
from litex_boards.partner.platforms import trellisboard
from litex_boards.partner.platforms import ulx3s

View file

@ -1,6 +0,0 @@
#from litex_boards.partner.targets import aller
#from litex_boards.partner.targets import nereid
#from litex_boards.partner.targets import netv2
#from litex_boards.partner.targets import tagus
#from litex_boards.partner.targets import trellisboard
#from litex_boards.partner.targets import ulx3s

View file

@ -1,3 +1,15 @@
from litex_boards.official.platforms import *
from litex_boards.partner.platforms import *
from litex_boards.community.platforms import *
import sys
import importlib
class Platforms:
def __getattr__(self, name):
if name == "__path__":
return []
for support in ["official", "partner", "community"]:
try:
return importlib.import_module("litex_boards." + support + ".platforms." + name)
except:
pass
raise ModuleNotFoundError
sys.modules[__name__] = Platforms()

View file

@ -1,3 +1,15 @@
from litex_boards.official.targets import *
from litex_boards.partner.targets import *
from litex_boards.community.targets import *
import sys
import importlib
class Targets:
def __getattr__(self, name):
if name == "__path__":
return []
for support in ["official", "partner", "community"]:
try:
return importlib.import_module("litex_boards." + support + ".targets." + name)
except:
pass
raise ModuleNotFoundError
sys.modules[__name__] = Targets()