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.
Files changed (121) hide show
  1. siliconcompiler/__init__.py +12 -5
  2. siliconcompiler/__main__.py +1 -7
  3. siliconcompiler/_metadata.py +1 -1
  4. siliconcompiler/apps/_common.py +104 -23
  5. siliconcompiler/apps/sc.py +4 -8
  6. siliconcompiler/apps/sc_dashboard.py +6 -4
  7. siliconcompiler/apps/sc_install.py +10 -6
  8. siliconcompiler/apps/sc_issue.py +7 -5
  9. siliconcompiler/apps/sc_remote.py +1 -1
  10. siliconcompiler/apps/sc_server.py +9 -14
  11. siliconcompiler/apps/sc_show.py +6 -5
  12. siliconcompiler/apps/smake.py +130 -94
  13. siliconcompiler/apps/utils/replay.py +4 -7
  14. siliconcompiler/apps/utils/summarize.py +3 -5
  15. siliconcompiler/asic.py +420 -0
  16. siliconcompiler/checklist.py +25 -2
  17. siliconcompiler/cmdlineschema.py +534 -0
  18. siliconcompiler/constraints/asic_component.py +2 -2
  19. siliconcompiler/constraints/asic_pins.py +2 -2
  20. siliconcompiler/constraints/asic_timing.py +3 -3
  21. siliconcompiler/core.py +7 -32
  22. siliconcompiler/data/templates/tcl/manifest.tcl.j2 +8 -0
  23. siliconcompiler/dependencyschema.py +89 -31
  24. siliconcompiler/design.py +176 -207
  25. siliconcompiler/filesetschema.py +250 -0
  26. siliconcompiler/flowgraph.py +274 -95
  27. siliconcompiler/fpga.py +124 -1
  28. siliconcompiler/library.py +218 -20
  29. siliconcompiler/metric.py +233 -20
  30. siliconcompiler/package/__init__.py +271 -50
  31. siliconcompiler/package/git.py +92 -16
  32. siliconcompiler/package/github.py +108 -12
  33. siliconcompiler/package/https.py +79 -16
  34. siliconcompiler/packageschema.py +88 -7
  35. siliconcompiler/pathschema.py +31 -2
  36. siliconcompiler/pdk.py +566 -1
  37. siliconcompiler/project.py +1095 -94
  38. siliconcompiler/record.py +38 -1
  39. siliconcompiler/remote/__init__.py +5 -2
  40. siliconcompiler/remote/client.py +11 -6
  41. siliconcompiler/remote/schema.py +5 -23
  42. siliconcompiler/remote/server.py +41 -54
  43. siliconcompiler/report/__init__.py +3 -3
  44. siliconcompiler/report/dashboard/__init__.py +48 -14
  45. siliconcompiler/report/dashboard/cli/__init__.py +99 -21
  46. siliconcompiler/report/dashboard/cli/board.py +364 -179
  47. siliconcompiler/report/dashboard/web/__init__.py +90 -12
  48. siliconcompiler/report/dashboard/web/components/__init__.py +219 -240
  49. siliconcompiler/report/dashboard/web/components/flowgraph.py +49 -26
  50. siliconcompiler/report/dashboard/web/components/graph.py +139 -100
  51. siliconcompiler/report/dashboard/web/layouts/__init__.py +29 -1
  52. siliconcompiler/report/dashboard/web/layouts/_common.py +38 -2
  53. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph.py +39 -26
  54. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_node_tab.py +50 -50
  55. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_sac_tabs.py +49 -46
  56. siliconcompiler/report/dashboard/web/state.py +141 -14
  57. siliconcompiler/report/dashboard/web/utils/__init__.py +79 -16
  58. siliconcompiler/report/dashboard/web/utils/file_utils.py +74 -11
  59. siliconcompiler/report/dashboard/web/viewer.py +25 -1
  60. siliconcompiler/report/report.py +5 -2
  61. siliconcompiler/report/summary_image.py +29 -11
  62. siliconcompiler/scheduler/__init__.py +9 -1
  63. siliconcompiler/scheduler/docker.py +79 -1
  64. siliconcompiler/scheduler/run_node.py +35 -19
  65. siliconcompiler/scheduler/scheduler.py +208 -24
  66. siliconcompiler/scheduler/schedulernode.py +372 -46
  67. siliconcompiler/scheduler/send_messages.py +77 -29
  68. siliconcompiler/scheduler/slurm.py +76 -12
  69. siliconcompiler/scheduler/taskscheduler.py +140 -20
  70. siliconcompiler/schema/__init__.py +0 -2
  71. siliconcompiler/schema/baseschema.py +194 -38
  72. siliconcompiler/schema/journal.py +7 -4
  73. siliconcompiler/schema/namedschema.py +16 -10
  74. siliconcompiler/schema/parameter.py +55 -9
  75. siliconcompiler/schema/parametervalue.py +60 -0
  76. siliconcompiler/schema/safeschema.py +25 -2
  77. siliconcompiler/schema/schema_cfg.py +5 -5
  78. siliconcompiler/schema/utils.py +2 -2
  79. siliconcompiler/schema_obj.py +20 -3
  80. siliconcompiler/tool.py +979 -302
  81. siliconcompiler/tools/bambu/__init__.py +41 -0
  82. siliconcompiler/tools/builtin/concatenate.py +2 -2
  83. siliconcompiler/tools/builtin/minimum.py +2 -1
  84. siliconcompiler/tools/builtin/mux.py +2 -1
  85. siliconcompiler/tools/builtin/nop.py +2 -1
  86. siliconcompiler/tools/builtin/verify.py +2 -1
  87. siliconcompiler/tools/klayout/__init__.py +95 -0
  88. siliconcompiler/tools/openroad/__init__.py +289 -0
  89. siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -0
  90. siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +7 -2
  91. siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +8 -4
  92. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +9 -5
  93. siliconcompiler/tools/openroad/scripts/common/write_images.tcl +5 -1
  94. siliconcompiler/tools/slang/__init__.py +1 -1
  95. siliconcompiler/tools/slang/elaborate.py +2 -1
  96. siliconcompiler/tools/vivado/scripts/sc_run.tcl +1 -1
  97. siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +8 -1
  98. siliconcompiler/tools/vivado/syn_fpga.py +6 -0
  99. siliconcompiler/tools/vivado/vivado.py +35 -2
  100. siliconcompiler/tools/vpr/__init__.py +150 -0
  101. siliconcompiler/tools/yosys/__init__.py +369 -1
  102. siliconcompiler/tools/yosys/scripts/procs.tcl +0 -1
  103. siliconcompiler/toolscripts/_tools.json +5 -10
  104. siliconcompiler/utils/__init__.py +66 -0
  105. siliconcompiler/utils/flowgraph.py +2 -2
  106. siliconcompiler/utils/issue.py +2 -1
  107. siliconcompiler/utils/logging.py +14 -0
  108. siliconcompiler/utils/multiprocessing.py +256 -0
  109. siliconcompiler/utils/showtools.py +10 -0
  110. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/METADATA +5 -5
  111. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/RECORD +115 -118
  112. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/entry_points.txt +3 -0
  113. siliconcompiler/schema/cmdlineschema.py +0 -250
  114. siliconcompiler/toolscripts/rhel8/install-slang.sh +0 -40
  115. siliconcompiler/toolscripts/rhel9/install-slang.sh +0 -40
  116. siliconcompiler/toolscripts/ubuntu20/install-slang.sh +0 -47
  117. siliconcompiler/toolscripts/ubuntu22/install-slang.sh +0 -37
  118. siliconcompiler/toolscripts/ubuntu24/install-slang.sh +0 -37
  119. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/WHEEL +0 -0
  120. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/licenses/LICENSE +0 -0
  121. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/top_level.txt +0 -0
