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
@@ -14,6 +14,7 @@ class NodeStatus():
14
14
  SKIPPED = 'skipped'
15
15
  TIMEOUT = 'timeout'
16
16
 
17
+ @staticmethod
17
18
  def is_done(status):
18
19
  return status in (
19
20
  NodeStatus.SUCCESS,
@@ -22,23 +23,27 @@ class NodeStatus():
22
23
  NodeStatus.TIMEOUT
23
24
  )
24
25
 
26
+ @staticmethod
25
27
  def is_running(status):
26
28
  return status in (
27
29
  NodeStatus.QUEUED,
28
30
  NodeStatus.RUNNING
29
31
  )
30
32
 
33
+ @staticmethod
31
34
  def is_waiting(status):
32
35
  return status in (
33
36
  NodeStatus.PENDING,
34
37
  )
35
38
 
39
+ @staticmethod
36
40
  def is_success(status):
37
41
  return status in (
38
42
  NodeStatus.SUCCESS,
39
43
  NodeStatus.SKIPPED
40
44
  )
41
45
 
46
+ @staticmethod
42
47
  def is_error(status):
43
48
  return status in (
44
49
  NodeStatus.ERROR,
@@ -1,5 +1,5 @@
1
1
  # Version number following semver standard.
2
- version = '0.33.0'
2
+ version = '0.33.1'
3
3
 
4
4
  # Default server address for remote runs, if unspecified.
5
5
  default_server = 'https://server.siliconcompiler.com'
@@ -42,6 +42,13 @@ def install_tool(tool, script, build_dir, prefix):
42
42
  # setup environment
43
43
  env = os.environ.copy()
44
44
  env["PREFIX"] = prefix
45
+ env["USE_SUDO_INSTALL"] = "no"
46
+ try:
47
+ os.makedirs(prefix, exist_ok=True)
48
+ except PermissionError:
49
+ env["USE_SUDO_INSTALL"] = "yes"
50
+ if not os.access(prefix, os.W_OK):
51
+ env["USE_SUDO_INSTALL"] = "yes"
45
52
 
46
53
  # run
47
54
  ret = subprocess.call(script, env=env, cwd=build_dir)
@@ -6,7 +6,7 @@ from siliconcompiler import Chip
6
6
  from siliconcompiler import SiliconCompilerError
7
7
  from siliconcompiler.remote.client import Client, ConfigureClient
8
8
  from siliconcompiler.scheduler import _finalize_run
9
- from siliconcompiler.utils.flowgraph import nodes_to_execute
9
+ from siliconcompiler.flowgraph import RuntimeFlowgraph
10
10
 
11
11
 
12
12
  def main():
@@ -170,7 +170,12 @@ To delete a job, use:
170
170
  return 1
171
171
 
172
172
  # Wrap up run
173
- for step, index in nodes_to_execute(chip):
173
+ runtime = RuntimeFlowgraph(
174
+ chip.schema.get("flowgraph", flow, field='schema'),
175
+ from_steps=chip.get('option', 'from'),
176
+ to_steps=chip.get('option', 'to'),
177
+ prune_nodes=chip.get('option', 'prune'))
178
+ for step, index in runtime.get_nodes():
174
179
  manifest = os.path.join(chip.getworkdir(step=step, index=index),
175
180
  'outputs',
176
181
  f'{chip.design}.pkg.json')
siliconcompiler/core.py CHANGED
@@ -37,10 +37,7 @@ from siliconcompiler.report.dashboard import DashboardType
37
37
  from siliconcompiler import package as sc_package
38
38
  import glob
39
39
  from siliconcompiler.scheduler import run as sc_runner
40
- from siliconcompiler.utils.flowgraph import nodes_to_execute, \
41
- _get_pruned_node_inputs, \
42
- _get_flowgraph_execution_order, _check_flowgraph_io, \
43
- _get_flowgraph_information
40
+ from siliconcompiler.utils.flowgraph import _check_flowgraph_io, _get_flowgraph_information
44
41
  from siliconcompiler.tools._common import get_tool_task
45
42
  from types import FunctionType, ModuleType
46
43
  from siliconcompiler.flowgraph import RuntimeFlowgraph
@@ -1622,11 +1619,26 @@ class Chip:
1622
1619
  error = True
1623
1620
  self.logger.error(f"flowgraph {flow} not defined.")
1624
1621
 
1625
- nodes = [node for node in nodes_to_execute(self)
1622
+ runtime = RuntimeFlowgraph(
1623
+ self.schema.get("flowgraph", flow, field='schema'),
1624
+ args=(self.get('arg', 'step'), self.get('arg', 'index')),
1625
+ from_steps=self.get('option', 'from'),
1626
+ to_steps=self.get('option', 'to'),
1627
+ prune_nodes=self.get('option', 'prune'))
1628
+
1629
+ nodes = [node for node in runtime.get_nodes()
1626
1630
  if self.get('record', 'status', step=node[0], index=node[1])
1627
1631
  != NodeStatus.SKIPPED]
1632
+ flow_schema = self.schema.get("flowgraph", flow, field="schema")
1633
+ runtime_io = RuntimeFlowgraph(
1634
+ flow_schema,
1635
+ args=(self.get('arg', 'step'), self.get('arg', 'index')),
1636
+ from_steps=set([step for step, _ in flow_schema.get_entry_nodes()]),
1637
+ prune_nodes=self.get('option', 'prune'))
1638
+
1628
1639
  for (step, index) in nodes:
1629
- for in_step, in_index in _get_pruned_node_inputs(self, flow, (step, index)):
1640
+ for in_step, in_index in runtime_io.get_node_inputs(
1641
+ step, index, record=self.schema.get("record", field="schema")):
1630
1642
  if (in_step, in_index) in nodes:
1631
1643
  # we're gonna run this step, OK
1632
1644
  continue
@@ -1717,7 +1729,7 @@ class Chip:
1717
1729
  error = True
1718
1730
  self.logger.error(f'No executable or run() function specified for {tool}/{task}')
1719
1731
 
1720
- if not _check_flowgraph_io(self, nodes=nodes):
1732
+ if not error and not _check_flowgraph_io(self, nodes=nodes):
1721
1733
  error = True
1722
1734
 
1723
1735
  return not error
@@ -2748,7 +2760,13 @@ class Chip:
2748
2760
  flow = self.get('option', 'flow')
2749
2761
  flowgraph_nodes = [(step, index) for index in self.getkeys("flowgraph", flow, step)]
2750
2762
  else:
2751
- flowgraph_nodes = nodes_to_execute(self)
2763
+ flow = self.get('option', 'flow')
2764
+ runtime = RuntimeFlowgraph(
2765
+ self.schema.get("flowgraph", flow, field='schema'),
2766
+ from_steps=self.get('option', 'from'),
2767
+ to_steps=self.get('option', 'to'),
2768
+ prune_nodes=self.get('option', 'prune'))
2769
+ flowgraph_nodes = runtime.get_nodes()
2752
2770
 
2753
2771
  if not archive_name:
2754
2772
  if step and index:
@@ -3231,14 +3249,18 @@ class Chip:
3231
3249
  search_nodes.append((sc_step, sc_index))
3232
3250
  elif sc_step:
3233
3251
  if flow is not None:
3234
- for check_step, check_index in nodes_to_execute(self, flow):
3252
+ runtime = RuntimeFlowgraph(
3253
+ self.schema.get("flowgraph", flow, field='schema'),
3254
+ from_steps=self.get('option', 'from'),
3255
+ to_steps=self.get('option', 'to'),
3256
+ prune_nodes=self.get('option', 'prune'))
3257
+ for check_step, check_index in runtime.get_nodes():
3235
3258
  if sc_step == check_step:
3236
3259
  search_nodes.append((check_step, check_index))
3237
3260
  else:
3238
3261
  if flow is not None:
3239
- for nodes in _get_flowgraph_execution_order(self,
3240
- flow,
3241
- reverse=True):
3262
+ for nodes in self.schema.get(
3263
+ "flowgraph", flow, field="schema").get_execution_order(reverse=True):
3242
3264
  search_nodes.extend(nodes)
3243
3265
 
3244
3266
  for ext in self._showtools.keys():
siliconcompiler/metric.py CHANGED
@@ -3,6 +3,7 @@ from siliconcompiler.schema import EditableSchema, Parameter, PerNode, Scope
3
3
  from siliconcompiler.schema.utils import trim
4
4
 
5
5
  from siliconcompiler.utils.units import convert
6
+ from siliconcompiler.record import RecordTime
6
7
 
7
8
 
8
9
  class MetricSchema(BaseSchema):
@@ -43,6 +44,64 @@ class MetricSchema(BaseSchema):
43
44
 
44
45
  return self.set(metric, value, step=step, index=str(index))
45
46
 
47
+ def record_totaltime(self, step, index, flow, record):
48
+ """
49
+ Record the total time for this node
50
+
51
+ Args:
52
+ step (str): step to record
53
+ index (str/int): index to record
54
+ flow (:class:`FlowgraphSchema`): flowgraph to lookup nodes in
55
+ record (:class:`RecordSchema`): record to lookup data in
56
+ """
57
+ all_nodes = flow.get_nodes()
58
+ node_times = [
59
+ (record.get_recorded_time(*node, RecordTime.START),
60
+ record.get_recorded_time(*node, RecordTime.END)) for node in all_nodes
61
+ ]
62
+
63
+ # Remove incomplete records
64
+ node_times = [times for times in node_times if times[0] is not None]
65
+
66
+ if len(node_times) == 0:
67
+ return False
68
+
69
+ node_end = record.get_recorded_time(step, index, RecordTime.END)
70
+ if node_end is None:
71
+ return False
72
+
73
+ node_times = sorted(node_times)
74
+ if len(node_times) > 1:
75
+ new_times = []
76
+ for n in range(len(node_times)):
77
+ if not new_times:
78
+ new_times.append(node_times[n])
79
+ continue
80
+ prev_start_time, prev_end_time = new_times[-1]
81
+ start_time, end_time = node_times[n]
82
+
83
+ new_start = min(prev_start_time, start_time)
84
+
85
+ if prev_end_time is None:
86
+ new_times[-1] = (new_start, end_time)
87
+ elif prev_end_time >= start_time:
88
+ if end_time is not None:
89
+ new_end = max(prev_end_time, end_time)
90
+ else:
91
+ new_end = prev_end_time
92
+ new_times[-1] = (new_start, new_end)
93
+ else:
94
+ new_times.append(node_times[n])
95
+ node_times = new_times
96
+
97
+ total_time = 0
98
+ for start_time, end_time in node_times:
99
+ if start_time > node_end:
100
+ continue
101
+ total_time += min(end_time, node_end) - start_time
102
+
103
+ return self.record(step, index, "totaltime", total_time, unit="s")
104
+
46
105
 
47
106
  ###########################################################################
48
107
  # Metrics to Track
siliconcompiler/record.py CHANGED
@@ -259,7 +259,7 @@ class RecordSchema(BaseSchema):
259
259
 
260
260
  def get_recorded_time(self, step, index, type):
261
261
  '''
262
- Returns the time recorded for a given record.
262
+ Returns the time recorded for a given record, or None if nothing is recorded.
263
263
 
264
264
  Args:
265
265
  step (str): Step name to associate.
@@ -267,8 +267,12 @@ class RecordSchema(BaseSchema):
267
267
  type (:class:`RecordTime`): type of time to record
268
268
  '''
269
269
  type = RecordTime(type)
270
+ record_time = self.get(type.value, step=step, index=index)
271
+ if record_time is None:
272
+ return None
273
+
270
274
  return datetime.strptime(
271
- self.get(type.value, step=step, index=index)+"+0000",
275
+ record_time+"+0000",
272
276
  RecordSchema.__TIMEFORMAT+"%z").timestamp()
273
277
 
274
278
  def record_tool(self, step, index, info, type):
@@ -13,9 +13,10 @@ import multiprocessing
13
13
  from siliconcompiler import utils, SiliconCompilerError, NodeStatus
14
14
  from siliconcompiler import NodeStatus as SCNodeStatus
15
15
  from siliconcompiler._metadata import default_server
16
- from siliconcompiler.utils.flowgraph import nodes_to_execute
17
16
  from siliconcompiler.remote import JobStatus
18
17
  from siliconcompiler.report.dashboard import DashboardType
18
+ from siliconcompiler.flowgraph import RuntimeFlowgraph
19
+ from siliconcompiler.schema import JournalingSchema
19
20
 
20
21
  # Step name to use while logging
21
22
  remote_step_name = 'remote'
@@ -590,7 +591,7 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
590
591
  f'{self.__chip.design}.pkg.json')
591
592
  if os.path.exists(manifest):
592
593
  try:
593
- self.__chip.schema.read_journal(manifest)
594
+ JournalingSchema(self.__chip.schema).read_journal(manifest)
594
595
  node_info["imported"] = True
595
596
  changed = True
596
597
  except: # noqa E722
@@ -618,7 +619,13 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
618
619
  self.__check_interval = check_info['progress_interval']
619
620
 
620
621
  self.__node_information = {}
621
- for step, index in nodes_to_execute(self.__chip):
622
+ runtime = RuntimeFlowgraph(
623
+ self.__chip.schema.get("flowgraph", self.__chip.get('option', 'flow'), field='schema'),
624
+ from_steps=self.__chip.get('option', 'from'),
625
+ to_steps=self.__chip.get('option', 'to'),
626
+ prune_nodes=self.__chip.get('option', 'prune'))
627
+
628
+ for step, index in runtime.get_nodes():
622
629
  done = SCNodeStatus.is_done(self.__chip.get('record', 'status', step=step, index=index))
623
630
  node_info = {
624
631
  "step": step,
@@ -21,7 +21,7 @@ from siliconcompiler.schema import SCHEMA_VERSION as sc_schema_version
21
21
  from siliconcompiler.remote.schema import ServerSchema
22
22
  from siliconcompiler.remote import banner, JobStatus
23
23
  from siliconcompiler.scheduler.slurm import get_configuration_directory
24
- from siliconcompiler.utils.flowgraph import nodes_to_execute
24
+ from siliconcompiler.flowgraph import RuntimeFlowgraph
25
25
 
26
26
 
27
27
  # Compile validation code for API request bodies.
@@ -422,7 +422,12 @@ class Server:
422
422
  chip.run()
423
423
 
424
424
  # Archive each task.
425
- for (step, index) in nodes_to_execute(chip):
425
+ runtime = RuntimeFlowgraph(
426
+ chip.schema.get("flowgraph", chip.get('option', 'flow'), field='schema'),
427
+ from_steps=chip.get('option', 'from'),
428
+ to_steps=chip.get('option', 'to'),
429
+ prune_nodes=chip.get('option', 'prune'))
430
+ for (step, index) in runtime.get_nodes():
426
431
  chip.cwd = os.path.join(chip.get('option', 'builddir'), '..')
427
432
  tf = tarfile.open(os.path.join(self.nfs_mount,
428
433
  job_hash,
@@ -66,6 +66,8 @@ class CliDashboard(AbstractDashboard):
66
66
  """
67
67
  self._dashboard.end_of_run(self._chip)
68
68
 
69
+ self._dashboard.stop()
70
+
69
71
  # Restore logger
70
72
  if self.__logger_console:
71
73
  self._logger.removeHandler(self._dashboard._log_handler)
@@ -22,6 +22,8 @@ from siliconcompiler import SiliconCompilerError, NodeStatus
22
22
  from siliconcompiler.utils.logging import SCColorLoggerFormatter
23
23
  from siliconcompiler.flowgraph import RuntimeFlowgraph
24
24
 
25
+ import atexit
26
+
25
27
 
26
28
  class LogBufferHandler(logging.Handler):
27
29
  def __init__(self, sync_queue, n=50, event=None):
@@ -246,6 +248,15 @@ class Board(metaclass=BoardSingleton):
246
248
 
247
249
  def _init_singleton(self):
248
250
  self._console = Console(theme=Board.__theme)
251
+
252
+ self.live = Live(
253
+ console=self._console,
254
+ screen=False,
255
+ auto_refresh=True,
256
+ )
257
+
258
+ atexit.register(self._stop_on_exit)
259
+
249
260
  self._active = self._console.is_terminal
250
261
  if not self._active:
251
262
  self._console = None
@@ -279,6 +290,9 @@ class Board(metaclass=BoardSingleton):
279
290
 
280
291
  self._metrics = ("warnings", "errors")
281
292
 
293
+ def _stop_on_exit(self):
294
+ self.stop()
295
+
282
296
  def open_dashboard(self):
283
297
  """Starts the dashboard rendering thread if it is not already running."""
284
298
 
@@ -289,7 +303,7 @@ class Board(metaclass=BoardSingleton):
289
303
  self._update_render_data(None)
290
304
 
291
305
  with self._job_data_lock:
292
- if not self._render_thread:
306
+ if not self._render_thread or not self._render_thread.is_alive():
293
307
  self._render_thread = threading.Thread(target=self._render, daemon=True)
294
308
  self._render_event.clear()
295
309
  self._render_stop_event.clear()
@@ -328,7 +342,6 @@ class Board(metaclass=BoardSingleton):
328
342
  return
329
343
 
330
344
  self._update_render_data(chip, complete=True)
331
- self.stop()
332
345
 
333
346
  def stop(self):
334
347
  """
@@ -337,18 +350,20 @@ class Board(metaclass=BoardSingleton):
337
350
  if not self.is_running():
338
351
  return
339
352
 
340
- # check for running jobs
341
- with self._job_data_lock:
342
- if self._job_data:
343
- if any([not job.complete for job in self._job_data.values()]):
344
- return
353
+ if self._job_data:
354
+ if any([not job.complete for job in self._job_data.values()]):
355
+ return
345
356
 
346
- self._render_stop_event.set()
347
- self._render_event.set()
357
+ self._render_stop_event.set()
358
+ self._render_event.set()
348
359
 
349
360
  # Wait for rendering to finish
350
361
  self.wait()
351
362
 
363
+ # Restore terminal
364
+ self.live.stop()
365
+ self._console.show_cursor()
366
+
352
367
  def wait(self):
353
368
  """Waits for the dashboard rendering thread to finish."""
354
369
  if not self.is_running():
@@ -595,18 +610,11 @@ class Board(metaclass=BoardSingleton):
595
610
  # Catch any multiprocessing errors
596
611
  return True
597
612
 
598
- live = None
599
613
  try:
600
614
  update_data()
601
- live = Live(
602
- self._get_rendable(),
603
- console=self._console,
604
- screen=False,
605
- # transient=True,
606
- auto_refresh=True,
607
- # refresh_per_second=60,
608
- )
609
- live.start()
615
+
616
+ if not self.live.is_started:
617
+ self.live.start(refresh=True)
610
618
 
611
619
  while not check_stop_event():
612
620
  try:
@@ -620,18 +628,14 @@ class Board(metaclass=BoardSingleton):
620
628
  break
621
629
 
622
630
  update_data()
623
- live.update(self._get_rendable(), refresh=True)
631
+ self.live.update(self._get_rendable(), refresh=True)
632
+
624
633
  finally:
625
- try:
626
- update_data()
627
- if live:
628
- live.update(self._get_rendable(), refresh=True)
629
- live.stop()
630
- else:
631
- self._console.print(self._get_rendable())
632
- finally:
633
- # Restore the prompt
634
- print("\033[?25h", end="")
634
+ update_data()
635
+ if self.live:
636
+ self.live.update(self._get_rendable(), refresh=True)
637
+ else:
638
+ self._console.print(self._get_rendable())
635
639
 
636
640
  def _update_layout(self):
637
641
  with self._render_data_lock:
@@ -3,8 +3,8 @@ import os
3
3
  from siliconcompiler import Schema
4
4
  from siliconcompiler.schema import PerNode
5
5
  from siliconcompiler.report import utils
6
- from siliconcompiler.utils.flowgraph import nodes_to_execute
7
6
  from siliconcompiler.tools._common import get_tool_task
7
+ from siliconcompiler.flowgraph import RuntimeFlowgraph
8
8
 
9
9
 
10
10
  def make_metric_dataframe(chip):
@@ -199,7 +199,12 @@ def get_flowgraph_path(chip):
199
199
  Returns the "winning" path for that job.
200
200
  '''
201
201
  flow = chip.get('option', 'flow')
202
- return utils._get_flowgraph_path(chip, flow, nodes_to_execute(chip))
202
+ runtime = RuntimeFlowgraph(
203
+ chip.schema.get("flowgraph", flow, field='schema'),
204
+ from_steps=chip.get('option', 'from'),
205
+ to_steps=chip.get('option', 'to'),
206
+ prune_nodes=chip.get('option', 'prune'))
207
+ return utils._get_flowgraph_path(chip, flow, runtime.get_nodes())
203
208
 
204
209
 
205
210
  def search_manifest_keys(manifest, key):
@@ -289,9 +294,9 @@ def get_total_manifest_key_count(manifest):
289
294
  acc (int) : An accumulator of the current number of folders and files.
290
295
  '''
291
296
  acc = len(manifest)
292
- for dictKeys in manifest:
293
- if isinstance(manifest[dictKeys], dict):
294
- acc += get_total_manifest_key_count(manifest[dictKeys])
297
+ for key in manifest:
298
+ if isinstance(manifest[key], dict):
299
+ acc += get_total_manifest_key_count(manifest[key])
295
300
  return acc
296
301
 
297
302
 
@@ -1,14 +1,13 @@
1
1
  from siliconcompiler import NodeStatus
2
2
  from siliconcompiler.utils import units
3
- from siliconcompiler.utils.flowgraph import _get_flowgraph_execution_order, \
4
- nodes_to_execute
5
3
  from siliconcompiler.tools._common import get_tool_task
6
4
 
7
5
  from siliconcompiler.flowgraph import RuntimeFlowgraph
8
6
 
9
7
 
10
8
  def _find_summary_image(chip, ext='png'):
11
- for nodes in reversed(_get_flowgraph_execution_order(chip, chip.get('option', 'flow'))):
9
+ for nodes in reversed(chip.schema.get(
10
+ "flowgraph", chip.get('option', 'flow'), field="schema").get_execution_order()):
12
11
  for step, index in nodes:
13
12
  layout_img = chip.find_result(ext, step=step, index=index)
14
13
  if layout_img:
@@ -18,7 +17,8 @@ def _find_summary_image(chip, ext='png'):
18
17
 
19
18
  def _find_summary_metrics(chip, metrics_map):
20
19
  metrics = {}
21
- for nodes in reversed(_get_flowgraph_execution_order(chip, chip.get('option', 'flow'))):
20
+ for nodes in reversed(chip.schema.get(
21
+ "flowgraph", chip.get('option', 'flow'), field="schema").get_execution_order()):
22
22
  for step, index in nodes:
23
23
  for name, metric_info in metrics_map.items():
24
24
  if name in metrics:
@@ -44,7 +44,13 @@ def _collect_data(chip, flow=None, flowgraph_nodes=None, format_as_string=True):
44
44
  return [], {}, {}, {}, [], {}
45
45
 
46
46
  if not flowgraph_nodes:
47
- flowgraph_nodes = list(nodes_to_execute(chip))
47
+ runtime = RuntimeFlowgraph(
48
+ chip.schema.get("flowgraph", flow, field='schema'),
49
+ from_steps=chip.get('option', 'from'),
50
+ to_steps=chip.get('option', 'to'),
51
+ prune_nodes=chip.get('option', 'prune'))
52
+
53
+ flowgraph_nodes = list(runtime.get_nodes())
48
54
  # only report tool based steps functions
49
55
  for (step, index) in list(flowgraph_nodes):
50
56
  tool, task = get_tool_task(chip, step, '0', flow=flow)
@@ -64,7 +70,7 @@ def _collect_data(chip, flow=None, flowgraph_nodes=None, format_as_string=True):
64
70
  reports = {}
65
71
 
66
72
  # Build ordered list of nodes in flowgraph
67
- for level_nodes in _get_flowgraph_execution_order(chip, flow):
73
+ for level_nodes in chip.schema.get("flowgraph", flow, field="schema").get_execution_order():
68
74
  nodes.extend(sorted(level_nodes))
69
75
  nodes = [node for node in nodes if node in flowgraph_nodes]
70
76
  for (step, index) in nodes: