siliconcompiler 0.33.1__py3-none-any.whl → 0.34.0__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 (59) hide show
  1. siliconcompiler/__init__.py +2 -0
  2. siliconcompiler/_metadata.py +1 -1
  3. siliconcompiler/apps/sc_issue.py +5 -3
  4. siliconcompiler/apps/sc_remote.py +0 -17
  5. siliconcompiler/apps/utils/replay.py +5 -5
  6. siliconcompiler/checklist.py +1 -1
  7. siliconcompiler/core.py +39 -48
  8. siliconcompiler/data/templates/replay/replay.sh.j2 +18 -1
  9. siliconcompiler/dependencyschema.py +392 -0
  10. siliconcompiler/design.py +664 -0
  11. siliconcompiler/flowgraph.py +32 -1
  12. siliconcompiler/metric.py +19 -0
  13. siliconcompiler/package/__init__.py +383 -223
  14. siliconcompiler/package/git.py +75 -77
  15. siliconcompiler/package/github.py +70 -97
  16. siliconcompiler/package/https.py +77 -93
  17. siliconcompiler/packageschema.py +260 -0
  18. siliconcompiler/pdk.py +2 -2
  19. siliconcompiler/record.py +57 -5
  20. siliconcompiler/remote/client.py +61 -13
  21. siliconcompiler/remote/server.py +109 -64
  22. siliconcompiler/report/dashboard/cli/board.py +1 -2
  23. siliconcompiler/scheduler/__init__.py +3 -1375
  24. siliconcompiler/scheduler/docker.py +268 -0
  25. siliconcompiler/scheduler/run_node.py +20 -19
  26. siliconcompiler/scheduler/scheduler.py +308 -0
  27. siliconcompiler/scheduler/schedulernode.py +934 -0
  28. siliconcompiler/scheduler/slurm.py +147 -163
  29. siliconcompiler/scheduler/taskscheduler.py +39 -52
  30. siliconcompiler/schema/__init__.py +3 -3
  31. siliconcompiler/schema/baseschema.py +256 -11
  32. siliconcompiler/schema/editableschema.py +4 -0
  33. siliconcompiler/schema/journal.py +210 -0
  34. siliconcompiler/schema/namedschema.py +31 -2
  35. siliconcompiler/schema/parameter.py +14 -1
  36. siliconcompiler/schema/parametervalue.py +1 -34
  37. siliconcompiler/schema/schema_cfg.py +211 -350
  38. siliconcompiler/tool.py +139 -37
  39. siliconcompiler/tools/_common/__init__.py +14 -11
  40. siliconcompiler/tools/builtin/concatenate.py +2 -2
  41. siliconcompiler/tools/builtin/verify.py +1 -2
  42. siliconcompiler/tools/openroad/scripts/common/procs.tcl +27 -25
  43. siliconcompiler/tools/slang/__init__.py +3 -2
  44. siliconcompiler/tools/vpr/route.py +69 -0
  45. siliconcompiler/tools/yosys/sc_synth_asic.tcl +0 -4
  46. siliconcompiler/toolscripts/_tools.json +13 -8
  47. siliconcompiler/toolscripts/ubuntu22/install-klayout.sh +4 -0
  48. siliconcompiler/toolscripts/ubuntu24/install-klayout.sh +4 -0
  49. siliconcompiler/utils/__init__.py +2 -23
  50. siliconcompiler/utils/flowgraph.py +5 -5
  51. siliconcompiler/utils/logging.py +2 -1
  52. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.34.0.dist-info}/METADATA +8 -6
  53. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.34.0.dist-info}/RECORD +57 -52
  54. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.34.0.dist-info}/WHEEL +1 -1
  55. siliconcompiler/scheduler/docker_runner.py +0 -254
  56. siliconcompiler/schema/journalingschema.py +0 -238
  57. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.34.0.dist-info}/entry_points.txt +0 -0
  58. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.34.0.dist-info}/licenses/LICENSE +0 -0
  59. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.34.0.dist-info}/top_level.txt +0 -0
