siliconcompiler 0.35.0__py3-none-any.whl → 0.35.1__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/_metadata.py +1 -1
- siliconcompiler/apps/_common.py +3 -2
- siliconcompiler/apps/sc_dashboard.py +3 -1
- siliconcompiler/apps/sc_install.py +149 -37
- siliconcompiler/apps/smake.py +9 -3
- siliconcompiler/checklist.py +3 -3
- siliconcompiler/data/demo_fpga/z1000_yosys_config.json +24 -0
- siliconcompiler/design.py +51 -45
- siliconcompiler/flowgraph.py +2 -2
- siliconcompiler/library.py +23 -12
- siliconcompiler/package/__init__.py +77 -49
- siliconcompiler/package/git.py +11 -6
- siliconcompiler/package/github.py +11 -6
- siliconcompiler/package/https.py +6 -4
- siliconcompiler/pdk.py +23 -16
- siliconcompiler/scheduler/scheduler.py +30 -22
- siliconcompiler/scheduler/schedulernode.py +60 -50
- siliconcompiler/scheduler/taskscheduler.py +52 -32
- siliconcompiler/schema/baseschema.py +88 -69
- siliconcompiler/schema/docs/schemagen.py +4 -3
- siliconcompiler/schema/editableschema.py +5 -5
- siliconcompiler/schema/journal.py +19 -13
- siliconcompiler/schema/namedschema.py +16 -10
- siliconcompiler/schema/parameter.py +64 -37
- siliconcompiler/schema/parametervalue.py +126 -80
- siliconcompiler/schema/safeschema.py +16 -7
- siliconcompiler/schema/utils.py +3 -1
- siliconcompiler/schema_support/cmdlineschema.py +9 -9
- siliconcompiler/schema_support/dependencyschema.py +12 -7
- siliconcompiler/schema_support/filesetschema.py +15 -10
- siliconcompiler/schema_support/metric.py +29 -17
- siliconcompiler/schema_support/packageschema.py +2 -2
- siliconcompiler/schema_support/pathschema.py +30 -18
- siliconcompiler/schema_support/record.py +30 -23
- siliconcompiler/tool.py +265 -210
- siliconcompiler/tools/opensta/timing.py +13 -0
- siliconcompiler/tools/yosys/syn_fpga.py +3 -2
- siliconcompiler/toolscripts/_tools.json +3 -3
- siliconcompiler/utils/__init__.py +23 -16
- siliconcompiler/utils/curation.py +11 -5
- siliconcompiler/utils/multiprocessing.py +16 -14
- siliconcompiler/utils/paths.py +24 -12
- siliconcompiler/utils/units.py +16 -12
- {siliconcompiler-0.35.0.dist-info → siliconcompiler-0.35.1.dist-info}/METADATA +3 -4
- {siliconcompiler-0.35.0.dist-info → siliconcompiler-0.35.1.dist-info}/RECORD +49 -48
- {siliconcompiler-0.35.0.dist-info → siliconcompiler-0.35.1.dist-info}/entry_points.txt +4 -3
- {siliconcompiler-0.35.0.dist-info → siliconcompiler-0.35.1.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.35.0.dist-info → siliconcompiler-0.35.1.dist-info}/licenses/LICENSE +0 -0
- {siliconcompiler-0.35.0.dist-info → siliconcompiler-0.35.1.dist-info}/top_level.txt +0 -0
|
@@ -7,6 +7,8 @@ import psutil
|
|
|
7
7
|
import shlex
|
|
8
8
|
import socket
|
|
9
9
|
|
|
10
|
+
from typing import Dict, Union, List, Optional, Set, Tuple
|
|
11
|
+
|
|
10
12
|
from datetime import datetime, timezone
|
|
11
13
|
from enum import Enum
|
|
12
14
|
|
|
@@ -49,7 +51,10 @@ class RecordSchema(BaseSchema):
|
|
|
49
51
|
|
|
50
52
|
schema_record(self)
|
|
51
53
|
|
|
52
|
-
def _from_dict(self, manifest
|
|
54
|
+
def _from_dict(self, manifest: Dict,
|
|
55
|
+
keypath: Union[List[str], Tuple[str, ...]],
|
|
56
|
+
version: Optional[Tuple[int, ...]] = None) \
|
|
57
|
+
-> Tuple[Set[Tuple[str, ...]], Set[Tuple[str, ...]]]:
|
|
53
58
|
"""
|
|
54
59
|
Constructs a schema from a dictionary.
|
|
55
60
|
|
|
@@ -72,13 +77,13 @@ class RecordSchema(BaseSchema):
|
|
|
72
77
|
|
|
73
78
|
return ret
|
|
74
79
|
|
|
75
|
-
def clear(self, step, index, keep=None):
|
|
80
|
+
def clear(self, step: str, index: Union[str, int], keep: Optional[List[str]] = None) -> None:
|
|
76
81
|
'''
|
|
77
82
|
Clear all saved metrics for a given step and index.
|
|
78
83
|
|
|
79
84
|
Args:
|
|
80
85
|
step (str): Step name to clear.
|
|
81
|
-
index (str): Index name to clear.
|
|
86
|
+
index (str or int): Index name to clear.
|
|
82
87
|
keep (list of str): list of records to keep.
|
|
83
88
|
'''
|
|
84
89
|
|
|
@@ -88,14 +93,14 @@ class RecordSchema(BaseSchema):
|
|
|
88
93
|
for record in self.getkeys():
|
|
89
94
|
if record in keep:
|
|
90
95
|
continue
|
|
91
|
-
param = self.get(record, field=None)
|
|
96
|
+
param: Parameter = self.get(record, field=None)
|
|
92
97
|
|
|
93
98
|
if param.get(field='pernode').is_never():
|
|
94
99
|
param.unset()
|
|
95
100
|
else:
|
|
96
101
|
param.unset(step=step, index=index)
|
|
97
102
|
|
|
98
|
-
def record_python_packages(self):
|
|
103
|
+
def record_python_packages(self) -> None:
|
|
99
104
|
'''
|
|
100
105
|
Record the python packages currently available in the environment.
|
|
101
106
|
'''
|
|
@@ -111,19 +116,19 @@ class RecordSchema(BaseSchema):
|
|
|
111
116
|
for pkg in freeze():
|
|
112
117
|
self.add('pythonpackage', pkg)
|
|
113
118
|
|
|
114
|
-
def record_version(self, step, index):
|
|
119
|
+
def record_version(self, step: str, index: Union[str, int]) -> None:
|
|
115
120
|
'''
|
|
116
121
|
Records the versions for SiliconCompiler and python.
|
|
117
122
|
|
|
118
123
|
Args:
|
|
119
124
|
step (str): Step name to associate.
|
|
120
|
-
index (str): Index name to associate.
|
|
125
|
+
index (str or int): Index name to associate.
|
|
121
126
|
'''
|
|
122
127
|
self.set('scversion', _metadata.version, step=step, index=index)
|
|
123
128
|
self.set('pythonversion', platform.python_version(), step=step, index=index)
|
|
124
129
|
|
|
125
130
|
@staticmethod
|
|
126
|
-
def get_cloud_information():
|
|
131
|
+
def get_cloud_information() -> Dict[str, Optional[str]]:
|
|
127
132
|
'''
|
|
128
133
|
Return information about the cloud environment.
|
|
129
134
|
|
|
@@ -137,7 +142,7 @@ class RecordSchema(BaseSchema):
|
|
|
137
142
|
return {"region": "local"}
|
|
138
143
|
|
|
139
144
|
@staticmethod
|
|
140
|
-
def get_ip_information():
|
|
145
|
+
def get_ip_information() -> Dict[str, Optional[str]]:
|
|
141
146
|
'''
|
|
142
147
|
Return information about the ip and mac address of this machine.
|
|
143
148
|
|
|
@@ -186,7 +191,7 @@ class RecordSchema(BaseSchema):
|
|
|
186
191
|
return {"ip": None, "mac": None}
|
|
187
192
|
|
|
188
193
|
@staticmethod
|
|
189
|
-
def get_machine_information():
|
|
194
|
+
def get_machine_information() -> Dict[str, Optional[str]]:
|
|
190
195
|
'''
|
|
191
196
|
Return information about the machine.
|
|
192
197
|
|
|
@@ -234,7 +239,7 @@ class RecordSchema(BaseSchema):
|
|
|
234
239
|
'arch': platform.machine()}
|
|
235
240
|
|
|
236
241
|
@staticmethod
|
|
237
|
-
def get_user_information():
|
|
242
|
+
def get_user_information() -> Dict[str, Optional[str]]:
|
|
238
243
|
'''
|
|
239
244
|
Return information about the user.
|
|
240
245
|
|
|
@@ -242,7 +247,7 @@ class RecordSchema(BaseSchema):
|
|
|
242
247
|
'''
|
|
243
248
|
return {'username': getpass.getuser()}
|
|
244
249
|
|
|
245
|
-
def record_userinformation(self, step, index):
|
|
250
|
+
def record_userinformation(self, step: str, index: Union[str, int]) -> None:
|
|
246
251
|
'''
|
|
247
252
|
Records information about the current machine and user.
|
|
248
253
|
Uses information from :meth:`get_machine_information`, :meth:`get_user_information`,
|
|
@@ -250,7 +255,7 @@ class RecordSchema(BaseSchema):
|
|
|
250
255
|
|
|
251
256
|
Args:
|
|
252
257
|
step (str): Step name to associate.
|
|
253
|
-
index (str): Index name to associate.
|
|
258
|
+
index (str or int): Index name to associate.
|
|
254
259
|
'''
|
|
255
260
|
machine_info = RecordSchema.get_machine_information()
|
|
256
261
|
user_info = RecordSchema.get_user_information()
|
|
@@ -273,7 +278,7 @@ class RecordSchema(BaseSchema):
|
|
|
273
278
|
if ip_information['mac']:
|
|
274
279
|
self.set('macaddr', ip_information['mac'], step=step, index=index)
|
|
275
280
|
|
|
276
|
-
def record_time(self, step, index, type):
|
|
281
|
+
def record_time(self, step: str, index: Union[str, int], type: RecordTime) -> float:
|
|
277
282
|
'''
|
|
278
283
|
Record the time of the record.
|
|
279
284
|
|
|
@@ -282,7 +287,7 @@ class RecordSchema(BaseSchema):
|
|
|
282
287
|
|
|
283
288
|
Args:
|
|
284
289
|
step (str): Step name to associate.
|
|
285
|
-
index (str): Index name to associate.
|
|
290
|
+
index (str or int): Index name to associate.
|
|
286
291
|
type (:class:`RecordTime`): type of time to record
|
|
287
292
|
'''
|
|
288
293
|
type = RecordTime(type)
|
|
@@ -295,17 +300,18 @@ class RecordSchema(BaseSchema):
|
|
|
295
300
|
|
|
296
301
|
return now.timestamp()
|
|
297
302
|
|
|
298
|
-
def get_recorded_time(self, step, index,
|
|
303
|
+
def get_recorded_time(self, step: str, index: Union[str, int],
|
|
304
|
+
type: RecordTime) -> Optional[float]:
|
|
299
305
|
'''
|
|
300
306
|
Returns the time recorded for a given record, or None if nothing is recorded.
|
|
301
307
|
|
|
302
308
|
Args:
|
|
303
309
|
step (str): Step name to associate.
|
|
304
|
-
index (str): Index name to associate.
|
|
310
|
+
index (str or int): Index name to associate.
|
|
305
311
|
type (:class:`RecordTime`): type of time to record
|
|
306
312
|
'''
|
|
307
313
|
type = RecordTime(type)
|
|
308
|
-
record_time = self.get(type.value, step=step, index=index)
|
|
314
|
+
record_time: Optional[str] = self.get(type.value, step=step, index=index)
|
|
309
315
|
if record_time is None:
|
|
310
316
|
return None
|
|
311
317
|
|
|
@@ -313,7 +319,7 @@ class RecordSchema(BaseSchema):
|
|
|
313
319
|
record_time+"+0000",
|
|
314
320
|
RecordSchema.__TIMEFORMAT+"%z").timestamp()
|
|
315
321
|
|
|
316
|
-
def get_earliest_time(self, type):
|
|
322
|
+
def get_earliest_time(self, type: RecordTime) -> Optional[float]:
|
|
317
323
|
'''
|
|
318
324
|
Returns the earliest recorded time.
|
|
319
325
|
|
|
@@ -332,7 +338,7 @@ class RecordSchema(BaseSchema):
|
|
|
332
338
|
|
|
333
339
|
return min(times)
|
|
334
340
|
|
|
335
|
-
def get_latest_time(self, type):
|
|
341
|
+
def get_latest_time(self, type: RecordTime) -> Optional[float]:
|
|
336
342
|
'''
|
|
337
343
|
Returns the last recorded time.
|
|
338
344
|
|
|
@@ -340,7 +346,7 @@ class RecordSchema(BaseSchema):
|
|
|
340
346
|
type (:class:`RecordTime`): type of time to record
|
|
341
347
|
'''
|
|
342
348
|
type = RecordTime(type)
|
|
343
|
-
record_param = self.get(type.value, field=None)
|
|
349
|
+
record_param: Parameter = self.get(type.value, field=None)
|
|
344
350
|
|
|
345
351
|
times = set()
|
|
346
352
|
for _, step, index in record_param.getvalues():
|
|
@@ -351,13 +357,14 @@ class RecordSchema(BaseSchema):
|
|
|
351
357
|
|
|
352
358
|
return max(times)
|
|
353
359
|
|
|
354
|
-
def record_tool(self, step, index,
|
|
360
|
+
def record_tool(self, step: str, index: Union[str, int],
|
|
361
|
+
info: Union[str, List[str], int], type: RecordTool) -> None:
|
|
355
362
|
'''
|
|
356
363
|
Record information about the tool used during this record.
|
|
357
364
|
|
|
358
365
|
Args:
|
|
359
366
|
step (str): Step name to associate.
|
|
360
|
-
index (str): Index name to associate.
|
|
367
|
+
index (str or int): Index name to associate.
|
|
361
368
|
info (any): Information to record.
|
|
362
369
|
type (:class:`RecordTool`): type of tool information being recorded
|
|
363
370
|
'''
|