siliconcompiler 0.33.1__py3-none-any.whl → 0.33.2__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 (28) hide show
  1. siliconcompiler/_metadata.py +1 -1
  2. siliconcompiler/apps/utils/replay.py +5 -5
  3. siliconcompiler/core.py +5 -1
  4. siliconcompiler/data/templates/replay/replay.sh.j2 +18 -1
  5. siliconcompiler/metric.py +19 -0
  6. siliconcompiler/package/git.py +1 -1
  7. siliconcompiler/record.py +57 -5
  8. siliconcompiler/remote/client.py +47 -11
  9. siliconcompiler/remote/server.py +109 -64
  10. siliconcompiler/report/dashboard/cli/board.py +0 -1
  11. siliconcompiler/scheduler/__init__.py +12 -5
  12. siliconcompiler/scheduler/run_node.py +12 -5
  13. siliconcompiler/schema/baseschema.py +25 -4
  14. siliconcompiler/schema/journalingschema.py +4 -0
  15. siliconcompiler/schema/schema_cfg.py +1 -1
  16. siliconcompiler/tool.py +79 -18
  17. siliconcompiler/tools/_common/__init__.py +14 -11
  18. siliconcompiler/tools/slang/__init__.py +3 -2
  19. siliconcompiler/tools/yosys/sc_synth_asic.tcl +0 -4
  20. siliconcompiler/toolscripts/_tools.json +12 -7
  21. siliconcompiler/toolscripts/ubuntu22/install-klayout.sh +4 -0
  22. siliconcompiler/toolscripts/ubuntu24/install-klayout.sh +4 -0
  23. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.33.2.dist-info}/METADATA +5 -4
  24. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.33.2.dist-info}/RECORD +28 -28
  25. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.33.2.dist-info}/WHEEL +1 -1
  26. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.33.2.dist-info}/entry_points.txt +0 -0
  27. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.33.2.dist-info}/licenses/LICENSE +0 -0
  28. {siliconcompiler-0.33.1.dist-info → siliconcompiler-0.33.2.dist-info}/top_level.txt +0 -0
@@ -4,6 +4,8 @@ import argparse
4
4
  import os
5
5
  import sys
6
6
  import tarfile
7
+ import os.path
8
+
7
9
  from siliconcompiler import Chip, Schema
8
10
  from siliconcompiler.package import path as sc_path
9
11
  from siliconcompiler.scheduler import _runtask, _executenode
@@ -38,7 +40,6 @@ def main():
38
40
  field='shorthelp'))
39
41
  parser.add_argument('-cachedir',
40
42
  metavar='<directory>',
41
- required=True,
42
43
  help=schema.get('option', 'cachedir',
43
44
  field='shorthelp'))
44
45
  parser.add_argument('-cachemap',
@@ -72,12 +73,15 @@ def main():
72
73
  parser.add_argument('-unset_scheduler',
73
74
  action='store_true',
74
75
  help='Unset scheduler to ensure local run')
76
+ parser.add_argument('-replay',
77
+ action='store_true',
78
+ help='Running as replay')
75
79
  args = parser.parse_args()
76
80
 
77
81
  # Change to working directory to allow rel path to be build dir
78
82
  # this avoids needing to deal with the job hash on the client
79
83
  # side
80
- os.chdir(args.cwd)
84
+ os.chdir(os.path.abspath(args.cwd))
81
85
 
82
86
  # Create the Chip object.
83
87
  chip = Chip('<design>')
@@ -86,8 +90,10 @@ def main():
86
90
  # setup work directory
87
91
  chip.set('arg', 'step', args.step)
88
92
  chip.set('arg', 'index', args.index)
89
- chip.set('option', 'builddir', args.builddir)
90
- chip.set('option', 'cachedir', args.cachedir)
93
+ chip.set('option', 'builddir', os.path.abspath(args.builddir))
94
+
95
+ if args.cachedir:
96
+ chip.set('option', 'cachedir', os.path.abspath(args.cachedir))
91
97
 
92
98
  if args.remoteid:
93
99
  chip.set('record', 'remoteid', args.remoteid)
@@ -118,7 +124,8 @@ def main():
118
124
  chip.get('option', 'flow'),
119
125
  chip.get('arg', 'step'),
120
126
  chip.get('arg', 'index'),
121
- _executenode)
127
+ _executenode,
128
+ replay=args.replay)
122
129
  error = False
