Routing problem for multi-pin port and anchors are debugged
This commit is contained in:
+18
-1
@@ -107,7 +107,24 @@ class PdkRegistry:
|
||||
if not yaml_path:
|
||||
return None
|
||||
with open(yaml_path, "r", encoding="utf-8") as file:
|
||||
return yaml.safe_load(file) or {}
|
||||
data = yaml.safe_load(file) or {}
|
||||
return self._normalize_pdk_pins(data)
|
||||
|
||||
def _normalize_pdk_pins(self, data: dict) -> dict:
|
||||
"""Treat legacy PDK `ports` metadata as `pins` inside approved PDK roots."""
|
||||
if (
|
||||
self._allows_legacy_ports_as_pins()
|
||||
and isinstance(data, dict)
|
||||
and "pins" not in data
|
||||
and isinstance(data.get("ports"), dict)
|
||||
):
|
||||
data = dict(data)
|
||||
data["pins"] = data["ports"]
|
||||
return data
|
||||
|
||||
def _allows_legacy_ports_as_pins(self) -> bool:
|
||||
normalized = self.public_root.replace("\\", "/").lower()
|
||||
return "/opt_pdk_public/" in f"{normalized}/" or "/opt_pdk_atlas/" in f"{normalized}/"
|
||||
|
||||
def _inside_root(self, path: str) -> bool:
|
||||
"""Check that a candidate asset path remains inside the permitted PDK root."""
|
||||
|
||||
Reference in New Issue
Block a user