Skip to content

Commit 1099020

Browse files
committed
Fix import scoping and naming for PackageDefs
1 parent 42a2ee4 commit 1099020

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, _ensure_chipflow_root, 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__)
@@ -257,7 +258,7 @@ class _BareDiePackageDef(_BasePackageDef):
257258
"""
258259

259260
# Used by pydantic to differentate when deserialising
260-
type: Literal["_QuadPackageDef"] = "_QuadPackageDef"
261+
type: Literal["_BareDiePackageDef"] = "_BareDiePackageDef"
261262

262263
width: int
263264
height: int
@@ -289,7 +290,7 @@ class _QuadPackageDef(_BasePackageDef):
289290
"""
290291

291292
# Used by pydantic to differentate when deserialising
292-
type: Literal["_PGAPackageDef"] = "_PGAPackageDef"
293+
type: Literal["_QuadPackageDef"] = "_QuadPackageDef"
293294

294295
width:int
295296
height: int
@@ -322,7 +323,7 @@ def sortpins(self, pins: Union[List[str], Set[str]]) -> List[str]:
322323
"cf20": _BareDiePackageDef(name="cf20", width=7, height=3)
323324
}
324325

325-
PackageDef = Union[_QuadPackageDef, _BasePackageDef]
326+
PackageDef = Union[_QuadPackageDef, _BareDiePackageDef]
326327

327328

328329
class Port(pydantic.BaseModel):

0 commit comments

Comments
 (0)