123
130
 
124
131
  finally:
@@ -225,7 +225,13 @@ class BaseSchema:
225
225
  raise KeyError(f"[{','.join(keypath)}] is not a valid keypath")
226
226
  if field is None:
227
227
  return param
228
- return param.get(field, step=step, index=index)
228
+
229
+ try:
230
+ return param.get(field, step=step, index=index)
231
+ except Exception as e:
232
+ new_msg = f"error while accessing [{','.join(keypath)}]: {e.args[0]}"
233
+ e.args = (new_msg, *e.args[1:])
234
+ raise e
229
235
 
230
236
  def set(self, *args, field='value', clobber=True, step=None, index=None):
231
237
  '''
@@ -259,7 +265,12 @@ class BaseSchema:
259
265
  except KeyError:
260
266
  raise KeyError(f"[{','.join(keypath)}] is not a valid keypath")
261
267
 
262
- return param.set(value, field=field, clobber=clobber, step=step, index=index)
268
+ try:
269
+ return param.set(value, field=field, clobber=clobber, step=step, index=index)
270
+ except Exception as e:
271
+ new_msg = f"error while setting [{','.join(keypath)}]: {e.args[0]}"
272
+ e.args = (new_msg, *e.args[1:])
273
+ raise e
263
274
 
264
275
  def add(self, *args, field='value', step=None, index=None):
265
276
  '''
@@ -292,7 +303,12 @@ class BaseSchema:
292
303
  except KeyError:
293
304
  raise KeyError(f"[{','.join(keypath)}] is not a valid keypath")
294
305
 
295
- return param.add(value, field=field, step=step, index=index)
306
+ try:
307
+ return param.add(value, field=field, step=step, index=index)
308
+ except Exception as e:
309
+ new_msg = f"error while adding to [{','.join(keypath)}]: {e.args[0]}"
310
+ e.args = (new_msg, *e.args[1:])
311
+ raise e
296
312
 
297
313
  def unset(self, *keypath, step=None, index=None):
298
314
  '''
@@ -325,7 +341,12 @@ class BaseSchema:
325
341
  except KeyError:
326
342
  raise KeyError(f"[{','.join(keypath)}] is not a valid keypath")
327
343
 
328
- param.unset(step=step, index=index)
344
+ try:
345
+ param.unset(step=step, index=index)
346
+ except Exception as e:
347
+ new_msg = f"error while unsetting [{','.join(keypath)}]: {e.args[0]}"
348
+ e.args = (new_msg, *e.args[1:])
349
+ raise e
329
350
 
330
351
  def remove(self, *keypath):
331
352
  '''
@@ -45,6 +45,10 @@ class JournalingSchema(BaseSchema):
45
45
 
46
46
  self.__parent = self
47
47
 
48
+ @classmethod
49
+ def from_manifest(cls, filepath=None, cfg=None):
50
+ raise RuntimeError("Journal cannot be generated from manifest")
51
+
48
52
  def get(self, *keypath, field='value', step=None, index=None):
49
53
  get_ret = super().get(*keypath, field=field, step=step, index=index)
50
54
  self.__record_journal("get", keypath, field=field, step=step, index=index)
@@ -3,7 +3,7 @@
3
3
  from . import EditableSchema, Parameter, Scope, PerNode
4
4
  from .utils import trim
5
5
 
6
- SCHEMA_VERSION = '0.51.3'
6
+ SCHEMA_VERSION = '0.51.4'
7
7
 
8
8
 
9
9
  #############################################################################
siliconcompiler/tool.py CHANGED
@@ -144,6 +144,14 @@ class ToolSchema(NamedSchema):
144
144
 
145
145
  return self.__step, self.__index
146
146
 
147
+ def tool(self):
148
+ '''
149
+ Returns:
150
+ task name
151
+ '''
152
+
153
+ return self.__tool
154
+
147
155
  def task(self):
