siliconcompiler 0.33.0__py3-none-any.whl → 0.33.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.
Files changed (170) hide show
  1. siliconcompiler/_common.py +5 -0
  2. siliconcompiler/_metadata.py +1 -1
  3. siliconcompiler/apps/sc_install.py +7 -0
  4. siliconcompiler/apps/sc_remote.py +7 -2
  5. siliconcompiler/core.py +34 -12
  6. siliconcompiler/metric.py +59 -0
  7. siliconcompiler/record.py +6 -2
  8. siliconcompiler/remote/client.py +10 -3
  9. siliconcompiler/remote/server.py +7 -2
  10. siliconcompiler/report/dashboard/cli/__init__.py +2 -0
  11. siliconcompiler/report/dashboard/cli/board.py +34 -30
  12. siliconcompiler/report/report.py +10 -5
  13. siliconcompiler/report/utils.py +12 -6
  14. siliconcompiler/scheduler/__init__.py +137 -974
  15. siliconcompiler/scheduler/send_messages.py +9 -3
  16. siliconcompiler/scheduler/slurm.py +10 -43
  17. siliconcompiler/scheduler/taskscheduler.py +320 -0
  18. siliconcompiler/schema/schema_cfg.py +2 -2
  19. siliconcompiler/tool.py +127 -19
  20. siliconcompiler/tools/_common/asic.py +5 -5
  21. siliconcompiler/tools/bluespec/convert.py +2 -1
  22. siliconcompiler/tools/builtin/_common.py +9 -2
  23. siliconcompiler/tools/builtin/concatenate.py +6 -2
  24. siliconcompiler/tools/builtin/minimum.py +7 -2
  25. siliconcompiler/tools/builtin/mux.py +7 -2
  26. siliconcompiler/tools/builtin/nop.py +7 -2
  27. siliconcompiler/tools/builtin/verify.py +7 -3
  28. siliconcompiler/tools/chisel/convert.py +10 -10
  29. siliconcompiler/tools/klayout/drc.py +2 -2
  30. siliconcompiler/tools/klayout/klayout_show.py +6 -6
  31. siliconcompiler/tools/klayout/klayout_utils.py +12 -12
  32. siliconcompiler/tools/netgen/count_lvs.py +2 -2
  33. siliconcompiler/tools/netgen/lvs.py +1 -1
  34. siliconcompiler/tools/openroad/_apr.py +2 -2
  35. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +1 -7
  36. siliconcompiler/tools/openroad/scripts/common/procs.tcl +18 -0
  37. siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +1 -7
  38. siliconcompiler/tools/opensta/scripts/sc_timing.tcl +10 -0
  39. siliconcompiler/tools/opensta/timing.py +11 -0
  40. siliconcompiler/tools/slang/__init__.py +3 -3
  41. siliconcompiler/tools/slang/elaborate.py +6 -6
  42. siliconcompiler/tools/slang/lint.py +1 -3
  43. siliconcompiler/tools/vpr/_xml_constraint.py +8 -8
  44. siliconcompiler/tools/yosys/prepareLib.py +2 -2
  45. siliconcompiler/tools/yosys/sc_synth_asic.tcl +43 -1
  46. siliconcompiler/tools/yosys/screenshot.py +1 -1
  47. siliconcompiler/tools/yosys/syn_asic.py +5 -5
  48. siliconcompiler/toolscripts/_tools.json +8 -6
  49. siliconcompiler/toolscripts/rhel8/install-chisel.sh +9 -2
  50. siliconcompiler/toolscripts/rhel8/install-icarus.sh +10 -3
  51. siliconcompiler/toolscripts/rhel8/install-klayout.sh +8 -1
  52. siliconcompiler/toolscripts/rhel8/install-magic.sh +9 -2
  53. siliconcompiler/toolscripts/rhel8/install-montage.sh +1 -1
  54. siliconcompiler/toolscripts/rhel8/install-netgen.sh +9 -2
  55. siliconcompiler/toolscripts/rhel8/install-slang.sh +11 -4
  56. siliconcompiler/toolscripts/rhel8/install-surelog.sh +9 -2
  57. siliconcompiler/toolscripts/rhel8/install-sv2v.sh +11 -4
  58. siliconcompiler/toolscripts/rhel8/install-verible.sh +11 -3
  59. siliconcompiler/toolscripts/rhel8/install-verilator.sh +10 -3
  60. siliconcompiler/toolscripts/rhel8/install-xyce.sh +15 -10
  61. siliconcompiler/toolscripts/rhel9/install-chisel.sh +9 -2
  62. siliconcompiler/toolscripts/rhel9/install-ghdl.sh +9 -2
  63. siliconcompiler/toolscripts/rhel9/install-gtkwave.sh +10 -3
  64. siliconcompiler/toolscripts/rhel9/install-icarus.sh +10 -3
  65. siliconcompiler/toolscripts/rhel9/install-klayout.sh +8 -1
  66. siliconcompiler/toolscripts/rhel9/install-magic.sh +9 -2
  67. siliconcompiler/toolscripts/rhel9/install-montage.sh +1 -1
  68. siliconcompiler/toolscripts/rhel9/install-netgen.sh +9 -2
  69. siliconcompiler/toolscripts/rhel9/install-openroad.sh +16 -3
  70. siliconcompiler/toolscripts/rhel9/install-opensta.sh +17 -5
  71. siliconcompiler/toolscripts/rhel9/install-slang.sh +11 -4
  72. siliconcompiler/toolscripts/rhel9/install-surelog.sh +9 -2
  73. siliconcompiler/toolscripts/rhel9/install-sv2v.sh +11 -4
  74. siliconcompiler/toolscripts/rhel9/install-verible.sh +11 -3
  75. siliconcompiler/toolscripts/rhel9/install-verilator.sh +10 -3
  76. siliconcompiler/toolscripts/rhel9/install-vpr.sh +9 -2
  77. siliconcompiler/toolscripts/rhel9/install-xdm.sh +10 -2
  78. siliconcompiler/toolscripts/rhel9/install-xyce.sh +15 -10
  79. siliconcompiler/toolscripts/rhel9/install-yosys-moosic.sh +9 -2
  80. siliconcompiler/toolscripts/rhel9/install-yosys-parmys.sh +10 -3
  81. siliconcompiler/toolscripts/rhel9/install-yosys-slang.sh +10 -2
  82. siliconcompiler/toolscripts/rhel9/install-yosys.sh +9 -2
  83. siliconcompiler/toolscripts/ubuntu20/install-bambu.sh +10 -2
  84. siliconcompiler/toolscripts/ubuntu20/install-bluespec.sh +10 -3
  85. siliconcompiler/toolscripts/ubuntu20/install-chisel.sh +9 -2
  86. siliconcompiler/toolscripts/ubuntu20/install-ghdl.sh +9 -2
  87. siliconcompiler/toolscripts/ubuntu20/install-gtkwave.sh +9 -2
  88. siliconcompiler/toolscripts/ubuntu20/install-icarus.sh +9 -2
  89. siliconcompiler/toolscripts/ubuntu20/install-icepack.sh +9 -2
  90. siliconcompiler/toolscripts/ubuntu20/install-klayout.sh +8 -1
  91. siliconcompiler/toolscripts/ubuntu20/install-magic.sh +9 -2
  92. siliconcompiler/toolscripts/ubuntu20/install-montage.sh +1 -1
  93. siliconcompiler/toolscripts/ubuntu20/install-netgen.sh +9 -2
  94. siliconcompiler/toolscripts/ubuntu20/install-nextpnr.sh +9 -2
  95. siliconcompiler/toolscripts/ubuntu20/install-openroad.sh +16 -3
  96. siliconcompiler/toolscripts/ubuntu20/install-opensta.sh +16 -5
  97. siliconcompiler/toolscripts/ubuntu20/install-slang.sh +11 -4
  98. siliconcompiler/toolscripts/ubuntu20/install-slurm.sh +9 -2
  99. siliconcompiler/toolscripts/ubuntu20/install-surelog.sh +10 -2
  100. siliconcompiler/toolscripts/ubuntu20/install-sv2v.sh +11 -4
  101. siliconcompiler/toolscripts/ubuntu20/install-verible.sh +11 -3
  102. siliconcompiler/toolscripts/ubuntu20/install-verilator.sh +9 -2
  103. siliconcompiler/toolscripts/ubuntu20/install-xdm.sh +10 -2
  104. siliconcompiler/toolscripts/ubuntu20/install-xyce.sh +13 -8
  105. siliconcompiler/toolscripts/ubuntu20/install-yosys-moosic.sh +9 -2
  106. siliconcompiler/toolscripts/ubuntu20/install-yosys.sh +9 -2
  107. siliconcompiler/toolscripts/ubuntu22/install-bambu.sh +10 -2
  108. siliconcompiler/toolscripts/ubuntu22/install-bluespec.sh +10 -3
  109. siliconcompiler/toolscripts/ubuntu22/install-chisel.sh +9 -2
  110. siliconcompiler/toolscripts/ubuntu22/install-ghdl.sh +9 -2
  111. siliconcompiler/toolscripts/ubuntu22/install-gtkwave.sh +9 -2
  112. siliconcompiler/toolscripts/ubuntu22/install-icarus.sh +9 -2
  113. siliconcompiler/toolscripts/ubuntu22/install-icepack.sh +9 -2
  114. siliconcompiler/toolscripts/ubuntu22/install-klayout.sh +8 -1
  115. siliconcompiler/toolscripts/ubuntu22/install-magic.sh +9 -2
  116. siliconcompiler/toolscripts/ubuntu22/install-montage.sh +1 -1
  117. siliconcompiler/toolscripts/ubuntu22/install-netgen.sh +9 -2
  118. siliconcompiler/toolscripts/ubuntu22/install-nextpnr.sh +9 -2
  119. siliconcompiler/toolscripts/ubuntu22/install-openroad.sh +16 -3
  120. siliconcompiler/toolscripts/ubuntu22/install-opensta.sh +17 -5
  121. siliconcompiler/toolscripts/ubuntu22/install-slang.sh +11 -4
  122. siliconcompiler/toolscripts/ubuntu22/install-slurm.sh +9 -2
  123. siliconcompiler/toolscripts/ubuntu22/install-surelog.sh +10 -2
  124. siliconcompiler/toolscripts/ubuntu22/install-sv2v.sh +11 -4
  125. siliconcompiler/toolscripts/ubuntu22/install-verible.sh +11 -3
  126. siliconcompiler/toolscripts/ubuntu22/install-verilator.sh +9 -2
  127. siliconcompiler/toolscripts/ubuntu22/install-vpr.sh +9 -2
  128. siliconcompiler/toolscripts/ubuntu22/install-xdm.sh +10 -2
  129. siliconcompiler/toolscripts/ubuntu22/install-xyce.sh +13 -8
  130. siliconcompiler/toolscripts/ubuntu22/install-yosys-moosic.sh +9 -2
  131. siliconcompiler/toolscripts/ubuntu22/install-yosys-parmys.sh +10 -3
  132. siliconcompiler/toolscripts/ubuntu22/install-yosys-slang.sh +10 -2
  133. siliconcompiler/toolscripts/ubuntu22/install-yosys.sh +9 -2
  134. siliconcompiler/toolscripts/ubuntu24/install-bambu.sh +12 -4
  135. siliconcompiler/toolscripts/ubuntu24/install-bluespec.sh +10 -3
  136. siliconcompiler/toolscripts/ubuntu24/install-chisel.sh +9 -2
  137. siliconcompiler/toolscripts/ubuntu24/install-ghdl.sh +9 -2
  138. siliconcompiler/toolscripts/ubuntu24/install-gtkwave.sh +9 -2
  139. siliconcompiler/toolscripts/ubuntu24/install-icarus.sh +9 -2
  140. siliconcompiler/toolscripts/ubuntu24/install-icepack.sh +9 -2
  141. siliconcompiler/toolscripts/ubuntu24/install-klayout.sh +8 -1
  142. siliconcompiler/toolscripts/ubuntu24/install-magic.sh +9 -2
  143. siliconcompiler/toolscripts/ubuntu24/install-montage.sh +1 -1
  144. siliconcompiler/toolscripts/ubuntu24/install-netgen.sh +9 -2
  145. siliconcompiler/toolscripts/ubuntu24/install-nextpnr.sh +9 -2
  146. siliconcompiler/toolscripts/ubuntu24/install-openroad.sh +16 -3
  147. siliconcompiler/toolscripts/ubuntu24/install-opensta.sh +17 -5
  148. siliconcompiler/toolscripts/ubuntu24/install-slang.sh +11 -4
  149. siliconcompiler/toolscripts/ubuntu24/install-slurm.sh +9 -2
  150. siliconcompiler/toolscripts/ubuntu24/install-surelog.sh +10 -2
  151. siliconcompiler/toolscripts/ubuntu24/install-sv2v.sh +11 -4
  152. siliconcompiler/toolscripts/ubuntu24/install-verible.sh +11 -3
  153. siliconcompiler/toolscripts/ubuntu24/install-verilator.sh +9 -2
  154. siliconcompiler/toolscripts/ubuntu24/install-vpr.sh +9 -2
  155. siliconcompiler/toolscripts/ubuntu24/install-xdm.sh +10 -2
  156. siliconcompiler/toolscripts/ubuntu24/install-xyce.sh +13 -8
  157. siliconcompiler/toolscripts/ubuntu24/install-yosys-moosic.sh +9 -2
  158. siliconcompiler/toolscripts/ubuntu24/install-yosys-parmys.sh +10 -3
  159. siliconcompiler/toolscripts/ubuntu24/install-yosys-slang.sh +10 -2
  160. siliconcompiler/toolscripts/ubuntu24/install-yosys.sh +9 -2
  161. siliconcompiler/utils/__init__.py +11 -0
  162. siliconcompiler/utils/flowgraph.py +6 -101
  163. siliconcompiler/utils/issue.py +15 -23
  164. siliconcompiler/utils/logging.py +2 -2
  165. {siliconcompiler-0.33.0.dist-info → siliconcompiler-0.33.1.dist-info}/METADATA +2 -2
  166. {siliconcompiler-0.33.0.dist-info → siliconcompiler-0.33.1.dist-info}/RECORD +170 -169
  167. {siliconcompiler-0.33.0.dist-info → siliconcompiler-0.33.1.dist-info}/WHEEL +1 -1
  168. {siliconcompiler-0.33.0.dist-info → siliconcompiler-0.33.1.dist-info}/entry_points.txt +0 -0
  169. {siliconcompiler-0.33.0.dist-info → siliconcompiler-0.33.1.dist-info}/licenses/LICENSE +0 -0
  170. {siliconcompiler-0.33.0.dist-info → siliconcompiler-0.33.1.dist-info}/top_level.txt +0 -0
