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