148
156
  '''
149
157
  Returns:
@@ -417,6 +425,10 @@ class ToolSchema(NamedSchema):
417
425
  replay_opts["exports"] = self.get_runtime_environmental_variables(include_path=include_path)
418
426
 
419
427
  replay_opts["executable"] = self.get('exe')
428
+ replay_opts["step"] = self.__step
429
+ replay_opts["index"] = self.__index
430
+ replay_opts["cfg_file"] = f"inputs/{self.__chip.design}.pkg.json"
431
+ replay_opts["node_only"] = 0 if replay_opts["executable"] else 1
420
432
 
421
433
  vswitch = self.get('vswitch')
422
434
  if vswitch:
@@ -428,23 +440,25 @@ class ToolSchema(NamedSchema):
428
440
  # detect file paths
429
441
  file_test = re.compile(r'^[/\.]')
430
442
 
431
- format_cmd = [replay_opts["executable"]]
443
+ if replay_opts["executable"]:
444
+ format_cmd = [replay_opts["executable"]]
432
445
 
433
- for cmdarg in self.get_runtime_arguments():
434
- add_new_line = len(format_cmd) == 1
446
+ for cmdarg in self.get_runtime_arguments():
447
+ add_new_line = len(format_cmd) == 1
435
448
 
436
- if arg_test.match(cmdarg) or file_test.match(cmdarg):
437
- add_new_line = True
438
- else:
439
- if not arg_test.match(format_cmd[-1]):
449
+ if arg_test.match(cmdarg) or file_test.match(cmdarg):
440
450
  add_new_line = True
451
+ else:
452
+ if not arg_test.match(format_cmd[-1]):
453
+ add_new_line = True
441
454
 
442
- cmdarg = shlex.quote(cmdarg)
443
- if add_new_line:
444
- format_cmd.append(cmdarg)
445
- else:
446
- format_cmd[-1] += f' {cmdarg}'
447
-
455
+ cmdarg = shlex.quote(cmdarg)
456
+ if add_new_line:
457
+ format_cmd.append(cmdarg)
458
+ else:
459
+ format_cmd[-1] += f' {cmdarg}'
460
+ else:
461
+ format_cmd = []
448
462
  replay_opts["cmds"] = format_cmd
449
463
 
450
464
  # create replay file
@@ -864,28 +878,60 @@ class ToolSchemaTmp(ToolSchema):
864
878
  _, task = self.__tool_task_modules()
865
879
  method = self.__module_func("setup", [task])
866
880
  if method:
867
- return method(self._ToolSchema__chip)
881
+ prev_step, prev_index = self._ToolSchema__chip.get('arg', 'step'), \
882
+ self._ToolSchema__chip.get('arg', 'index')
883
+ step, index = self.node()
884
+ self._ToolSchema__chip.set('arg', 'step', step)
885
+ self._ToolSchema__chip.set('arg', 'index', index)
886
+ ret = method(self._ToolSchema__chip)
887
+ self._ToolSchema__chip.set('arg', 'step', prev_step)
888
+ self._ToolSchema__chip.set('arg', 'index', prev_index)
889
+ return ret
868
890
  return ToolSchema.setup(self)
869
891
 
870
892
  def select_input_nodes(self):
871
893
  _, task = self.__tool_task_modules()
872
894
  method = self.__module_func("_select_inputs", [task])
873
895
  if method:
874
- return method(self._ToolSchema__chip, *self.node())
896
+ prev_step, prev_index = self._ToolSchema__chip.get('arg', 'step'), \
897
+ self._ToolSchema__chip.get('arg', 'index')
898
+ step, index = self.node()
899
+ self._ToolSchema__chip.set('arg', 'step', step)
900
+ self._ToolSchema__chip.set('arg', 'index', index)
901
+ ret = method(self._ToolSchema__chip, *self.node())
902
+ self._ToolSchema__chip.set('arg', 'step', prev_step)
903
+ self._ToolSchema__chip.set('arg', 'index', prev_index)
904
+ return ret
875
905
  return ToolSchema.select_input_nodes(self)
876
906
 
877
907
  def pre_process(self):
878
908
  _, task = self.__tool_task_modules()
879
909
  method = self.__module_func("pre_process", [task])
880
910
  if method:
881
- return method(self._ToolSchema__chip)
911
+ prev_step, prev_index = self._ToolSchema__chip.get('arg', 'step'), \
912
+ self._ToolSchema__chip.get('arg', 'index')
913
+ step, index = self.node()
914
+ self._ToolSchema__chip.set('arg', 'step', step)
915
+ self._ToolSchema__chip.set('arg', 'index', index)
916
+ ret = method(self._ToolSchema__chip)
917
+ self._ToolSchema__chip.set('arg', 'step', prev_step)
918
+ self._ToolSchema__chip.set('arg', 'index', prev_index)
919
+ return ret
882
920
  return ToolSchema.pre_process(self)
883
921
 
884
922
  def runtime_options(self):
885
923
  tool, task = self.__tool_task_modules()
886
924
  method = self.__module_func("runtime_options", [task, tool])
887
925
  if method:
888
- return method(self._ToolSchema__chip)
926
+ prev_step, prev_index = self._ToolSchema__chip.get('arg', 'step'), \
927
+ self._ToolSchema__chip.get('arg', 'index')
928
+ step, index = self.node()
929
+ self._ToolSchema__chip.set('arg', 'step', step)
930
+ self._ToolSchema__chip.set('arg', 'index', index)
931
+ ret = method(self._ToolSchema__chip)
932
+ self._ToolSchema__chip.set('arg', 'step', prev_step)
933
+ self._ToolSchema__chip.set('arg', 'index', prev_index)
934
+ return ret
889
935
  return ToolSchema.runtime_options(self)
890
936
 
891
937
  def run(self):
@@ -898,7 +944,14 @@ class ToolSchemaTmp(ToolSchema):
898
944
  if self._ToolSchema__chip.get('option', 'quiet', step=step, index=index):
899
945
  self._ToolSchema__chip.logger._console.setLevel(logging.CRITICAL)
900
946
 
947
+ prev_step, prev_index = self._ToolSchema__chip.get('arg', 'step'), \
948
+ self._ToolSchema__chip.get('arg', 'index')
949
+ step, index = self.node()
950
+ self._ToolSchema__chip.set('arg', 'step', step)
951
+ self._ToolSchema__chip.set('arg', 'index', index)
901
952
  retcode = method(self._ToolSchema__chip)
953
+ self._ToolSchema__chip.set('arg', 'step', prev_step)
954
+ self._ToolSchema__chip.set('arg', 'index', prev_index)
902
955
 
903
956
  self._ToolSchema__chip.logger._console.setLevel(stdout_handler_level)
904
957
 
@@ -909,7 +962,15 @@ class ToolSchemaTmp(ToolSchema):
909
962
  _, task = self.__tool_task_modules()
910
963
  method = self.__module_func("post_process", [task])
911
964
  if method:
912
- return method(self._ToolSchema__chip)
965
+ prev_step, prev_index = self._ToolSchema__chip.get('arg', 'step'), \
966
+ self._ToolSchema__chip.get('arg', 'index')
967
+ step, index = self.node()
968
+ self._ToolSchema__chip.set('arg', 'step', step)
969
+ self._ToolSchema__chip.set('arg', 'index', index)
970
+ ret = method(self._ToolSchema__chip)
971
+ self._ToolSchema__chip.set('arg', 'step', prev_step)
972
+ self._ToolSchema__chip.set('arg', 'index', prev_index)
973
+ return ret
913
974
  return ToolSchema.post_process(self)
914
975
 
915
976
 
@@ -377,17 +377,20 @@ def input_file_node_name(filename, step, index):
377
377
 
378
378
  file_type = get_file_ext(filename)
379
379
 
380
- base = filename
381
- total_ext = []
382
- ext = None
383
- while ext != file_type:
384
- base, ext = os.path.splitext(base)
385
- ext = ext[1:].lower()
386
- total_ext.append(ext)
387
-
388
- total_ext.reverse()
389
-
390
- return f'{base}.{step}{index}.{".".join(total_ext)}'
380
+ if file_type:
381
+ base = filename
382
+ ext = None
383
+ total_ext = []
384
+ while ext != file_type:
385
+ base, ext = os.path.splitext(base)
386
+ ext = ext[1:].lower()
387
+ total_ext.append(ext)
388
+
389
+ total_ext.reverse()
390
+
391
+ return f'{base}.{step}{index}.{".".join(total_ext)}'
392
+ else:
393
+ return f'{filename}.{step}{index}'
391
394
 
392
395
 
393
396
  def add_common_file(chip, key, file):
@@ -11,6 +11,7 @@ Sources: https://github.com/MikePopoloski/slang
11
11
  Installation: https://sv-lang.com/building.html
12
12
  '''