siliconcompiler/tool.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import contextlib
2
+ import logging
2
3
  import os
3
4
  import psutil
4
5
  import re
@@ -32,8 +33,7 @@ from siliconcompiler import utils
32
33
  from siliconcompiler import sc_open
33
34
 
34
35
  from siliconcompiler.record import RecordTool
35
-
36
- from siliconcompiler.scheduler import print_traceback
36
+ from siliconcompiler.flowgraph import RuntimeFlowgraph
37
37
 
38
38
 
39
39
  class TaskError(Exception):
@@ -93,7 +93,7 @@ class ToolSchema(NamedSchema):
93
93
 
94
94
  self.set_runtime(None)
95
95
 
96
- def set_runtime(self, chip):
96
+ def set_runtime(self, chip, step=None, index=None):
97
97
  '''
98
98
  Sets the runtime information needed to properly execute a task.
99
99
  Note: unstable API
@@ -109,19 +109,22 @@ class ToolSchema(NamedSchema):
109
109
  self.__schema_full = chip.schema
110
110
  self.__logger = chip.logger
111
111
 
112
- self.__step = None
113
- self.__index = None
112
+ self.__step = step
113
+ self.__index = index
114
114
  self.__tool = None
115
115
  self.__task = None
116
116
 
117
117
  self.__schema_record = None
118
118
  self.__schema_metric = None
119
+ self.__schema_flow = None
119
120
  if self.__schema_full:
120
121
  self.__schema_record = self.__schema_full.get("record", field="schema")
121
122
  self.__schema_metric = self.__schema_full.get("metric", field="schema")
122
123
 
123
- self.__step = self.__schema_full.get('arg', 'step')
124
- self.__index = self.__schema_full.get('arg', 'index')
124
+ if not self.__step:
125
+ self.__step = self.__schema_full.get('arg', 'step')
126
+ if not self.__index:
127
+ self.__index = self.__schema_full.get('arg', 'index')
125
128
 
126
129
  if not self.__step or not self.__index:
127
130
  raise RuntimeError("step or index not specified")
@@ -129,10 +132,9 @@ class ToolSchema(NamedSchema):
129
132
  flow = self.__schema_full.get('option', 'flow')
130
133
  if not flow:
131
134
  raise RuntimeError("flow not specified")
132
- self.__tool = self.__schema_full.get(
133
- 'flowgraph', flow, self.__step, self.__index, 'tool')
134
- self.__task = self.__schema_full.get(
135
- 'flowgraph', flow, self.__step, self.__index, 'task')
135
+ self.__schema_flow = self.__schema_full.get("flowgraph", flow, field="schema")
136
+ self.__tool = self.__schema_flow.get(self.__step, self.__index, 'tool')
137
+ self.__task = self.__schema_flow.get(self.__step, self.__index, 'task')
136
138
 
137
139
  def node(self):
138
140
  '''