@@ -12,9 +12,10 @@ class DependencySchema(BaseSchema):
12
12
  '''
13
13
 
14
14
  def __init__(self):
15
+ '''Initializes the DependencySchema.'''
15
16
  super().__init__()
16
17
 
17
- self.__deps = {}
18
+ self._reset_deps()
18
19
 
19
20
  schema = EditableSchema(self)
20
21
  schema.insert(
@@ -27,6 +28,20 @@ class DependencySchema(BaseSchema):
27
28
  help="List of named object dependencies included via add_dep()."))
28
29
 
29
30
  def _from_dict(self, manifest, keypath, version=None):
31
+ '''
32
+ Internal helper to load schema from a dictionary manifest.
33
+
34
+ This method temporarily unlocks the 'deps' parameter to allow it to be
35
+ populated from the manifest data.
36
+
37
+ Args:
38
+ manifest (dict): The dictionary to load data from.
39
+ keypath (list): The list of keys representing the path to the data.
40
+ version (str, optional): The schema version. Defaults to None.
41
+
42
+ Returns:
43
+ The result of the parent class's _from_dict method.
44
+ '''
30
45
  self.set("deps", False, field="lock")
31
46
  ret = super()._from_dict(manifest, keypath, version)
32
47
  self.set("deps", True, field="lock")
@@ -37,9 +52,9 @@ class DependencySchema(BaseSchema):
37
52
  Adds a module to this object.
38
53
 
39
54
  Args:
40
- obj (:class:`NamedSchema`): Module to add
55
+ obj (:class:`NamedSchema`): Module to add.
41
56
  clobber (bool): If true will insert the object and overwrite any
42
- existing with the same name
57
+ existing with the same name.
43
58
 
44
59
  Returns:
45
60
  True if object was imported, otherwise false.
@@ -48,19 +63,18 @@ class DependencySchema(BaseSchema):
48
63
  if not isinstance(obj, NamedSchema):
49
64
  raise TypeError(f"Cannot add an object of type: {type(obj)}")
50
65
 
51
- if not clobber and obj.name() in self.__deps:
66
+ if not clobber and obj.name in self.__deps:
52
67
  return False
53
68
 
54
- if obj.name() is None:
69
+ if obj.name is None:
55
70
  raise ValueError("Cannot add an unnamed dependency")
56
71
 
57
- if obj.name() not in self.__deps:
72
+ if not self.has_dep(obj):
58
73
  self.set("deps", False, field="lock")
59
- self.add("deps", obj.name())
74
+ self.add("deps", obj.name)
60
75
  self.set("deps", True, field="lock")
61
76
 
62
- self.__deps[obj.name()] = obj
63
- obj._reset()
77
+ self.__deps[obj.name] = obj
64
78
 
65
79
  return True
66
80
 
@@ -73,12 +87,12 @@ class DependencySchema(BaseSchema):
73
87
  Renders and saves the dependency graph to a file.
74
88
 
75
89
  Args:
76
- filename (filepath): Output filepath
77
- fontcolor (str): Node font RGB color hex value
78
- background (str): Background color
79
- fontsize (str): Node text font size
80
- border (bool): Enables node border if True
81
- landscape (bool): Renders graph in landscape layout if True
90
+ filename (filepath): Output filepath.
91
+ fontcolor (str): Node font RGB color hex value.
92
+ background (str): Background color.
93
+ fontsize (str): Node text font size.
94
+ border (bool): Enables node border if True.
95
+ landscape (bool): Renders graph in landscape layout if True.
82
96
 
83
97
  Examples:
84
98
  >>> schema.write_depgraph('mydump.png')
@@ -107,11 +121,11 @@ class DependencySchema(BaseSchema):
107
121
  dot.attr(bgcolor=background)
108
122
 
109
123
  def make_label(dep):
110
- return f"lib-{dep.name()}"
124
+ return f"lib-{dep.name}"
111
125
 
112
126
  nodes = {
113
- self.name(): {
114
- "text": self.name(),
127
+ self.name: {
128
+ "text": self.name,
115
129
  "shape": "box",
116
130
  "color": background,
117
131
  "connects_to": set([make_label(subdep) for subdep in self.__deps.values()])
@@ -119,7 +133,7 @@ class DependencySchema(BaseSchema):
119
133
  }
120
134
  for dep in self.get_dep():
121
135
  nodes[make_label(dep)] = {
122
- "text": dep.name(),
136
+ "text": dep.name,
123
137
  "shape": "oval",
124
138
  "color": background,
125
139
  "connects_to": set([make_label(subdep) for subdep in dep.__deps.values()])
@@ -140,16 +154,25 @@ class DependencySchema(BaseSchema):
140
154
 
141
155
  def __get_all_deps(self, seen: set) -> list:
142
156
  '''