13
13
  import os
14
+ import shlex
14
15
 
15
16
  try:
16
17
  import pyslang
@@ -121,7 +122,6 @@ def common_runtime_options(chip):
121
122
  ###############################
122
123
  # Set up user-provided parameters to ensure we elaborate the correct modules
123
124
  for param, value in opts['param']:
124
- value = value.replace('"', '\\"')
125
125
  options.extend(['-G', f'{param}={value}'])
126
126
 
127
127
  return options
@@ -135,7 +135,8 @@ def _get_driver(chip, options_func, ignored_diagnotics=None):
135
135
 
136
136
  parse_options = pyslang.CommandLineOptions()
137
137
  parse_options.ignoreProgramName = True
138
- opts = " ".join(options)
138
+ opts = shlex.join(options)
139
+ chip.logger.info(f"runtime arguments: {opts}")
139
140
  code = 0
140
141
  if not driver.parseCommandLine(opts, parse_options):
141
142
  code = 1
@@ -120,10 +120,6 @@ if { [lindex [sc_cfg_tool_task_get var use_slang] 0] == "true" && [sc_load_plugi
120
120
  set slang_params []
121
121
  if { [sc_cfg_exists option param] } {
122
122
  dict for {key value} [sc_cfg_get option param] {
123
- if { ![string is integer $value] } {
124
- set value [concat \"$value\"]
125
- }
126
-
127
123
  lappend slang_params -G "${key}=${value}"
128
124
  }
129
125
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "openroad": {
3
3
  "git-url": "https://github.com/The-OpenROAD-Project/OpenROAD.git",
4
- "git-commit": "b0107893ea0693f3cf09bbf95450a38c1b26b950",
4
+ "git-commit": "cd121c095a6f77a501166e0961b2e93763c51b17",
5
5
  "docker-cmds": [
6
6
  "# Remove OR-Tools files",
7
7
  "RUN rm -f $SC_PREFIX/Makefile $SC_PREFIX/README.md",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "opensta": {
19
19
  "git-url": "https://github.com/parallaxsw/OpenSTA.git",
20
- "git-commit": "71bdfb99049f33a010bb23527c5c921c925378a0",
20
+ "git-commit": "0b59461bddb4ebc2228a20f17c9089be1f8c19da",
21
21
  "auto-update": true
22
22
  },
23
23
  "netgen": {
@@ -41,12 +41,17 @@
41
41
  "auto-update": false
42
42
  },
43
43
  "klayout": {
44
- "version": "0.30.1",
44
+ "version": "0.30.2",
45
45
  "git-url": "https://github.com/KLayout/klayout.git",
46
- "docker-skip": true,
47
46
  "auto-update": true,
48
47
  "run-version": "source version.sh && echo $KLAYOUT_VERSION",
49
- "release-notes": "https://www.klayout.de/development.html"
48
+ "release-notes": "https://www.klayout.de/development.html",
49
+ "docker-cmds": [
50
+ "RUN echo \"#!/bin/bash\" > $SC_PREFIX/install-klayout.sh",
51
+ "RUN echo \"sudo apt-get install -y $SC_PREFIX/klayout.deb\" >> $SC_PREFIX/install-klayout.sh",
52
+ "RUN echo \"sudo rm $SC_PREFIX/klayout.deb\" >> $SC_PREFIX/install-klayout.sh",
53
+ "RUN chmod +x $SC_PREFIX/install-klayout.sh"
54
+ ]
50
55
  },
51
56
  "sv2v": {
52
57
  "git-url": "https://github.com/zachjs/sv2v.git",
@@ -135,7 +140,7 @@
135
140
  "auto-update": false
136
141
  },
137
142
  "slang": {
138
- "git-commit": "v8.0",
143
+ "git-commit": "v8.1",
139
144
  "git-url": "https://github.com/MikePopoloski/slang.git",
140
145
  "auto-update": true
141
146
  },
@@ -146,7 +151,7 @@
146
151
  },
147
152
  "yosys-slang": {
148
153
  "git-url": "https://github.com/povik/yosys-slang.git",
149
- "git-commit": "34753c07b7bd285b784b3a2c756cfac56e1a26ab",
154
+ "git-commit": "7da40107a513f0094d209ab3b0899f64e8dbeb0e",
150
155
  "docker-depends": "yosys",
151
156
  "auto-update": true
152
157
  },
@@ -35,4 +35,8 @@ wget -O klayout.deb $url
35
35
  # Install package
36
36
  sudo apt-get install -y ./klayout.deb
37
37
 
38
+ if [ ! -z ${SC_PREFIX+x} ]; then
39
+ sudo cp ./klayout.deb "${SC_PREFIX}/"
40
+ fi
41
+
38
42
  cd -
@@ -37,4 +37,8 @@ wget -O klayout.deb $url
37
37
  # Install package
38
38
  sudo apt-get install -y ./klayout.deb
39
39
 
40
+ if [ ! -z ${SC_PREFIX+x} ]; then
41
+ sudo cp ./klayout.deb "${SC_PREFIX}/"
42
+ fi
43
+
40
44
  cd -
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: siliconcompiler
3
- Version: 0.33.1
3
+ Version: 0.33.2
4
4
  Summary: A compiler framework that automates translation from source code to silicon.
5
5
  Author-email: Andreas Olofsson <andreas.d.olofsson@gmail.com>
6
6
  License: Apache License 2.0
@@ -26,7 +26,7 @@ Requires-Python: >=3.8
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
28
  Requires-Dist: aiohttp==3.10.11; python_version <= "3.8"
29
- Requires-Dist: aiohttp<3.12.0,>=3.10.11; python_version >= "3.9"
29
+ Requires-Dist: aiohttp<3.13.0,>=3.10.11; python_version >= "3.9"
30
30
  Requires-Dist: requests==2.32.3
31
31
  Requires-Dist: PyYAML==6.0.2
32
32
  Requires-Dist: pandas>=1.1.5
@@ -47,7 +47,7 @@ Requires-Dist: docker==7.1.0
47
47
  Requires-Dist: importlib_metadata; python_version < "3.10"
48
48
  Requires-Dist: orjson==3.10.15; python_version <= "3.8"
49
49
  Requires-Dist: orjson==3.10.18; python_version >= "3.9"
50
- Requires-Dist: pyslang==8.0.0
50
+ Requires-Dist: pyslang==8.1.0
51
51
  Requires-Dist: streamlit==1.40.1; python_version <= "3.8"
52
52
  Requires-Dist: streamlit==1.45.1; python_version >= "3.9" and python_full_version != "3.9.7"
53
53
  Requires-Dist: streamlit_agraph==0.0.45; python_full_version != "3.9.7"
@@ -58,7 +58,8 @@ Requires-Dist: rich==13.9.4; python_version <= "3.8"
58
58
  Requires-Dist: rich<15.0.0,>=14.0.0; python_version >= "3.9"
59
59
  Provides-Extra: test
60
60
  Requires-Dist: pytest==8.3.5; extra == "test"
61
- Requires-Dist: pytest-xdist==3.6.1; extra == "test"
61
+ Requires-Dist: pytest-xdist==3.6.1; python_version <= "3.8" and extra == "test"
62
+ Requires-Dist: pytest-xdist==3.7.0; python_version >= "3.9" and extra == "test"
62
63
  Requires-Dist: pytest-timeout==2.4.0; extra == "test"
63
64
  Requires-Dist: pytest-asyncio==0.24.0; python_version <= "3.8" and extra == "test"
64
65
  Requires-Dist: pytest-asyncio==0.26.0; python_version >= "3.9" and extra == "test"