@@ -173,6 +175,8 @@ class ToolSchema(NamedSchema):
173
175
  return self.__schema_record
174
176
  elif type == "metric":
175
177
  return self.__schema_metric
178
+ elif type == "flow":
179
+ return self.__schema_flow
176
180
  else:
177
181
  raise ValueError(f"{type} is not a schema section")
178
182
 
@@ -625,23 +629,22 @@ class ToolSchema(NamedSchema):
625
629
  retcode = self.run()
626
630
  except Exception as e:
627
631
  self.__logger.error(f'Failed in run() for {self.name()}/{self.__task}: {e}')
628
- retcode = 1 # default to non-zero
629
- print_traceback(self.__chip, e)
632
+ utils.print_traceback(self.__logger, e)
630
633
  raise e
631
634
  finally:
632
635
  with sc_open(stdout_file) as stdout_reader, \
633
636
  sc_open(stderr_file) as stderr_reader:
634
637
  read_stdio(stdout_reader, stderr_reader)
635
638
 
636
- try:
637
- if resource:
639
+ if resource:
640
+ try:
638
641
  # Since memory collection is not possible, collect the current process
639
642
  # peak memory
640
643
  max_mem_bytes = max(
641
644
  max_mem_bytes,
642
645
  1024 * resource.getrusage(resource.RUSAGE_SELF).ru_maxrss)
