Skip to content

Commit 796068a

Browse files
committed
Implement RFC 18: Reorganize vendor platforms
1 parent 88cbf30 commit 796068a

23 files changed

+4447
-4334
lines changed

amaranth/vendor/__init__.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# The machinery in this module is PEP 562 compliant.
2+
# See https://peps.python.org/pep-0562/ for details.
3+
4+
5+
# Keep this list sorted alphabetically.
6+
__all__ = [
7+
"GowinPlatform",
8+
"IntelPlatform",
9+
"LatticeECP5Platform",
10+
"LatticeICE40Platform",
11+
"LatticeMachXO2Platform",
12+
"LatticeMachXO3LPlatform",
13+
"QuicklogicPlatform",
14+
"XilinxPlatform",
15+
]
16+
17+
18+
def __dir__():
19+
return list({*globals(), *__all__})
20+
21+
22+
def __getattr__(name):
23+
if name == "GowinPlatform":
24+
from ._gowin import GowinPlatform
25+
return GowinPlatform
26+
if name == "IntelPlatform":
27+
from ._intel import IntelPlatform
28+
return IntelPlatform
29+
if name == "LatticeECP5Platform":
30+
from ._lattice_ecp5 import LatticeECP5Platform
31+
return LatticeECP5Platform
32+
if name == "LatticeICE40Platform":
33+
from ._lattice_ice40 import LatticeICE40Platform
34+
return LatticeICE40Platform
35+
if name in ("LatticeMachXO2Platform", "LatticeMachXO3LPlatform"):
36+
from ._lattice_machxo_2_3l import LatticeMachXO2Or3LPlatform
37+
return LatticeMachXO2Or3LPlatform
38+
if name == "QuicklogicPlatform":
39+
from ._quicklogic import QuicklogicPlatform
40+
return QuicklogicPlatform
41+
if name == "XilinxPlatform":
42+
from ._xilinx import XilinxPlatform
43+
return XilinxPlatform
44+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

0 commit comments

Comments
 (0)