siliconcompiler 0.34.2__py3-none-any.whl → 0.34.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- siliconcompiler/__init__.py +12 -5
- siliconcompiler/__main__.py +1 -7
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/_common.py +104 -23
- siliconcompiler/apps/sc.py +4 -8
- siliconcompiler/apps/sc_dashboard.py +6 -4
- siliconcompiler/apps/sc_install.py +10 -6
- siliconcompiler/apps/sc_issue.py +7 -5
- siliconcompiler/apps/sc_remote.py +1 -1
- siliconcompiler/apps/sc_server.py +9 -14
- siliconcompiler/apps/sc_show.py +6 -5
- siliconcompiler/apps/smake.py +130 -94
- siliconcompiler/apps/utils/replay.py +4 -7
- siliconcompiler/apps/utils/summarize.py +3 -5
- siliconcompiler/asic.py +420 -0
- siliconcompiler/checklist.py +25 -2
- siliconcompiler/cmdlineschema.py +534 -0
- siliconcompiler/constraints/asic_component.py +2 -2
- siliconcompiler/constraints/asic_pins.py +2 -2
- siliconcompiler/constraints/asic_timing.py +3 -3
- siliconcompiler/core.py +7 -32
- siliconcompiler/data/templates/tcl/manifest.tcl.j2 +8 -0
- siliconcompiler/dependencyschema.py +89 -31
- siliconcompiler/design.py +176 -207
- siliconcompiler/filesetschema.py +250 -0
- siliconcompiler/flowgraph.py +274 -95
- siliconcompiler/fpga.py +124 -1
- siliconcompiler/library.py +218 -20
- siliconcompiler/metric.py +233 -20
- siliconcompiler/package/__init__.py +271 -50
- siliconcompiler/package/git.py +92 -16
- siliconcompiler/package/github.py +108 -12
- siliconcompiler/package/https.py +79 -16
- siliconcompiler/packageschema.py +88 -7
- siliconcompiler/pathschema.py +31 -2
- siliconcompiler/pdk.py +566 -1
- siliconcompiler/project.py +1095 -94
- siliconcompiler/record.py +38 -1
- siliconcompiler/remote/__init__.py +5 -2
- siliconcompiler/remote/client.py +11 -6
- siliconcompiler/remote/schema.py +5 -23
- siliconcompiler/remote/server.py +41 -54
- siliconcompiler/report/__init__.py +3 -3
- siliconcompiler/report/dashboard/__init__.py +48 -14
- siliconcompiler/report/dashboard/cli/__init__.py +99 -21
- siliconcompiler/report/dashboard/cli/board.py +364 -179
- siliconcompiler/report/dashboard/web/__init__.py +90 -12
- siliconcompiler/report/dashboard/web/components/__init__.py +219 -240
- siliconcompiler/report/dashboard/web/components/flowgraph.py +49 -26
- siliconcompiler/report/dashboard/web/components/graph.py +139 -100
- siliconcompiler/report/dashboard/web/layouts/__init__.py +29 -1
- siliconcompiler/report/dashboard/web/layouts/_common.py +38 -2
- siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph.py +39 -26
- siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_node_tab.py +50 -50
- siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_sac_tabs.py +49 -46
- siliconcompiler/report/dashboard/web/state.py +141 -14
- siliconcompiler/report/dashboard/web/utils/__init__.py +79 -16
- siliconcompiler/report/dashboard/web/utils/file_utils.py +74 -11
- siliconcompiler/report/dashboard/web/viewer.py +25 -1
- siliconcompiler/report/report.py +5 -2
- siliconcompiler/report/summary_image.py +29 -11
- siliconcompiler/scheduler/__init__.py +9 -1
- siliconcompiler/scheduler/docker.py +79 -1
- siliconcompiler/scheduler/run_node.py +35 -19
- siliconcompiler/scheduler/scheduler.py +208 -24
- siliconcompiler/scheduler/schedulernode.py +372 -46
- siliconcompiler/scheduler/send_messages.py +77 -29
- siliconcompiler/scheduler/slurm.py +76 -12
- siliconcompiler/scheduler/taskscheduler.py +140 -20
- siliconcompiler/schema/__init__.py +0 -2
- siliconcompiler/schema/baseschema.py +194 -38
- siliconcompiler/schema/journal.py +7 -4
- siliconcompiler/schema/namedschema.py +16 -10
- siliconcompiler/schema/parameter.py +55 -9
- siliconcompiler/schema/parametervalue.py +60 -0
- siliconcompiler/schema/safeschema.py +25 -2
- siliconcompiler/schema/schema_cfg.py +5 -5
- siliconcompiler/schema/utils.py +2 -2
- siliconcompiler/schema_obj.py +20 -3
- siliconcompiler/tool.py +979 -302
- siliconcompiler/tools/bambu/__init__.py +41 -0
- siliconcompiler/tools/builtin/concatenate.py +2 -2
- siliconcompiler/tools/builtin/minimum.py +2 -1
- siliconcompiler/tools/builtin/mux.py +2 -1
- siliconcompiler/tools/builtin/nop.py +2 -1
- siliconcompiler/tools/builtin/verify.py +2 -1
- siliconcompiler/tools/klayout/__init__.py +95 -0
- siliconcompiler/tools/openroad/__init__.py +289 -0
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +7 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +8 -4
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +9 -5
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +5 -1
- siliconcompiler/tools/slang/__init__.py +1 -1
- siliconcompiler/tools/slang/elaborate.py +2 -1
- siliconcompiler/tools/vivado/scripts/sc_run.tcl +1 -1
- siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +8 -1
- siliconcompiler/tools/vivado/syn_fpga.py +6 -0
- siliconcompiler/tools/vivado/vivado.py +35 -2
- siliconcompiler/tools/vpr/__init__.py +150 -0
- siliconcompiler/tools/yosys/__init__.py +369 -1
- siliconcompiler/tools/yosys/scripts/procs.tcl +0 -1
- siliconcompiler/toolscripts/_tools.json +5 -10
- siliconcompiler/utils/__init__.py +66 -0
- siliconcompiler/utils/flowgraph.py +2 -2
- siliconcompiler/utils/issue.py +2 -1
- siliconcompiler/utils/logging.py +14 -0
- siliconcompiler/utils/multiprocessing.py +256 -0
- siliconcompiler/utils/showtools.py +10 -0
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/METADATA +5 -5
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/RECORD +115 -118
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/entry_points.txt +3 -0
- siliconcompiler/schema/cmdlineschema.py +0 -250
- siliconcompiler/toolscripts/rhel8/install-slang.sh +0 -40
- siliconcompiler/toolscripts/rhel9/install-slang.sh +0 -40
- siliconcompiler/toolscripts/ubuntu20/install-slang.sh +0 -47
- siliconcompiler/toolscripts/ubuntu22/install-slang.sh +0 -37
- siliconcompiler/toolscripts/ubuntu24/install-slang.sh +0 -37
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/licenses/LICENSE +0 -0
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/top_level.txt +0 -0
siliconcompiler/asic.py
CHANGED
|
@@ -1,7 +1,419 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
1
3
|
from siliconcompiler.schema import BaseSchema
|
|
2
4
|
from siliconcompiler.schema import EditableSchema, Parameter, PerNode, Scope
|
|
3
5
|
from siliconcompiler.schema.utils import trim
|
|
4
6
|
|
|
7
|
+
from siliconcompiler import Project
|
|
8
|
+
|
|
9
|
+
from siliconcompiler.constraints import \
|
|
10
|
+
ASICTimingConstraintSchema, ASICAreaConstraint, \
|
|
11
|
+
ASICComponentConstraints, ASICPinConstraints
|
|
12
|
+
from siliconcompiler.metrics import ASICMetricsSchema
|
|
13
|
+
|
|
14
|
+
from siliconcompiler import PDKSchema
|
|
15
|
+
from siliconcompiler import StdCellLibrarySchema
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ASICProject(Project):
|
|
19
|
+
"""
|
|
20
|
+
The ASICProject class extends the base Project class to provide
|
|
21
|
+
specialized functionality and schema parameters for Application-Specific
|
|
22
|
+
Integrated Circuit (ASIC) design flows.
|
|
23
|
+
|
|
24
|
+
It includes specific constraints (timing, component, pin, area) and
|
|
25
|
+
ASIC-related options such as PDK selection, main logic library,
|
|
26
|
+
additional ASIC libraries, delay models, and routing layer limits.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def __init__(self):
|
|
30
|
+
super().__init__()
|
|
31
|
+
|
|
32
|
+
schema = EditableSchema(self)
|
|
33
|
+
schema.insert("constraint", "timing", ASICTimingConstraintSchema())
|
|
34
|
+
schema.insert("constraint", "component", ASICComponentConstraints())
|
|
35
|
+
schema.insert("constraint", "pin", ASICPinConstraints())
|
|
36
|
+
schema.insert("constraint", "area", ASICAreaConstraint())
|
|
37
|
+
|
|
38
|
+
# Replace metrics with asic metrics
|
|
39
|
+
schema.insert("metric", ASICMetricsSchema(), clobber=True)
|
|
40
|
+
|
|
41
|
+
schema.insert(
|
|
42
|
+
"asic", "pdk",
|
|
43
|
+
Parameter(
|
|
44
|
+
"str",
|
|
45
|
+
scope=Scope.GLOBAL,
|
|
46
|
+
shorthelp="ASIC: PDK target",
|
|
47
|
+
example=["api: project.set('asic', 'pdk', 'freepdk45')"],
|
|
48
|
+
help=trim("""Target PDK used during compilation.""")))
|
|
49
|
+
schema.insert(
|
|
50
|
+
"asic", "mainlib",
|
|
51
|
+
Parameter(
|
|
52
|
+
"str",
|
|
53
|
+
scope=Scope.GLOBAL,
|
|
54
|
+
shorthelp="ASIC: main logic library",
|
|
55
|
+
example=["api: project.set('asic', 'mainlib', 'nangate45')"],
|
|
56
|
+
help=trim("""Main logic library to use during the run""")))
|
|
57
|
+
schema.insert(
|
|
58
|
+
"asic", "asiclib",
|
|
59
|
+
Parameter(
|
|
60
|
+
"[str]",
|
|
61
|
+
scope=Scope.GLOBAL,
|
|
62
|
+
shorthelp="ASIC: logic libraries",
|
|
63
|
+
example=["api: chip.set('asic', 'asiclib', 'nangate45')"],
|
|
64
|
+
help=trim("""List of all selected logic libraries
|
|
65
|
+
to use for optimization for a given library architecture
|
|
66
|
+
(9T, 11T, etc).""")))
|
|
67
|
+
schema.insert(
|
|
68
|
+
"asic", "delaymodel",
|
|
69
|
+
Parameter(
|
|
70
|
+
"str",
|
|
71
|
+
scope=Scope.GLOBAL,
|
|
72
|
+
shorthelp="ASIC: delay model",
|
|
73
|
+
example=["api: chip.set('asic', 'delaymodel', 'ccs')"],
|
|
74
|
+
help=trim("""Delay model to use for the target libs. Commonly supported values
|
|
75
|
+
are nldm and ccs.""")))
|
|
76
|
+
|
|
77
|
+
schema.insert(
|
|
78
|
+
"asic", "minlayer",
|
|
79
|
+
Parameter(
|
|
80
|
+
"str",
|
|
81
|
+
scope=Scope.GLOBAL,
|
|
82
|
+
shorthelp="ASIC: Minimum routing layer",
|
|
83
|
+
example=["api: project.set('asic', 'minlayer', 'M2')"],
|
|
84
|
+
help=trim("""Minimum metal layer to be used for automated place and route""")))
|
|
85
|
+
schema.insert(
|
|
86
|
+
"asic", "maxlayer",
|
|
87
|
+
Parameter(
|
|
88
|
+
"str",
|
|
89
|
+
scope=Scope.GLOBAL,
|
|
90
|
+
shorthelp="ASIC: maximum routing layer",
|
|
91
|
+
example=["api: project.set('asic', 'maxlayer', 'M7')"],
|
|
92
|
+
help=trim("""Maximum metal layer to be used for automated place and route""")))
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def _getdict_type(cls) -> str:
|
|
96
|
+
"""
|
|
97
|
+
Returns the meta data for getdict, specifically the class name
|
|
98
|
+
'ASICProject'.
|
|
99
|
+
|
|
100
|
+
This method overrides the parent `Project._getdict_type` to ensure
|
|
101
|
+
that when an `ASICProject` instance is serialized or deserialized,
|
|
102
|
+
it is correctly identified as an `ASICProject` type.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
str: The name of the `ASICProject` class.
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
return ASICProject.__name__
|
|
109
|
+
|
|
110
|
+
def add_dep(self, obj):
|
|
111
|
+
"""
|
|
112
|
+
Adds a dependency object to the ASIC project, with specialized handling
|
|
113
|
+
for PDK and standard cell libraries.
|
|
114
|
+
|
|
115
|
+
This method extends the base `Project.add_dep` functionality. If the
|
|
116
|
+
object is a `StdCellLibrarySchema` or `PDKSchema`, it is inserted
|
|
117
|
+
into the project's library schema, potentially clobbering existing
|
|
118
|
+
entries. For other dependency types, it defers to the parent class's
|
|
119
|
+
`add_dep` method. It also ensures that internal dependencies are
|
|
120
|
+
imported.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
obj (Union[StdCellLibrarySchema, PDKSchema, DesignSchema, FlowgraphSchema,
|
|
124
|
+
LibrarySchema, ChecklistSchema, List, Set, Tuple]):
|
|
125
|
+
The dependency object(s) to add.
|
|
126
|
+
"""
|
|
127
|
+
if isinstance(obj, (list, set, tuple)):
|
|
128
|
+
for iobj in obj:
|
|
129
|
+
self.add_dep(iobj)
|
|
130
|
+
return
|
|
131
|
+
|
|
132
|
+
if isinstance(obj, StdCellLibrarySchema):
|
|
133
|
+
if not self.has_library(obj.name):
|
|
134
|
+
EditableSchema(self).insert("library", obj.name, obj)
|
|
135
|
+
elif isinstance(obj, PDKSchema):
|
|
136
|
+
if not self.has_library(obj.name):
|
|
137
|
+
EditableSchema(self).insert("library", obj.name, obj)
|
|
138
|
+
else:
|
|
139
|
+
return super().add_dep(obj)
|
|
140
|
+
|
|
141
|
+
self._import_dep(obj)
|
|
142
|
+
|
|
143
|
+
def check_manifest(self) -> bool:
|
|
144
|
+
"""
|
|
145
|
+
Performs a comprehensive check of the ASIC project's manifest
|
|
146
|
+
for consistency and validity, extending the base Project checks.
|
|
147
|
+
|
|
148
|
+
This method first calls the `Project.check_manifest` method.
|
|
149
|
+
Then, it performs additional ASIC-specific validations:
|
|
150
|
+
- Asserts that `[asic,pdk]` is set and refers to a loaded PDK library.
|
|
151
|
+
- Checks if `[asic,mainlib]` is set and refers to a loaded library (warns if not set).
|
|
152
|
+
- Asserts that `[asic,asiclib]` contains at least one library and all
|
|
153
|
+
listed libraries are loaded.
|
|
154
|
+
- Ensures that the `mainlib` is included in the `asiclib` list if both are set.
|
|
155
|
+
- Asserts that `[asic,delaymodel]` is set.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
bool: True if the manifest is valid and all checks pass, False otherwise.
|
|
159
|
+
"""
|
|
160
|
+
error = not super().check_manifest()
|
|
161
|
+
|
|
162
|
+
pdk = self.get("asic", "pdk")
|
|
163
|
+
if not pdk:
|
|
164
|
+
# assert pdk is set
|
|
165
|
+
self.logger.error("[asic,pdk] has not been set")
|
|
166
|
+
error = True
|
|
167
|
+
else:
|
|
168
|
+
# Assert mainlib exists
|
|
169
|
+
if pdk not in self.getkeys("library"):
|
|
170
|
+
error = True
|
|
171
|
+
self.logger.error(f"{pdk} library has not been loaded")
|
|
172
|
+
elif not isinstance(self.get("library", pdk, field="schema"), PDKSchema):
|
|
173
|
+
error = True
|
|
174
|
+
self.logger.error(f"{pdk} must be a PDK")
|
|
175
|
+
|
|
176
|
+
mainlib = self.get("asic", "mainlib")
|
|
177
|
+
if not mainlib:
|
|
178
|
+
# soft - assert mainlib is set
|
|
179
|
+
self.logger.warning("[asic,mainlib] has not been set, this will be inferred")
|
|
180
|
+
else:
|
|
181
|
+
# Assert mainlib exists
|
|
182
|
+
if mainlib not in self.getkeys("library"):
|
|
183
|
+
error = True
|
|
184
|
+
self.logger.error(f"{mainlib} library has not been loaded")
|
|
185
|
+
|
|
186
|
+
# Assert asiclib is set
|
|
187
|
+
if not self.get("asic", "asiclib"):
|
|
188
|
+
error = True
|
|
189
|
+
self.logger.error("[asic,asiclib] does not contain any libraries")
|
|
190
|
+
|
|
191
|
+
# Assert asiclibs exist
|
|
192
|
+
for lib in self.get("asic", "asiclib"):
|
|
193
|
+
if lib not in self.getkeys("library"):
|
|
194
|
+
error = True
|
|
195
|
+
self.logger.error(f"{lib} library has not been loaded")
|
|
196
|
+
|
|
197
|
+
# Assert mainlib in asiclib exist
|
|
198
|
+
if mainlib and mainlib not in self.get("asic", "asiclib"):
|
|
199
|
+
error = True
|
|
200
|
+
self.logger.error(f"{mainlib} library must be added to [asic,asiclib]")
|
|
201
|
+
|
|
202
|
+
# Assert asiclibs exist
|
|
203
|
+
if not self.get("asic", "delaymodel"):
|
|
204
|
+
error = True
|
|
205
|
+
self.logger.error("[asic,delaymodel] has not been set")
|
|
206
|
+
|
|
207
|
+
# Assert asic,pdk is set in libraries and all point the same pdk-ish
|
|
208
|
+
# Assert stackups align in libraries
|
|
209
|
+
|
|
210
|
+
return not error
|
|
211
|
+
|
|
212
|
+
def set_mainlib(self, library: Union[StdCellLibrarySchema, str]):
|
|
213
|
+
"""
|
|
214
|
+
Sets the main standard cell library for the ASIC project.
|
|
215
|
+
|
|
216
|
+
This library is typically the primary logic library used during the ASIC flow.
|
|
217
|
+
If a `StdCellLibrarySchema` object is provided, it is first added as a dependency.
|
|
218
|
+
|
|
219
|
+
Args:
|
|
220
|
+
library (Union[StdCellLibrarySchema, str]): The standard cell library object
|
|
221
|
+
or its name (string) to be set as the main
|
|
222
|
+
library.
|
|
223
|
+
|
|
224
|
+
Returns:
|
|
225
|
+
Any: The result of setting the parameter in the schema.
|
|
226
|
+
|
|
227
|
+
Raises:
|
|
228
|
+
TypeError: If the provided `library` is not a string or a `StdCellLibrarySchema` object.
|
|
229
|
+
"""
|
|
230
|
+
if isinstance(library, StdCellLibrarySchema):
|
|
231
|
+
self.add_dep(library)
|
|
232
|
+
library = library.name
|
|
233
|
+
elif not isinstance(library, str):
|
|
234
|
+
raise TypeError("main library must be string or standard cell library object")
|
|
235
|
+
|
|
236
|
+
return self.set("asic", "mainlib", library)
|
|
237
|
+
|
|
238
|
+
def set_pdk(self, pdk: Union[PDKSchema, str]):
|
|
239
|
+
"""
|
|
240
|
+
Sets the Process Design Kit (PDK) for the ASIC project.
|
|
241
|
+
|
|
242
|
+
The PDK defines the technology-specific information required for ASIC compilation.
|
|
243
|
+
If a `PDKSchema` object is provided, it is first added as a dependency.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
pdk (Union[PDKSchema, str]): The PDK object or its name (string)
|
|
247
|
+
to be set as the project's PDK.
|
|
248
|
+
|
|
249
|
+
Returns:
|
|
250
|
+
Any: The result of setting the parameter in the schema.
|
|
251
|
+
|
|
252
|
+
Raises:
|
|
253
|
+
TypeError: If the provided `pdk` is not a string or a `PDKSchema` object.
|
|
254
|
+
"""
|
|
255
|
+
if isinstance(pdk, PDKSchema):
|
|
256
|
+
self.add_dep(pdk)
|
|
257
|
+
pdk = pdk.name
|
|
258
|
+
elif not isinstance(pdk, str):
|
|
259
|
+
raise TypeError("pdk must be string or PDK object")
|
|
260
|
+
|
|
261
|
+
return self.set("asic", "pdk", pdk)
|
|
262
|
+
|
|
263
|
+
def add_asiclib(self, library: Union[StdCellLibrarySchema, str], clobber: bool = False):
|
|
264
|
+
"""
|
|
265
|
+
Adds one or more ASIC logic libraries to be used in the project.
|
|
266
|
+
|
|
267
|
+
These libraries are typically used for optimization during the ASIC flow,
|
|
268
|
+
complementing the main library.
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
library (Union[StdCellLibrarySchema, str]): The standard cell library object
|
|
272
|
+
or its name (string) to add.
|
|
273
|
+
clobber (bool): If True, existing ASIC libraries will be replaced by the new ones.
|
|
274
|
+
If False, new libraries will be added to the existing list.
|
|
275
|
+
Defaults to False.
|
|
276
|
+
|
|
277
|
+
Returns:
|
|
278
|
+
Any: The result of adding the parameter to the schema.
|
|
279
|
+
|
|
280
|
+
Raises:
|
|
281
|
+
TypeError: If the provided `library` is not a string or a `StdCellLibrarySchema` object.
|
|
282
|
+
"""
|
|
283
|
+
if isinstance(library, (list, set, tuple)):
|
|
284
|
+
if clobber:
|
|
285
|
+
self.unset("asic", "asiclib")
|
|
286
|
+
|
|
287
|
+
ret = []
|
|
288
|
+
for lib in library:
|
|
289
|
+
ret.append(self.add_asiclib(lib))
|
|
290
|
+
return ret
|
|
291
|
+
|
|
292
|
+
if isinstance(library, StdCellLibrarySchema):
|
|
293
|
+
self.add_dep(library)
|
|
294
|
+
library = library.name
|
|
295
|
+
elif not isinstance(library, str):
|
|
296
|
+
raise TypeError("asic library must be string or standard cell library object")
|
|
297
|
+
|
|
298
|
+
if clobber:
|
|
299
|
+
return self.set("asic", "asiclib", library)
|
|
300
|
+
else:
|
|
301
|
+
return self.add("asic", "asiclib", library)
|
|
302
|
+
|
|
303
|
+
def set_asic_routinglayers(self, min: str = None, max: str = None):
|
|
304
|
+
"""
|
|
305
|
+
Sets the minimum and/or maximum metal layers to be used for automated
|
|
306
|
+
place and route in the ASIC flow.
|
|
307
|
+
|
|
308
|
+
Args:
|
|
309
|
+
min (str, optional): The name of the minimum metal layer (e.g., 'M2').
|
|
310
|
+
Defaults to None.
|
|
311
|
+
max (str, optional): The name of the maximum metal layer (e.g., 'M7').
|
|
312
|
+
Defaults to None.
|
|
313
|
+
"""
|
|
314
|
+
if min:
|
|
315
|
+
self.set("asic", "minlayer", min)
|
|
316
|
+
if max:
|
|
317
|
+
self.set("asic", "maxlayer", max)
|
|
318
|
+
|
|
319
|
+
def set_asic_delaymodel(self, model: str):
|
|
320
|
+
"""
|
|
321
|
+
Sets the delay model for timing analysis.
|
|
322
|
+
|
|
323
|
+
Args:
|
|
324
|
+
model (str): The delay model to use (e.g., 'nldm', 'ccs').
|
|
325
|
+
"""
|
|
326
|
+
self.set("asic", "delaymodel", model)
|
|
327
|
+
|
|
328
|
+
def get_timingconstraints(self) -> ASICTimingConstraintSchema:
|
|
329
|
+
"""
|
|
330
|
+
Retrieves the ASIC timing constraint schema for the project.
|
|
331
|
+
|
|
332
|
+
Returns:
|
|
333
|
+
ASICTimingConstraintSchema: The timing constraint schema object.
|
|
334
|
+
"""
|
|
335
|
+
return self.get("constraint", "timing", field="schema")
|
|
336
|
+
|
|
337
|
+
def get_pinconstraints(self) -> ASICPinConstraints:
|
|
338
|
+
"""
|
|
339
|
+
Retrieves the ASIC pin constraint schema for the project.
|
|
340
|
+
|
|
341
|
+
Returns:
|
|
342
|
+
ASICPinConstraints: The pin constraint schema object.
|
|
343
|
+
"""
|
|
344
|
+
return self.get("constraint", "pin", field="schema")
|
|
345
|
+
|
|
346
|
+
def get_componentconstraints(self) -> ASICComponentConstraints:
|
|
347
|
+
"""
|
|
348
|
+
Retrieves the ASIC component constraint schema for the project.
|
|
349
|
+
|
|
350
|
+
Returns:
|
|
351
|
+
ASICComponentConstraints: The component constraint schema object.
|
|
352
|
+
"""
|
|
353
|
+
return self.get("constraint", "component", field="schema")
|
|
354
|
+
|
|
355
|
+
def get_areaconstraints(self) -> ASICAreaConstraint:
|
|
356
|
+
"""
|
|
357
|
+
Retrieves the ASIC area constraint schema for the project.
|
|
358
|
+
|
|
359
|
+
Returns:
|
|
360
|
+
ASICAreaConstraint: The area constraint schema object.
|
|
361
|
+
"""
|
|
362
|
+
return self.get("constraint", "area", field="schema")
|
|
363
|
+
|
|
364
|
+
def _init_run(self):
|
|
365
|
+
"""
|
|
366
|
+
This method ensures that if `[asic,mainlib]` or `[asic,pdk]` are not
|
|
367
|
+
explicitly set but can be inferred (e.g., from `asiclib` or the main
|
|
368
|
+
library's PDK), they are automatically configured. It also verifies
|
|
369
|
+
that the `mainlib` is included in the `asiclib` list.
|
|
370
|
+
"""
|
|
371
|
+
# Ensure mainlib is set
|
|
372
|
+
if not self.get("asic", "mainlib") and self.get("asic", "asiclib"):
|
|
373
|
+
mainlib = self.get("asic", "asiclib")[0]
|
|
374
|
+
self.logger.warning(f"Setting main library to: {mainlib}")
|
|
375
|
+
self.set_mainlib(mainlib)
|
|
376
|
+
|
|
377
|
+
if not self.get("asic", "pdk") and self.get("asic", "mainlib"):
|
|
378
|
+
mainlib = None
|
|
379
|
+
if self.has_library(self.get("asic", "mainlib")):
|
|
380
|
+
mainlib = self.get("library", self.get("asic", "mainlib"), field="schema")
|
|
381
|
+
if mainlib:
|
|
382
|
+
mainlib_pdk = mainlib.get("asic", "pdk")
|
|
383
|
+
if mainlib_pdk:
|
|
384
|
+
# Infer from main library
|
|
385
|
+
self.logger.warning(f"Setting pdk to: {mainlib_pdk}")
|
|
386
|
+
self.set("asic", "pdk", mainlib_pdk)
|
|
387
|
+
|
|
388
|
+
if self.get("asic", "mainlib") not in self.get("asic", "asiclib"):
|
|
389
|
+
# Ensure mainlib is added to asiclib
|
|
390
|
+
self.logger.warning(f'Adding {self.get("asic", "mainlib")} to [asic,asiclib]')
|
|
391
|
+
self.add("asic", "asiclib", self.get("asic", "mainlib"))
|
|
392
|
+
|
|
393
|
+
def _summary_headers(self):
|
|
394
|
+
"""
|
|
395
|
+
Generates a list of key-value pairs representing ASIC-specific headers
|
|
396
|
+
to be included in the summary report.
|
|
397
|
+
|
|
398
|
+
This method extends the base `Project._summary_headers` by adding
|
|
399
|
+
information about the selected PDK, main logic library, and a list of
|
|
400
|
+
all ASIC logic libraries used in the project.
|
|
401
|
+
|
|
402
|
+
Returns:
|
|
403
|
+
List[Tuple[str, str]]: A list of tuples, where each tuple contains
|
|
404
|
+
a header name (str) and its corresponding value (str).
|
|
405
|
+
"""
|
|
406
|
+
headers = super()._summary_headers()
|
|
407
|
+
|
|
408
|
+
headers.append(("pdk", self.get("asic", "pdk")))
|
|
409
|
+
headers.append(("mainlib", self.get("asic", "mainlib")))
|
|
410
|
+
|
|
411
|
+
asiclib = self.get("asic", "asiclib")
|
|
412
|
+
if len(asiclib) > 1:
|
|
413
|
+
headers.append(("asiclib", ", ".join(asiclib)))
|
|
414
|
+
|
|
415
|
+
return headers
|
|
416
|
+
|
|
5
417
|
|
|
6
418
|
class ASICSchema(BaseSchema):
|
|
7
419
|
def __init__(self):
|
|
@@ -9,6 +421,14 @@ class ASICSchema(BaseSchema):
|
|
|
9
421
|
|
|
10
422
|
schema_asic(self)
|
|
11
423
|
|
|
424
|
+
@classmethod
|
|
425
|
+
def _getdict_type(cls) -> str:
|
|
426
|
+
"""
|
|
427
|
+
Returns the meta data for getdict
|
|
428
|
+
"""
|
|
429
|
+
|
|
430
|
+
return ASICSchema.__name__
|
|
431
|
+
|
|
12
432
|
|
|
13
433
|
###############################################################################
|
|
14
434
|
# ASIC
|
siliconcompiler/checklist.py
CHANGED
|
@@ -10,7 +10,16 @@ from siliconcompiler import NodeStatus, utils
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class ChecklistSchema(NamedSchema):
|
|
13
|
+
"""
|
|
14
|
+
A class for managing design checklists and their verification.
|
|
15
|
+
"""
|
|
13
16
|
def __init__(self, name=None):
|
|
17
|
+
"""
|
|
18
|
+
Initializes the ChecklistSchema object.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
name (str, optional): The name of the checklist standard. Defaults to None.
|
|
22
|
+
"""
|
|
14
23
|
super().__init__()
|
|
15
24
|
self.set_name(name)
|
|
16
25
|
|
|
@@ -57,7 +66,7 @@ class ChecklistSchema(NamedSchema):
|
|
|
57
66
|
assert hasattr(schema_root, "history"), f"{schema_root}"
|
|
58
67
|
|
|
59
68
|
if logger:
|
|
60
|
-
logger.info(f'Checking checklist {self.name
|
|
69
|
+
logger.info(f'Checking checklist {self.name}')
|
|
61
70
|
|
|
62
71
|
if items is None:
|
|
63
72
|
items = self.getkeys()
|
|
@@ -72,7 +81,7 @@ class ChecklistSchema(NamedSchema):
|
|
|
72
81
|
for item in items:
|
|
73
82
|
if item not in self.getkeys():
|
|
74
83
|
if logger:
|
|
75
|
-
logger.error(f'{item} is not a check in {self.name
|
|
84
|
+
logger.error(f'{item} is not a check in {self.name}.')
|
|
76
85
|
error = True
|
|
77
86
|
continue
|
|
78
87
|
|
|
@@ -210,11 +219,25 @@ class ChecklistSchema(NamedSchema):
|
|
|
210
219
|
|
|
211
220
|
return not error
|
|
212
221
|
|
|
222
|
+
@classmethod
|
|
223
|
+
def _getdict_type(cls) -> str:
|
|
224
|
+
"""
|
|
225
|
+
Returns the meta data for getdict
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
return ChecklistSchema.__name__
|
|
229
|
+
|
|
213
230
|
|
|
214
231
|
############################################
|
|
215
232
|
# Design Checklist
|
|
216
233
|
############################################
|
|
217
234
|
def schema_checklist(schema):
|
|
235
|
+
"""
|
|
236
|
+
Adds checklist schema parameters to the given schema.
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
schema (EditableSchema): The schema to modify.
|
|
240
|
+
"""
|
|
218
241
|
schema = EditableSchema(schema)
|
|
219
242
|
|
|
220
243
|
item = 'default'
|