643
- except (OSError, ValueError, PermissionError):
644
- pass
646
+ except (OSError, ValueError, PermissionError):
647
+ pass
645
648
  else:
646
649
  cmdlist = self.get_runtime_arguments()
647
650
 
@@ -670,7 +673,7 @@ class ToolSchema(NamedSchema):
670
673
  data = os.read(fd, 1024)
671
674
  log_writer.write(data)
672
675
  return data
673
- retcode = pty.spawn(cmdlist, read)
676
+ retcode = pty.spawn([exe, *cmdlist], read)
674
677
  else:
675
678
  with open(stdout_file, 'w') as stdout_writer, \
676
679
  open(stdout_file, 'r', errors='replace_with_warning') as stdout_reader, \
@@ -715,7 +718,7 @@ class ToolSchema(NamedSchema):
715
718
 
716
719
  memory_usage = psutil.virtual_memory()
717
720
  if memory_usage.percent > MEMORY_WARN_LIMIT:
718
- self.__logger.warn(
721
+ self.__logger.warning(
719
722
  'Current system memory usage is '
720
723
  f'{memory_usage.percent:.1f}%')
721
724
 
@@ -774,6 +777,7 @@ class ToolSchema(NamedSchema):
774
777
  for key in list(state.keys()):
775
778
  if key.startswith("_ToolSchema__"):
776
779
  del state[key]
780
+
777
781
  return state
778
782
 
779
783
  def __setstate__(self, state):
@@ -782,6 +786,9 @@ class ToolSchema(NamedSchema):
782
786
  # Reinit runtime information
783
787
  self.set_runtime(None)
784
788
 
789
+ def get_output_files(self):
790
+ return set(self.get("task", self.__task, "output", step=self.__step, index=self.__index))
791
+
785
792
  ###############################################################
786
793
  def parse_version(self, stdout):
787
794
  raise NotImplementedError("must be implemented by the implementation class")
@@ -792,6 +799,15 @@ class ToolSchema(NamedSchema):
792
799
  def setup(self):
793
800
  pass
794
801
 
802
+ def select_input_nodes(self):
803
+ flow = self.schema("flow")
804
+ runtime = RuntimeFlowgraph(
805
+ flow,
806
+ from_steps=set([step for step, _ in flow.get_entry_nodes()]),
807
+ prune_nodes=self.__chip.get('option', 'prune'))
808
+
809
+ return runtime.get_node_inputs(self.__step, self.__index, record=self.schema("record"))
810
+
795
811
  def pre_process(self):
796
812
  pass
797
813
 
@@ -805,6 +821,98 @@ class ToolSchema(NamedSchema):
805
821
  pass
806
822
 
807
823
 
824
+ ###########################################################################
825
+ # Migration helper
826
+ ###########################################################################
827
+ class ToolSchemaTmp(ToolSchema):
828
+ def __module_func(self, name, modules):
829
+ for module in modules:
830
+ method = getattr(module, name, None)
831
+ if method:
832
+ return method
833
+ return None
834
+
835
+ def __tool_task_modules(self):
836
+ step, index = self.node()
837
+ flow = self._ToolSchema__chip.get('option', 'flow')
838
+ return \
839
+ self._ToolSchema__chip._get_tool_module(step, index, flow=flow), \
840
+ self._ToolSchema__chip._get_task_module(step, index, flow=flow)
841
+
842
+ def get_output_files(self):
843
+ _, task = self.__tool_task_modules()
844
+ method = self.__module_func("_gather_outputs", [task])
845
+ if method:
846
+ return method(self._ToolSchema__chip, *self.node())
847
+ return ToolSchema.get_output_files(self)
848
+
849
+ def parse_version(self, stdout):
850
+ tool, _ = self.__tool_task_modules()
851
+ method = self.__module_func("parse_version", [tool])
852
+ if method:
853
+ return method(stdout)
854
+ return ToolSchema.parse_version(self, stdout)
855
+
856
+ def normalize_version(self, version):
857
+ tool, _ = self.__tool_task_modules()
858
+ method = self.__module_func("normalize_version", [tool])
859
+ if method:
860
+ return method(version)
861
+ return ToolSchema.normalize_version(self, version)
862
+
863
+ def setup(self):
864
+ _, task = self.__tool_task_modules()
865
+ method = self.__module_func("setup", [task])
866
+ if method:
867
+ return method(self._ToolSchema__chip)
868
+ return ToolSchema.setup(self)
869
+
870
+ def select_input_nodes(self):
871
+ _, task = self.__tool_task_modules()
872
+ method = self.__module_func("_select_inputs", [task])
873
+ if method:
874
+ return method(self._ToolSchema__chip, *self.node())
875
+ return ToolSchema.select_input_nodes(self)
876
+
877
+ def pre_process(self):
878
+ _, task = self.__tool_task_modules()
879
+ method = self.__module_func("pre_process", [task])
880
+ if method:
881
+ return method(self._ToolSchema__chip)
882
+ return ToolSchema.pre_process(self)
883
+
884
+ def runtime_options(self):
885
+ tool, task = self.__tool_task_modules()
886
+ method = self.__module_func("runtime_options", [task, tool])
887
+ if method:
888
+ return method(self._ToolSchema__chip)
889
+ return ToolSchema.runtime_options(self)
890
+
891
+ def run(self):
892
+ _, task = self.__tool_task_modules()
893
+ method = self.__module_func("run", [task])
894
+ if method:
895
+ # Handle logger stdout suppression if quiet
896
+ step, index = self.node()
897
+ stdout_handler_level = self._ToolSchema__chip.logger._console.level
898
+ if self._ToolSchema__chip.get('option', 'quiet', step=step, index=index):
899
+ self._ToolSchema__chip.logger._console.setLevel(logging.CRITICAL)
900
+
901
+ retcode = method(self._ToolSchema__chip)
902
+
903
+ self._ToolSchema__chip.logger._console.setLevel(stdout_handler_level)
904
+
905
+ return retcode
906
+ return ToolSchema.run(self)
907
+
908
+ def post_process(self):
909
+ _, task = self.__tool_task_modules()
910
+ method = self.__module_func("post_process", [task])
911
+ if method:
912
+ return method(self._ToolSchema__chip)
913
+ return ToolSchema.post_process(self)
914
+
915
+
808
916
  ###########################################################################
809
917
  # Tool Setup
810
918
  ###########################################################################
@@ -257,10 +257,10 @@ class CellArea:
257
257
  def __init__(self):
258
258
  self.__areas = {}
259
259
 
260
- def addCell(self, name=None, module=None,
261
- cellarea=None, cellcount=None,
262
- macroarea=None, macrocount=None,
263
- stdcellarea=None, stdcellcount=None):
260
+ def add_cell(self, name=None, module=None,
261
+ cellarea=None, cellcount=None,
262
+ macroarea=None, macrocount=None,
263
+ stdcellarea=None, stdcellcount=None):
264
264
  if not name and not module:
265
265
  return
266
266
 
@@ -294,6 +294,6 @@ class CellArea:
294
294
  def size(self):
295
295
  return len(self.__areas)
296
296
 
297
- def writeReport(self, path):
297
+ def write_report(self, path):
298
298
  with open(path, 'w') as f:
299
299
  json.dump(self.__areas, f, indent=4)
@@ -125,7 +125,8 @@ def post_process(chip):
125
125
  if os.path.exists(mod_path):
126
126
  extra_modules.add(mod_path)
127
127
  else:
128
- chip.logger.warn(f"Unable to find module {module} source files at: {BSC_LIB}")
128
+ chip.logger.warning(f"Unable to find module {module} source "
129
+ f"files at: {BSC_LIB}")
129
130
 
130
131
  # bsc outputs each compiled module to its own Verilog file, so we
131
132
  # concatenate them all to create a pickled output we can pass along.
@@ -3,7 +3,7 @@ from siliconcompiler import NodeStatus, SiliconCompilerError
3
3
  from siliconcompiler import utils
4
4
  import shutil
5
5
  from siliconcompiler.tools._common import get_tool_task
6
- from siliconcompiler.utils.flowgraph import _get_pruned_node_inputs
6
+ from siliconcompiler.flowgraph import RuntimeFlowgraph
7
7
 
8
8
 
9
9
  ###########################################################################
@@ -152,4 +152,11 @@ def _select_inputs(chip, step, index):
152
152
  chip.logger.info(f"Running builtin task '{task}'")
153
153
 
154
154
  flow = chip.get('option', 'flow')
155
- return _get_pruned_node_inputs(chip, flow, (step, index))
155
+
156
+ flow_schema = chip.schema.get("flowgraph", flow, field="schema")
157
+ runtime = RuntimeFlowgraph(
158
+ flow_schema,
159
+ from_steps=set([step for step, _ in flow_schema.get_entry_nodes()]),
160
+ prune_nodes=chip.get('option', 'prune'))
161
+
162
+ return runtime.get_node_inputs(step, index, record=chip.schema.get("record", field="schema"))
@@ -3,7 +3,6 @@ import os
3
3
  from siliconcompiler import sc_open, SiliconCompilerError
4
4
  from siliconcompiler import utils
5
5
  from siliconcompiler.tools._common import input_provides, input_file_node_name, get_tool_task
6
- from siliconcompiler.utils import flowgraph
7
6
  from siliconcompiler import scheduler
8
7
 
9
8
 
@@ -63,7 +62,12 @@ def _gather_outputs(chip, step, index):
63
62
  flow = chip.get('option', 'flow')
64
63
 
65
64
  in_nodes = chip.get('flowgraph', flow, step, index, 'input')
66
- in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
65
+ in_task_outputs = []
66
+ for in_step, in_index in in_nodes:
67
+ in_tool, _ = get_tool_task(chip, in_step, in_index, flow=flow)
68
+ task_class = chip.get("tool", in_tool, field="schema")
69
+ task_class.set_runtime(chip, step=in_step, index=in_index)
70
+ in_task_outputs.append(task_class.get_output_files())
67
71
 
68
72
  if len(in_task_outputs) > 0:
69
73
  return in_task_outputs[0].union(*in_task_outputs[1:])
@@ -1,6 +1,6 @@
1
1
  from siliconcompiler.tools.builtin import _common
2
- from siliconcompiler.utils import flowgraph
3
2
  from siliconcompiler.tools.builtin.builtin import set_io_files
3
+ from siliconcompiler.tools._common import get_tool_task
4
4
 
5
5
 
6
6
  def setup(chip):
@@ -41,7 +41,12 @@ def _gather_outputs(chip, step, index):
41
41
  flow = chip.get('option', 'flow')
42
42
 
43
43
  in_nodes = chip.get('flowgraph', flow, step, index, 'input')
44
- in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
44
+ in_task_outputs = []
45
+ for in_step, in_index in in_nodes:
46
+ in_tool, _ = get_tool_task(chip, in_step, in_index, flow=flow)
47
+ task_class = chip.get("tool", in_tool, field="schema")
48
+ task_class.set_runtime(chip, step=in_step, index=in_index)
49
+ in_task_outputs.append(task_class.get_output_files())
45
50
 
46
51
  if len(in_task_outputs) > 0:
47
52
  return in_task_outputs[0].intersection(*in_task_outputs[1:])
@@ -2,7 +2,7 @@ from siliconcompiler.tools.builtin import _common
2
2
  import re
3
3
  from siliconcompiler.tools.builtin.builtin import set_io_files
4
4
  from siliconcompiler import SiliconCompilerError
5
- from siliconcompiler.utils import flowgraph
5
+ from siliconcompiler.tools._common import get_tool_task
6
6
 
7
7
 
8
8
  def setup(chip):
@@ -55,7 +55,12 @@ def _gather_outputs(chip, step, index):
55
55
  flow = chip.get('option', 'flow')
56
56
 
57
57
  in_nodes = chip.get('flowgraph', flow, step, index, 'input')
58
- in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
58
+ in_task_outputs = []
59
+ for in_step, in_index in in_nodes:
60
+ in_tool, _ = get_tool_task(chip, in_step, in_index, flow=flow)
61
+ task_class = chip.get("tool", in_tool, field="schema")
62
+ task_class.set_runtime(chip, step=in_step, index=in_index)
63
+ in_task_outputs.append(task_class.get_output_files())
59
64
 
60
65
  if len(in_task_outputs) > 0:
61
66
  return in_task_outputs[0].intersection(*in_task_outputs[1:])
@@ -1,6 +1,6 @@
1
1
  from siliconcompiler.tools.builtin import _common
2
2
  from siliconcompiler.tools.builtin.builtin import set_io_files
3
- from siliconcompiler.utils import flowgraph
3
+ from siliconcompiler.tools._common import get_tool_task
4
4
 
5
5
 
6
6
  def setup(chip):
@@ -22,7 +22,12 @@ def _gather_outputs(chip, step, index):
22
22
  flow = chip.get('option', 'flow')
23
23
 
24
24
  in_nodes = chip.get('flowgraph', flow, step, index, 'input')
25
- in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
25
+ in_task_outputs = []
26
+ for in_step, in_index in in_nodes:
27
+ in_tool, _ = get_tool_task(chip, in_step, in_index, flow=flow)
28
+ task_class = chip.get("tool", in_tool, field="schema")
29
+ task_class.set_runtime(chip, step=in_step, index=in_index)
30
+ in_task_outputs.append(task_class.get_output_files())
26
31
 
27
32
  if len(in_task_outputs) > 0:
28
33
  return in_task_outputs[0].union(*in_task_outputs[1:])
@@ -3,11 +3,10 @@ from siliconcompiler.schema.parametertype import NodeType
3
3
  from siliconcompiler.scheduler import _haltstep
4
4
  from siliconcompiler.tools.builtin.builtin import set_io_files
5
5
  from siliconcompiler import utils, SiliconCompilerError
6
+ from siliconcompiler.tools._common import get_tool_task
6
7
 
7
8
  import re
8
9
 
9
- from siliconcompiler.utils import flowgraph
10
-
11
10
 
12
11
  def setup(chip):
13
12
  '''
@@ -69,7 +68,12 @@ def _gather_outputs(chip, step, index):
69
68
  flow = chip.get('option', 'flow')
70
69
 
71
70
  in_nodes = chip.get('flowgraph', flow, step, index, 'input')
72
- in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
71
+ in_task_outputs = []
72
+ for in_step, in_index in in_nodes:
73
+ in_tool, _ = get_tool_task(chip, in_step, in_index, flow=flow)
74
+ task_class = chip.get("tool", in_tool, field="schema")
75
+ task_class.set_runtime(chip, step=in_step, index=in_index)
76
+ in_task_outputs.append(task_class.get_output_files())
73
77
 
74
78
  if len(in_task_outputs) > 0:
75
79
  return in_task_outputs[0].intersection(*in_task_outputs[1:])
@@ -103,7 +103,7 @@ def runtime_options(chip):
103
103
 
104
104
  design = chip.top()
105
105
 
106
- runMain = ["runMain"]
106
+ run_main = ["runMain"]
107
107
  if chip.valid('input', 'config', 'chisel') and \
108
108
  chip.get('input', 'config', 'chisel', step=step, index=index):
109
109
  app = design
@@ -112,23 +112,23 @@ def runtime_options(chip):
112
112
  app = chip.get('tool', tool, 'task', task, 'var', 'application',
113
113
  step=step, index=index)[0]
114
114
 
115
- runMain.append(f"{app}")
115
+ run_main.append(f"{app}")
116
116
 
117
117
  if chip.valid('tool', tool, 'task', task, 'var', 'argument') and \
118
118
  chip.get('tool', tool, 'task', task, 'var', 'argument', step=step, index=index):
119
- runMain.extend(chip.get('tool', tool, 'task', task, 'var', 'argument',
120
- step=step, index=index))
121
- runMain.append("--")
119
+ run_main.extend(chip.get('tool', tool, 'task', task, 'var', 'argument',
120
+ step=step, index=index))
121
+ run_main.append("--")
122
122
 
123
- runMain.extend(["--target-dir", "chisel-output"])
123
+ run_main.extend(["--target-dir", "chisel-output"])
124
124
  else:
125
125
  # Use built in driver
126
- runMain.append("SCDriver")
127
- runMain.extend(["--module", chip.top(step=step, index=index)])
126
+ run_main.append("SCDriver")
127
+ run_main.extend(["--module", chip.top(step=step, index=index)])
128
128
 
129
- runMain.extend(["--output-file", f"../outputs/{design}.v"])
129
+ run_main.extend(["--output-file", f"../outputs/{design}.v"])
130
130
 
131
- return [" ".join(runMain)]
131
+ return [" ".join(run_main)]
132
132
 
133
133
 
134
134
  def post_process(chip):
@@ -6,7 +6,7 @@ from siliconcompiler.tools._common import input_provides, has_input_files, \
6
6
  from siliconcompiler.tools._common.asic import set_tool_task_var, get_tool_task_var
7
7
 
8
8
  from siliconcompiler.tools.klayout.klayout import setup as setup_tool
9
- import xml.etree.ElementTree as ET
9
+ from xml.etree import ElementTree
10
10
  from siliconcompiler import utils
11
11
 
12
12
 
@@ -144,7 +144,7 @@ def post_process(chip):
144
144
  drc_report = None
145
145
  if os.path.isfile(drc_db):
146
146
  with open(drc_db, "r") as f:
147
- drc_report = ET.fromstring(f.read())
147
+ drc_report = ElementTree.fromstring(f.read())
148
148
  if drc_report is None:
149
149
  drc_db = []
150
150
 
@@ -17,18 +17,18 @@ def show(schema, tech, input_path, output_path, screenshot=False, report=None):
17
17
  sc_hide_layers = []
18
18
 
19
19
  # Load KLayout technology file
20
- layoutOptions = tech.load_layout_options
20
+ layout_options = tech.load_layout_options
21
21
 
22
22
  # These may be disabled in our KLayout tech file for reasons relating to GDS
23
23
  # export, but for the purposes of viewing we'll hardcode them to True.
24
- layoutOptions.lefdef_config.produce_blockages = True
25
- layoutOptions.lefdef_config.produce_cell_outlines = True
26
- layoutOptions.lefdef_config.produce_obstructions = True
24
+ layout_options.lefdef_config.produce_blockages = True
25
+ layout_options.lefdef_config.produce_cell_outlines = True
26
+ layout_options.lefdef_config.produce_obstructions = True
27
27
 
28
28
  # Always use LEF geometry even when LEF file contains FOREIGN statement.
29
- layoutOptions.lefdef_config.macro_resolution_mode = 1
29
+ layout_options.lefdef_config.macro_resolution_mode = 1
30
30
 
31
- tech.load_layout_options = layoutOptions
31
+ tech.load_layout_options = layout_options
32
32
 
33
33
  app = pya.Application.instance()
34
34
  main_window = pya.MainWindow.instance()
@@ -84,12 +84,12 @@ def technology(design, schema):
84
84
  lefs.extend(schema.get('library', lib, 'output', sc_stackup, 'lef',
85
85
  step=sc_step, index=sc_index))
86
86
 
87
- layoutOptions = tech.load_layout_options
87
+ layout_options = tech.load_layout_options
88
88
 
89
- layoutOptions.lefdef_config.macro_resolution_mode = 1
90
- layoutOptions.lefdef_config.via_cellname_prefix = "VIA_"
89
+ layout_options.lefdef_config.macro_resolution_mode = 1
90
+ layout_options.lefdef_config.via_cellname_prefix = "VIA_"
91
91
  pathed_files = set()
92
- for lef_file in layoutOptions.lefdef_config.lef_files:
92
+ for lef_file in layout_options.lefdef_config.lef_files:
93
93
  if foundry_lef and not os.path.isabs(lef_file):
94
94
  lef_file = os.path.join(os.path.dirname(foundry_lef), lef_file)
95
95
  lef_file = os.path.abspath(lef_file)
@@ -99,13 +99,13 @@ def technology(design, schema):
99
99
  for lef in lefs:
100
100
  pathed_files.add(os.path.abspath(lef))
101
101
 
102
- layoutOptions.lefdef_config.lef_files = list(pathed_files)
103
- layoutOptions.lefdef_config.read_lef_with_def = False
104
- layoutOptions.lefdef_config.dbu = tech.dbu
102
+ layout_options.lefdef_config.lef_files = list(pathed_files)
103
+ layout_options.lefdef_config.read_lef_with_def = False
104
+ layout_options.lefdef_config.dbu = tech.dbu
105
105
 
106
- layoutOptions.lefdef_config.produce_fills = True
106
+ layout_options.lefdef_config.produce_fills = True
107
107
 
108
- for lef_file in layoutOptions.lefdef_config.lef_files:
108
+ for lef_file in layout_options.lefdef_config.lef_files:
109
109
  print(f"[INFO] LEF file: {lef_file}")
110
110
 
111
111
  # Set layer properties
@@ -127,7 +127,7 @@ def technology(design, schema):
127
127
  print(f"[INFO] Layer properties: {layer_properties}")
128
128
 
129
129
  # Set layer map
130
- map_file = layoutOptions.lefdef_config.map_file
130
+ map_file = layout_options.lefdef_config.map_file
131
131
  if map_file:
132
132
  map_file = map_file[0]
133
133
  if not os.path.isabs(map_file):
@@ -141,10 +141,10 @@ def technology(design, schema):
141
141
  break
142
142
 
143
143
  if map_file and os.path.exists(map_file):
144
- layoutOptions.lefdef_config.map_file = map_file
144
+ layout_options.lefdef_config.map_file = map_file
145
145
  print(f"[INFO] Layer map: {map_file}")
146
146
 
147
- tech.load_layout_options = layoutOptions
147
+ tech.load_layout_options = layout_options
148
148
 
149
149
  return tech
150
150
 
@@ -34,7 +34,7 @@ import argparse
34
34
  from siliconcompiler import sc_open
35
35
 
36
36
 
37
- def count_LVS_failures(filename):
37
+ def count_lvs_failures(filename):
38
38
  with sc_open(filename) as cfile:
39
39
  lvsdata = json.load(cfile)
40
40
 
@@ -114,7 +114,7 @@ if __name__ == '__main__':
114
114
  parser = argparse.ArgumentParser(description='Parses netgen lvs')
115
115
  parser.add_argument('--file', '-f', required=True)
116
116
  args = parser.parse_args()
117
- failures = count_LVS_failures(args.file)
117
+ failures = count_lvs_failures(args.file)
118
118
  total = failures[0]
119
119
  if total > 0:
120
120
  failed = True
@@ -79,7 +79,7 @@ def post_process(chip):
79
79
  chip.logger.warning('No LVS report generated. Netgen may have encountered errors.')
80
80
  return
81
81
 
82
- lvs_failures = count_lvs.count_LVS_failures(lvs_report)
82
+ lvs_failures = count_lvs.count_lvs_failures(lvs_report)
83
83
 
84
84
  # We don't count top-level pin mismatches as errors b/c we seem to get
85
85
  # false positives for disconnected pins. Report them as warnings
@@ -402,7 +402,7 @@ def _generate_cell_area_report(design, ord_metrics):
402
402
  if stdcell_info_area:
403
403
  stdcellarea = sum(stdcell_info_area)
404
404
 
405
- cellarea_report.addCell(
405
+ cellarea_report.add_cell(
406
406
  name=cell_name,
407
407
  module=cell_type,
408
408
  cellarea=cellarea,
@@ -420,7 +420,7 @@ def _generate_cell_area_report(design, ord_metrics):
420
420
  process_cell(module)
421
421
 
422
422
  if cellarea_report.size() > 0:
423
- cellarea_report.writeReport("reports/hierarchical_cell_area.json")
423
+ cellarea_report.write_report("reports/hierarchical_cell_area.json")
424
424
 
425
425
 
426
426
  def define_tapcell_params(chip):
@@ -19,13 +19,7 @@ source "$sc_refdir/apr/preamble.tcl"
19
19
  # Setup Global Connections
20
20
  ###############################
21
21
 
22
- if { [sc_cfg_tool_task_exists {file} global_connect] } {
23
- foreach global_connect [sc_cfg_tool_task_get {file} global_connect] {
24
- puts "Sourcing global connect configuration: ${global_connect}"
25
- source $global_connect
26
- }
27
- }
28
- tee -file reports/global_connections.rpt {report_global_connect}
22
+ sc_global_connections
29
23
 
30
24
  ###############################
31
25
  # Initialize floorplan
@@ -874,3 +874,21 @@ proc sc_report_args { args } {
874
874
 
875
875
  puts "$keys(-command) siliconcompiler arguments: $keys(-args)"
876
876
  }
877
+
878
+ proc sc_global_connections { args } {
879
+ sta::check_argc_eq0 "sc_global_connections" $args
880
+
881
+ if { [sc_cfg_tool_task_exists {file} global_connect] } {
882
+ set global_connect_files []
883
+ foreach global_connect [sc_cfg_tool_task_get {file} global_connect] {
884
+ if { [lsearch -exact $global_connect_files $global_connect] != -1 } {
885
+ continue
886
+ }
887
+ puts "Loading global connect configuration: ${global_connect}"
888
+ source $global_connect
889
+
890
+ lappend global_connect_files $global_connect
891
+ }
892
+ }
893
+ tee -file reports/global_connections.rpt {report_global_connect}
894
+ }