Skip to content

Commit 5401647

Browse files
committed
Modify for multiple processes
1 parent 84d183f commit 5401647

File tree

7 files changed

+39
-15
lines changed

7 files changed

+39
-15
lines changed

chipflow_lib/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,17 @@ def _ensure_chipflow_root():
7474
"silicon": {
7575
"type": "object",
7676
"required": [
77-
"process",
77+
"processes",
7878
"package",
7979
],
8080
"additionalProperties": False,
8181
"properties": {
82-
"process": {
83-
"enum": ["sky130", "gf180", "customer1", "gf130bcd", "ihp_sg13g2"]
82+
"processes": {
83+
"type": "array",
84+
"items": {
85+
"type": "string",
86+
"enum": ["sky130", "gf180", "customer1", "gf130bcd", "ihp_sg13g2"]
87+
}
8488
},
8589
"package": {
8690
"enum": ["caravel", "cf20", "pga144"]

chipflow_lib/pin_lock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def lock_pins() -> None:
8686
oldlock = LockFile.model_validate_json(json_string)
8787

8888
print(f"Locking pins: {'using pins.lock' if lockfile.exists() else ''}")
89-
process_name = config["chipflow"]["silicon"]["process"]
89+
processes = config["chipflow"]["silicon"]["process"]
9090
package_name = config["chipflow"]["silicon"]["package"]
9191

9292
if package_name not in PACKAGE_DEFINITIONS:
@@ -146,7 +146,7 @@ def lock_pins() -> None:
146146
_map, _ = allocate_pins(k, v, pins)
147147
port_map.add_ports(component, k, _map)
148148

149-
newlock = LockFile(process=process_name,
149+
newlock = LockFile(processes=processes,
150150
package=package,
151151
port_map=port_map,
152152
metadata=interfaces)

chipflow_lib/platforms/utils.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,17 @@ def get_ports(self, component: str, name: str) -> Dict[str, Port]:
396396
return self[component][name]
397397

398398

399+
class Process(enum.Enum):
400+
SKY130 = "sky130"
401+
GF180 = "gf180"
402+
HELVELLYN2 = "helvellyn2"
403+
GF130BCD = "gf130bcd"
404+
IHP_SG13G2 = "ihp_sg13g2"
405+
406+
def __str__(self):
407+
return f'{self.name}'
408+
409+
399410
class LockFile(pydantic.BaseModel):
400411
"""
401412
Representation of a pin lock file.
@@ -405,7 +416,7 @@ class LockFile(pydantic.BaseModel):
405416
port_map: Mapping of components to interfaces to port
406417
metadata: Amaranth metadata, for reference
407418
"""
408-
process: str
419+
processes: List[Process]
409420
package: Package
410421
port_map: PortMap
411422
metadata: dict

chipflow_lib/steps/silicon.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,19 @@ def submit(self, rtlil_path, *, dry_run=False):
140140
for i in range(width):
141141
padname = f"{iface}{i}"
142142
logger.debug(f"padname={padname}, port={port}, loc={port.pins[i]}, "
143-
f"dir={port.direction}, width={width}")
143+
f"dir={port.direction}, width={width}")
144144
pads[padname] = {'loc': port.pins[i], 'type': port.direction.value}
145145
else:
146146
padname = f"{iface}"
147147

148148
logger.debug(f"padname={padname}, port={port}, loc={port.pins[0]}, "
149-
f"dir={port.direction}, width={width}")
149+
f"dir={port.direction}, width={width}")
150150
pads[padname] = {'loc': port.pins[0], 'type': port.direction.value}
151151

152-
153152
config = {
154153
"dependency_versions": dep_versions,
155154
"silicon": {
156-
"process": self.silicon_config["process"],
155+
"process": self.silicon_config["processes"][0],
157156
"pad_ring": self.silicon_config["package"],
158157
"pads": pads,
159158
"power": self.silicon_config.get("power", {})

docs/chipflow-toml-guide.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ You probably won't need to change these if you're starting from an example repos
5757
.. code-block:: TOML
5858
5959
[chipflow.silicon]
60-
process = "ihp_sg13g2"
60+
processes = [
61+
"ihp_sg13g2",
62+
"gf130bcd"
63+
]
6164
package = "pga144"
6265
6366
64-
The ``silicon`` section sets the Foundry ``process`` we are targeting for manufacturing, and the physical ``package`` we want to place our design inside.
65-
You'll choose the ``process`` and ``package`` based in the requirements of your design.
67+
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.
68+
You'll choose the ``processes`` and ``package`` based in the requirements of your design.
6669

6770
Available processes
6871
-------------------

docs/example-chipflow.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ default = 'sys_clk'
1414
default = 'sys_rst_n'
1515

1616
[chipflow.silicon]
17-
process = "gf130bcd"
17+
processes = [
18+
"gf130bcd",
19+
"gf130bcd"
20+
]
1821
package = "pga144"
1922

2023
[chipflow.silicon.pads]

tests/fixtures/mock.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ project_name = "proj-name"
55
silicon = "chipflow_lib.steps.silicon:SiliconStep"
66

77
[chipflow.silicon]
8-
process = "ihp_sg13g2"
8+
processes = [
9+
"ihp_sg13g2",
10+
"helvellyn2",
11+
"sky130"
12+
]
913
package = "pga144"
1014

1115
[chipflow.clocks]

0 commit comments

Comments
 (0)