@@ -1,238 +0,0 @@
1
- import copy
2
- import types
3
-
4
- from .baseschema import BaseSchema
5
- from .baseschema import json
6
-
7
-
8
- class JournalingSchema(BaseSchema):
9
- """
10
- This class provides the ability to record the schema transactions:
11
- :meth:`set`, :meth:`add`, :meth:`remove`, and :meth:`unset`.
12
-
13
- Args:
14
- schema (:class:`BaseSchema`): schema to track
15
- keyprefix (list of str): keypath to prefix on to recorded path
16
- """
17
-
18
- def __init__(self, schema, keyprefix=None):
19
- if not isinstance(schema, BaseSchema):
20
- raise TypeError(f"schema must be of BaseSchema type, not: {type(schema)}")
21
- if isinstance(schema, JournalingSchema):
22
- raise TypeError("schema must be of cannot be a JournalingSchema")
23
-
24
- self.__schema = schema
25
-
26
- journal_attrs = dir(self)
27
-
28
- # Transfer access to internal schema
29
- for param, value in self.__schema.__dict__.items():
30
- setattr(self, param, value)
31
- for param in dir(type(self.__schema)):
32
- if param in journal_attrs:
33
- continue
34
- method = getattr(type(self.__schema), param)
35
- if callable(method):
36
- setattr(self, param, types.MethodType(method, self))
37
-
38
- if not keyprefix:
39
- self.__keyprefix = tuple()
40
- else:
41
- self.__keyprefix = tuple(keyprefix)
42
-
43
- self.__record_types = set()
44
- self.stop_journal()
45
-
46
- self.__parent = self
47
-
48
- def get(self, *keypath, field='value', step=None, index=None):
49
- get_ret = super().get(*keypath, field=field, step=step, index=index)
50
- self.__record_journal("get", keypath, field=field, step=step, index=index)
51
- if field == 'schema':
52
- child = JournalingSchema(get_ret, keyprefix=[*self.__keyprefix, *keypath])
53
- child.__parent = self.__parent
54
- return child
55
-
56
- return get_ret
57
-
58
- def set(self, *args, field='value', clobber=True, step=None, index=None):
59
- ret = super().set(*args, field=field, clobber=clobber, step=step, index=index)
60
- if ret:
61
- *keypath, value = args
62
- self.__record_journal("set", keypath, value=value, field=field, step=step, index=index)
63
- return ret
64
-
65
- def add(self, *args, field='value', step=None, index=None):
66
- ret = super().add(*args, field=field, step=step, index=index)
67
- if ret:
68
- *keypath, value = args
69
- self.__record_journal("add", keypath, value=value, field=field, step=step, index=index)
70
- return ret
71
-
72
- def remove(self, *keypath):
73
- self.__record_journal("remove", keypath)
74
- return super().remove(*keypath)
75
-
76
- def unset(self, *keypath, step=None, index=None):
77
- self.__record_journal("unset", keypath, step=step, index=index)
78
- return super().unset(*keypath, step=step, index=index)
79
-
80
- def _from_dict(self, manifest, keypath, version=None):
81
- if "__journal__" in manifest:
82
- self.__journal = manifest["__journal__"]
83
- del manifest["__journal__"]
84
-
85
- self.__schema._from_dict(manifest, keypath, version=version)
86
-
87
- def getdict(self, *keypath, include_default=True):
88
- manifest = super().getdict(*keypath, include_default=include_default)
89
-
90
- if self.__journal:
91
- manifest["__journal__"] = self.get_journal()
92
-
93
- return manifest
94
-
95
- def get_journal(self):
96
- """
97
- Returns a copy of the current journal
98
- """
99
-
100
- return copy.deepcopy(self.__journal)
101
-
102
- def is_journaling(self):
103
- """
104
- Returns true if the schema is currently setup for journaling
105
- """
106
- return self.__journal is not None
107
-
108
- def get_journaling_types(self):
109
- """
110
- Returns the current schema accesses that are being recorded
111
- """
112
-
113
- return self.__record_types.copy()
114
-
115
- def add_journaling_type(self, value):
116
- """
117
- Adds a new access type to the journal record.
118
-
119
- Args:
120
- value (str): access type
121
- """
122
-
123
- if value not in ("set", "add", "remove", "unset", "get"):
124
- raise ValueError(f"{value} is not a valid type")
125
-
126
- return self.__record_types.add(value)
127
-
128
- def remove_journaling_type(self, value):
129
- """
130
- Removes a new access type to the journal record.
131
-
132
- Args:
133
- value (str): access type
134
- """
135
-
136
- try:
137
- self.__record_types.remove(value)
138
- except KeyError:
139
- pass
140
-
141
- def get_base_schema(self):
142
- """
143
- Returns the base schema
144
- """
145
-
146
- return self.__schema
147
-
148
- def __record_journal(self, record_type, key, value=None, field=None, step=None, index=None):
149
- '''
150
- Record the schema transaction
151
- '''
152
-
153
- if self.__parent.__journal is None:
154
- return
155
-
156
- if record_type not in self.__parent.__record_types:
157
- return
158
-
159
- self.__parent.__journal.append({
160
- "type": record_type,
161
- "key": tuple([*self.__keyprefix, *key]),
162
- "value": value,
163
- "field": field,
164
- "step": step,
165
- "index": index
166
- })
167
-
168
- def start_journal(self):
169
- '''
170
- Start journaling the schema transactions
171
- '''
172
- self.__journal = []
173
- self.add_journaling_type("set")
174
- self.add_journaling_type("add")
175
- self.add_journaling_type("remove")
176
- self.add_journaling_type("unset")
177
-
178
- def stop_journal(self):
179
- '''
180
- Stop journaling the schema transactions
181
- '''
182
- self.__journal = None
183
- self.__record_types.clear()
184
-
185
- def read_journal(self, filename):
186
- '''
187
- Reads a manifest and replays the journal
188
- '''
189
-
190
- with open(filename) as f:
191
- data = json.loads(f.read())
192
-
193
- self.import_journal(cfg=data)
194
-
195
- def import_journal(self, schema=None, cfg=None):
196
- '''
197
- Import the journaled transactions from a different schema.
198
- Only one argument is supported at a time.
199
-
200
- Args:
201
- schema (:class:`JournalingSchema`): schema to replay transactions from
202
- cfg (dict): dictionary to replay transactions from
203
- '''
204
-
205
- if schema and cfg:
206
- raise ValueError("only one argument is supported")
207
-
208
- journal = []
209
- if schema:
210
- if isinstance(schema, JournalingSchema):
211
- journal = schema.__journal
212
- else:
213
- raise TypeError(f"schema must be a JournalingSchema, not {type(schema)}")
214
- elif cfg and "__journal__" in cfg:
215
- journal = cfg["__journal__"]
216
-
217
- if journal is None:
218
- return
219
-
220
- for action in journal:
221
- record_type = action['type']
222
- keypath = action['key']
223
- value = action['value']
224
- field = action['field']
225
- step = action['step']
226
- index = action['index']
227
- if record_type == 'set':
228
- self.set(*keypath, value, field=field, step=step, index=index)
229
- elif record_type == 'add':
230
- self.add(*keypath, value, field=field, step=step, index=index)
231
- elif record_type == 'unset':
232
- self.unset(*keypath, step=step, index=index)
233
- elif record_type == 'remove':
234
- self.remove(*keypath)
235
- elif record_type == 'get':
236
- continue
237
- else:
238
- raise ValueError(f'Unknown record type {record_type}')