diff --git a/chipflow_lib/__init__.py b/chipflow_lib/__init__.py index 09adb0ba..9993d08d 100644 --- a/chipflow_lib/__init__.py +++ b/chipflow_lib/__init__.py @@ -80,6 +80,7 @@ def _ensure_chipflow_root(): "additionalProperties": False, "properties": { "process": { + "type": "string", "enum": ["sky130", "gf180", "customer1", "gf130bcd", "ihp_sg13g2"] }, "package": { diff --git a/chipflow_lib/pin_lock.py b/chipflow_lib/pin_lock.py index 9dff907b..f60986bc 100644 --- a/chipflow_lib/pin_lock.py +++ b/chipflow_lib/pin_lock.py @@ -86,6 +86,7 @@ def lock_pins() -> None: oldlock = LockFile.model_validate_json(json_string) print(f"Locking pins: {'using pins.lock' if lockfile.exists() else ''}") + process_name = config["chipflow"]["silicon"]["process"] package_name = config["chipflow"]["silicon"]["package"] if package_name not in PACKAGE_DEFINITIONS: @@ -145,7 +146,10 @@ def lock_pins() -> None: _map, _ = allocate_pins(k, v, pins) port_map.add_ports(component, k, _map) - newlock = LockFile(package=package, port_map=port_map, metadata=interfaces) + newlock = LockFile(process=process_name, + package=package, + port_map=port_map, + metadata=interfaces) with open('pins.lock', 'w') as f: f.write(newlock.model_dump_json(indent=2, serialize_as_any=True)) diff --git a/chipflow_lib/platforms/utils.py b/chipflow_lib/platforms/utils.py index 69cc4abd..a7f24542 100644 --- a/chipflow_lib/platforms/utils.py +++ b/chipflow_lib/platforms/utils.py @@ -396,6 +396,17 @@ def get_ports(self, component: str, name: str) -> Dict[str, Port]: return self[component][name] +class Process(enum.Enum): + SKY130 = "sky130" + GF180 = "gf180" + HELVELLYN2 = "helvellyn2" + GF130BCD = "gf130bcd" + IHP_SG13G2 = "ihp_sg13g2" + + def __str__(self): + return f'{self.name}' + + class LockFile(pydantic.BaseModel): """ Representation of a pin lock file. @@ -405,6 +416,7 @@ class LockFile(pydantic.BaseModel): port_map: Mapping of components to interfaces to port metadata: Amaranth metadata, for reference """ + process: Process package: Package port_map: PortMap metadata: dict diff --git a/chipflow_lib/steps/silicon.py b/chipflow_lib/steps/silicon.py index 4a393e43..ebc75ec1 100644 --- a/chipflow_lib/steps/silicon.py +++ b/chipflow_lib/steps/silicon.py @@ -140,16 +140,15 @@ def submit(self, rtlil_path, *, dry_run=False): for i in range(width): padname = f"{iface}{i}" logger.debug(f"padname={padname}, port={port}, loc={port.pins[i]}, " - f"dir={port.direction}, width={width}") + f"dir={port.direction}, width={width}") pads[padname] = {'loc': port.pins[i], 'type': port.direction.value} else: padname = f"{iface}" logger.debug(f"padname={padname}, port={port}, loc={port.pins[0]}, " - f"dir={port.direction}, width={width}") + f"dir={port.direction}, width={width}") pads[padname] = {'loc': port.pins[0], 'type': port.direction.value} - config = { "dependency_versions": dep_versions, "silicon": { diff --git a/docs/chipflow-toml-guide.rst b/docs/chipflow-toml-guide.rst index 07d7cbc0..7113588b 100644 --- a/docs/chipflow-toml-guide.rst +++ b/docs/chipflow-toml-guide.rst @@ -57,12 +57,15 @@ You probably won't need to change these if you're starting from an example repos .. code-block:: TOML [chipflow.silicon] - process = "ihp_sg13g2" + processes = [ + "ihp_sg13g2", + "gf130bcd" + ] package = "pga144" -The ``silicon`` section sets the Foundry ``process`` we are targeting for manufacturing, and the physical ``package`` we want to place our design inside. -You'll choose the ``process`` and ``package`` based in the requirements of your design. +The ``silicon`` section sets the Foundry ``processes`` (i.e. PDKs) that we are targeting for manufacturing, and the physical ``package`` we want to place our design inside. +You'll choose the ``processes`` and ``package`` based in the requirements of your design. Available processes ------------------- diff --git a/tests/fixtures/mock.toml b/tests/fixtures/mock.toml index 72e319e7..1b9a0cd0 100644 --- a/tests/fixtures/mock.toml +++ b/tests/fixtures/mock.toml @@ -5,7 +5,11 @@ project_name = "proj-name" silicon = "chipflow_lib.steps.silicon:SiliconStep" [chipflow.silicon] -process = "ihp_sg13g2" +processes = [ + "ihp_sg13g2", + "helvellyn2", + "sky130" +] package = "pga144" [chipflow.clocks]