Skip to content

Commit df3a465

Browse files
committed
Fix import scoping and naming for PackageDefs
1 parent 49594f9 commit df3a465

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

chipflow_lib/pin_lock.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
from typing import Any, List, Dict, Tuple
88

99
from chipflow_lib import _parse_config, ChipFlowError
10-
from chipflow_lib.platforms import PACKAGE_DEFINITIONS, PIN_ANNOTATION_SCHEMA, top_interfaces
11-
from chipflow_lib.platforms.utils import LockFile, Package, PortMap, Port
10+
from chipflow_lib.platforms import (
11+
PACKAGE_DEFINITIONS,
12+
PIN_ANNOTATION_SCHEMA,
13+
top_interfaces,
14+
LockFile,
15+
Package,
16+
PortMap,
17+
Port
18+
)
1219
from chipflow_lib.config_models import Config
1320

1421
# logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

chipflow_lib/platforms/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
__all__ = ['PIN_ANNOTATION_SCHEMA', 'PinSignature',
2121
'OutputPinSignature', 'InputPinSignature', 'BidirPinSignature',
22-
'load_pinlock', "PACKAGE_DEFINITIONS", 'top_interfaces']
22+
'load_pinlock', "PACKAGE_DEFINITIONS", 'top_interfaces', 'LockFile',
23+
'Package', 'PortMap', 'Port']
2324

2425

2526
logger = logging.getLogger(__name__)
@@ -246,7 +247,7 @@ class _BareDiePackageDef(_BasePackageDef):
246247
"""
247248

248249
# Used by pydantic to differentate when deserialising
249-
type: Literal["_QuadPackageDef"] = "_QuadPackageDef"
250+
type: Literal["_BarePackageDef"] = "_BarePackageDef"
250251

251252
width: int
252253
height: int
@@ -278,7 +279,7 @@ class _QuadPackageDef(_BasePackageDef):
278279
"""
279280

280281
# Used by pydantic to differentate when deserialising
281-
type: Literal["_PGAPackageDef"] = "_PGAPackageDef"
282+
type: Literal["_QuadPackageDef"] = "_QuadPackageDef"
282283

283284
width:int
284285
height: int
@@ -311,7 +312,7 @@ def sortpins(self, pins: Union[List[str], Set[str]]) -> List[str]:
311312
"cf20": _BareDiePackageDef(name="cf20", width=7, height=3)
312313
}
313314

314-
PackageDef = Union[_QuadPackageDef, _BasePackageDef]
315+
PackageDef = Union[_QuadPackageDef, _BareDiePackageDef]
315316

316317

317318
class Port(pydantic.BaseModel):

0 commit comments

Comments
 (0)