143
- Loop through the dependency tree and generate a flat list
157
+ Recursively traverses the dependency tree to generate a flat list.
158
+
159
+ This method avoids cycles and duplicate entries by keeping track of
160
+ visited nodes in the 'seen' set.
161
+
162
+ Args:
163
+ seen (set): A set of dependency names that have already been visited.
164
+
165
+ Returns:
166
+ list: A flat list of all dependency objects.
144
167
  '''
145
168
  deps = []
146
169
 
147
170
  for obj in self.__deps.values():
148
- if obj.name() in seen:
171
+ if obj.name in seen:
149
172
  continue
150
173
 
151
174
  deps.append(obj)
152
- seen.add(obj.name())
175
+ seen.add(obj.name)
153
176
 
154
177
  if not isinstance(obj, DependencySchema):
155
178
  # nothing to iterate over
@@ -157,7 +180,7 @@ class DependencySchema(BaseSchema):
157
180
 
158
181
  for obj_dep in obj.__get_all_deps(seen):
159
182
  deps.append(obj_dep)
160
- seen.add(obj_dep.name())
183
+ seen.add(obj_dep.name)
161
184
 
162
185
  return deps
163
186
 
@@ -166,16 +189,19 @@ class DependencySchema(BaseSchema):
166
189
  Returns all dependencies associated with this object or a specific one if requested.
167
190
 
168
191
  Raises:
169
- KeyError: if the module specific module is requested but not found
192
+ KeyError: if the specific module is requested but not found.
170
193
 
171
194
  Args:
172
- name (str): name of the module
173
- hierarchy (bool): if True, will return all modules including children
174
- otherwise only this objects modules are returned.
195
+ name (str): Name of the module.
196
+ hierarchy (bool): If True, will return all modules including children,
197
+ otherwise only this object's modules are returned.
198
+
199
+ Returns:
200
+ list: A list of dependency objects.
175
201
  '''
176
202
 
177
203
  if name:
178
- if name not in self.__deps:
204
+ if not self.has_dep(name):
179
205
  if "." in name:
180
206
  name0, *name1 = name.split(".")
181
207
  subdep = self.get_dep(name0)
@@ -190,19 +216,38 @@ class DependencySchema(BaseSchema):
190
216
  return self.__get_all_deps(set())
191
217
  return list(self.__deps.values())
192
218
 
219
+ def has_dep(self, name: str) -> bool:
220
+ '''
221
+ Checks if a specific dependency is present.
222
+
223
+ Args:
224
+ name (str): Name of the module.
225
+
226
+ Returns:
227
+ True if the module was found, False otherwise.
228
+ '''
229
+
230
+ if isinstance(name, NamedSchema):
231
+ name = name.name
232
+
233
+ return name in self.__deps
234
+
193
235
  def remove_dep(self, name: str) -> bool:
194
236
  '''
195
237
  Removes a previously registered module.
196
238
 
197
239
  Args:
198
- name (str): name of the module
240
+ name (str): Name of the module.
199
241
 
200
242
  Returns:
201
- True if the module was removed, False is not found.
243
+ True if the module was removed, False if it was not found.
202
244
  '''
203
- if name not in self.__deps:
245
+ if not self.has_dep(name):
204
246
  return False
205
247
 
248
+ if isinstance(name, NamedSchema):
249
+ name = name.name
250
+
206
251
  del self.__deps[name]
207
252
 
208
253
  # Remove from dependency list
@@ -216,6 +261,15 @@ class DependencySchema(BaseSchema):
216
261
  return True
217
262
 
218
263
  def _populate_deps(self, module_map: dict):
264
+ '''
265
+ Internal method to populate the internal dependency dictionary.
266
+
267
+ This is used to reconstruct object references from a serialized format
268
+ by looking up dependency names in the provided map.
269
+
270
+ Args:
271
+ module_map (dict): A dictionary mapping module names to module objects.
272
+ '''
219
273
  if self.__deps:
220
274
  return
221
275
 
@@ -226,3 +280,7 @@ class DependencySchema(BaseSchema):
226
280
 
227
281
  if isinstance(self.__deps[module], DependencySchema):
228
282
  self.__deps[module]._populate_deps(module_map)
283
+
284
+ def _reset_deps(self):
285
+ '''Resets the internal dependency dictionary.'''
286
+ self.__deps = {}