siliconcompiler 0.34.2__py3-none-any.whl → 0.34.3__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 (121) hide show
  1. siliconcompiler/__init__.py +12 -5
  2. siliconcompiler/__main__.py +1 -7
  3. siliconcompiler/_metadata.py +1 -1
  4. siliconcompiler/apps/_common.py +104 -23
  5. siliconcompiler/apps/sc.py +4 -8
  6. siliconcompiler/apps/sc_dashboard.py +6 -4
  7. siliconcompiler/apps/sc_install.py +10 -6
  8. siliconcompiler/apps/sc_issue.py +7 -5
  9. siliconcompiler/apps/sc_remote.py +1 -1
  10. siliconcompiler/apps/sc_server.py +9 -14
  11. siliconcompiler/apps/sc_show.py +6 -5
  12. siliconcompiler/apps/smake.py +130 -94
  13. siliconcompiler/apps/utils/replay.py +4 -7
  14. siliconcompiler/apps/utils/summarize.py +3 -5
  15. siliconcompiler/asic.py +420 -0
  16. siliconcompiler/checklist.py +25 -2
  17. siliconcompiler/cmdlineschema.py +534 -0
  18. siliconcompiler/constraints/asic_component.py +2 -2
  19. siliconcompiler/constraints/asic_pins.py +2 -2
  20. siliconcompiler/constraints/asic_timing.py +3 -3
  21. siliconcompiler/core.py +7 -32
  22. siliconcompiler/data/templates/tcl/manifest.tcl.j2 +8 -0
  23. siliconcompiler/dependencyschema.py +89 -31
  24. siliconcompiler/design.py +176 -207
  25. siliconcompiler/filesetschema.py +250 -0
  26. siliconcompiler/flowgraph.py +274 -95
  27. siliconcompiler/fpga.py +124 -1
  28. siliconcompiler/library.py +218 -20
  29. siliconcompiler/metric.py +233 -20
  30. siliconcompiler/package/__init__.py +271 -50
  31. siliconcompiler/package/git.py +92 -16
  32. siliconcompiler/package/github.py +108 -12
  33. siliconcompiler/package/https.py +79 -16
  34. siliconcompiler/packageschema.py +88 -7
  35. siliconcompiler/pathschema.py +31 -2
  36. siliconcompiler/pdk.py +566 -1
  37. siliconcompiler/project.py +1095 -94
  38. siliconcompiler/record.py +38 -1
  39. siliconcompiler/remote/__init__.py +5 -2
  40. siliconcompiler/remote/client.py +11 -6
  41. siliconcompiler/remote/schema.py +5 -23
  42. siliconcompiler/remote/server.py +41 -54
  43. siliconcompiler/report/__init__.py +3 -3
  44. siliconcompiler/report/dashboard/__init__.py +48 -14
  45. siliconcompiler/report/dashboard/cli/__init__.py +99 -21
  46. siliconcompiler/report/dashboard/cli/board.py +364 -179
  47. siliconcompiler/report/dashboard/web/__init__.py +90 -12
  48. siliconcompiler/report/dashboard/web/components/__init__.py +219 -240
  49. siliconcompiler/report/dashboard/web/components/flowgraph.py +49 -26
  50. siliconcompiler/report/dashboard/web/components/graph.py +139 -100
  51. siliconcompiler/report/dashboard/web/layouts/__init__.py +29 -1
  52. siliconcompiler/report/dashboard/web/layouts/_common.py +38 -2
  53. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph.py +39 -26
  54. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_node_tab.py +50 -50
  55. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_sac_tabs.py +49 -46
  56. siliconcompiler/report/dashboard/web/state.py +141 -14
  57. siliconcompiler/report/dashboard/web/utils/__init__.py +79 -16
  58. siliconcompiler/report/dashboard/web/utils/file_utils.py +74 -11
  59. siliconcompiler/report/dashboard/web/viewer.py +25 -1
  60. siliconcompiler/report/report.py +5 -2
  61. siliconcompiler/report/summary_image.py +29 -11
  62. siliconcompiler/scheduler/__init__.py +9 -1
  63. siliconcompiler/scheduler/docker.py +79 -1
  64. siliconcompiler/scheduler/run_node.py +35 -19
  65. siliconcompiler/scheduler/scheduler.py +208 -24
  66. siliconcompiler/scheduler/schedulernode.py +372 -46
  67. siliconcompiler/scheduler/send_messages.py +77 -29
  68. siliconcompiler/scheduler/slurm.py +76 -12
  69. siliconcompiler/scheduler/taskscheduler.py +140 -20
  70. siliconcompiler/schema/__init__.py +0 -2
  71. siliconcompiler/schema/baseschema.py +194 -38
  72. siliconcompiler/schema/journal.py +7 -4
  73. siliconcompiler/schema/namedschema.py +16 -10
  74. siliconcompiler/schema/parameter.py +55 -9
  75. siliconcompiler/schema/parametervalue.py +60 -0
  76. siliconcompiler/schema/safeschema.py +25 -2
  77. siliconcompiler/schema/schema_cfg.py +5 -5
  78. siliconcompiler/schema/utils.py +2 -2
  79. siliconcompiler/schema_obj.py +20 -3
  80. siliconcompiler/tool.py +979 -302
  81. siliconcompiler/tools/bambu/__init__.py +41 -0
  82. siliconcompiler/tools/builtin/concatenate.py +2 -2
  83. siliconcompiler/tools/builtin/minimum.py +2 -1
  84. siliconcompiler/tools/builtin/mux.py +2 -1
  85. siliconcompiler/tools/builtin/nop.py +2 -1
  86. siliconcompiler/tools/builtin/verify.py +2 -1
  87. siliconcompiler/tools/klayout/__init__.py +95 -0
  88. siliconcompiler/tools/openroad/__init__.py +289 -0
  89. siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -0
  90. siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +7 -2
  91. siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +8 -4
  92. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +9 -5
  93. siliconcompiler/tools/openroad/scripts/common/write_images.tcl +5 -1
  94. siliconcompiler/tools/slang/__init__.py +1 -1
  95. siliconcompiler/tools/slang/elaborate.py +2 -1
  96. siliconcompiler/tools/vivado/scripts/sc_run.tcl +1 -1
  97. siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +8 -1
  98. siliconcompiler/tools/vivado/syn_fpga.py +6 -0
  99. siliconcompiler/tools/vivado/vivado.py +35 -2
  100. siliconcompiler/tools/vpr/__init__.py +150 -0
  101. siliconcompiler/tools/yosys/__init__.py +369 -1
  102. siliconcompiler/tools/yosys/scripts/procs.tcl +0 -1
  103. siliconcompiler/toolscripts/_tools.json +5 -10
  104. siliconcompiler/utils/__init__.py +66 -0
  105. siliconcompiler/utils/flowgraph.py +2 -2
  106. siliconcompiler/utils/issue.py +2 -1
  107. siliconcompiler/utils/logging.py +14 -0
  108. siliconcompiler/utils/multiprocessing.py +256 -0
  109. siliconcompiler/utils/showtools.py +10 -0
  110. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/METADATA +5 -5
  111. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/RECORD +115 -118
  112. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/entry_points.txt +3 -0
  113. siliconcompiler/schema/cmdlineschema.py +0 -250
  114. siliconcompiler/toolscripts/rhel8/install-slang.sh +0 -40
  115. siliconcompiler/toolscripts/rhel9/install-slang.sh +0 -40
  116. siliconcompiler/toolscripts/ubuntu20/install-slang.sh +0 -47
  117. siliconcompiler/toolscripts/ubuntu22/install-slang.sh +0 -37
  118. siliconcompiler/toolscripts/ubuntu24/install-slang.sh +0 -37
  119. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/WHEEL +0 -0
  120. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/licenses/LICENSE +0 -0
  121. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/top_level.txt +0 -0
@@ -1,45 +1,103 @@
1
+ import atexit
2
+
1
3
  from siliconcompiler.report.dashboard import AbstractDashboard
2
- from siliconcompiler.report.dashboard.cli.board import Board
3
4
 
4
5
 
5
6
  class CliDashboard(AbstractDashboard):
7
+ """
8
+ A command-line interface (CLI) implementation of the AbstractDashboard.
9
+
10
+ This class provides a concrete dashboard that renders progress and logs
11
+ directly in the terminal. It acts as a bridge between the core `chip` object
12
+ and the `Board` class, which handles the actual `rich`-based rendering.
13
+
14
+ It manages the lifecycle of the dashboard, including starting, stopping,
15
+ and updating it with data from the chip. A key feature is its ability to
16
+ "hijack" the standard logger to redirect log messages to its own display area.
17
+
18
+ Attributes:
19
+ _dashboard: An instance of the underlying `Board` class that manages
20
+ the `rich` live display.
21
+ _logger: The `logging.Logger` instance associated with the dashboard.
22
+ __logger_console: A private attribute to store the original console
23
+ handler of the logger before it's replaced.
24
+ """
6
25
 
7
26
  def __init__(self, chip):
27
+ """
28
+ Initializes the CliDashboard.
29
+
30
+ Args:
31
+ chip: The SiliconCompiler chip object this dashboard is associated with.
32
+ """
33
+ from siliconcompiler.utils.multiprocessing import MPManager
34
+
8
35
  super().__init__(chip)
9
36
 
10
- self._dashboard = Board()
37
+ self._dashboard = MPManager.get_dashboard()
11
38
 
12
39
  self.__logger_console = None
13
40
 
14
- self._logger = chip.logger
41
+ self._logger = None
42
+
43
+ if self.is_running():
44
+ # Attach logger when already running
45
+ self.set_logger(self._chip.logger)
46
+
47
+ # Ensure the dashboard is properly stopped on program exit
48
+ self.__exit_registered = True
49
+ atexit.register(self.stop)
15
50
 
16
51
  def set_logger(self, logger):
17
52
  """
18
- Sets the logger for the dashboard.
53
+ Sets the logger for the dashboard and hijacks its console handler.
54
+
55
+ This method replaces the chip's default console log handler with one
56
+ that directs log messages to the dashboard's internal log buffer.
57
+ The original handler is saved so it can be restored later.
19
58
 
20
59
  Args:
21
- logger (logging.Logger): The logger to set.
60
+ logger (logging.Logger): The logger instance to attach to.
22
61
  """
62
+ if self._logger == logger:
63
+ return
64
+
23
65
  self._logger = logger
24
66
  if self._logger and self._dashboard._active:
25
- # Hijack the console
67
+ # Hijack the console handler to redirect logs to the dashboard
26
68
  self._logger.removeHandler(self._chip._logger_console)
27
69
  self.__logger_console = self._chip._logger_console
28
- self._chip._logger_console = self._dashboard._log_handler
29
- self._logger.addHandler(self._dashboard._log_handler)
30
- self._dashboard._log_handler.setFormatter(self.__logger_console.formatter)
70
+ self._chip._logger_console = self._dashboard.make_log_hander()
71
+ self._logger.addHandler(self._chip._logger_console)
72
+ self._chip._logger_console.setFormatter(self.__logger_console.formatter)
31
73
 
32
74
  def open_dashboard(self):
33
- """Starts the dashboard rendering thread if it is not already running."""
75
+ """
76
+ Starts the dashboard rendering thread.
77
+
78
+ This method ensures the logger is set and then tells the underlying
79
+ `Board` object to start its live-rendering thread.
80
+ """
81
+
82
+ if not self.__exit_registered:
83
+ # Ensure the dashboard is properly stopped on program exit
84
+ self.__exit_registered = True
85
+ atexit.register(self.stop)
34
86
 
35
- self.set_logger(self._logger)
87
+ self.set_logger(self._chip.logger)
36
88
 
37
89
  self._dashboard.open_dashboard()
38
90
 
39
91
  def update_manifest(self, payload=None):
40
92
  """
41
- Updates the manifest file with the latest data from the chip object.
42
- This ensures that the dashboard reflects the current state of the chip.
93
+ Updates the dashboard with the latest data from the chip's manifest.
94
+
95
+ This method is called to refresh the dashboard's display with the
96
+ current state of the compilation flow.
97
+
98
+ Args:
99
+ payload (dict, optional): A dictionary that can contain additional
100
+ data, such as node start times. Defaults to None.
43
101
  """
44
102
  starttimes = None
45
103
  if payload and "starttimes" in payload:
@@ -51,31 +109,51 @@ class CliDashboard(AbstractDashboard):
51
109
  pass
52
110
 
53
111
  def is_running(self):
54
- """Returns True to indicate that the dashboard is running."""
112
+ """
113
+ Checks if the dashboard rendering thread is currently active.
114
+
115
+ Returns:
116
+ bool: True if the dashboard is running, False otherwise.
117
+ """
55
118
  return self._dashboard.is_running()
56
119
 
57
120
  def end_of_run(self):
58
121
  """
59
- Stops the dashboard rendering thread and ensures all rendering operations are completed.
122
+ Signals to the dashboard that the compilation run has finished.
123
+
124
+ This triggers a final update of the dashboard to show the completed state.
60
125
  """
61
126
  self._dashboard.end_of_run(self._chip)
62
127
 
63
128
  def stop(self):
64
129
  """
65
- Stops the dashboard rendering thread and ensures all rendering operations are completed.
130
+ Stops the dashboard and restores the original logger configuration.
131
+
132
+ This method performs a final update, stops the rendering thread, and
133
+ restores the original console handler to the logger.
66
134
  """
67
135
  self._dashboard.end_of_run(self._chip)
68
136
 
69
137
  self._dashboard.stop()
70
138
 
71
- # Restore logger
72
- if self.__logger_console:
73
- self._logger.removeHandler(self._dashboard._log_handler)
139
+ # Restore the original logger handler
140
+ if self.__logger_console and self._logger:
141
+ self._logger.removeHandler(self._chip._logger_console)
142
+ formatter = self._chip._logger_console.formatter
74
143
  self._chip._logger_console = self.__logger_console
75
144
  self._logger.addHandler(self.__logger_console)
76
- self.__logger_console.setFormatter(self._dashboard._log_handler.formatter)
145
+ self.__logger_console.setFormatter(formatter)
77
146
  self.__logger_console = None
78
147
 
148
+ if self.__exit_registered:
149
+ atexit.unregister(self.stop)
150
+ self.__exit_registered = False
151
+
79
152
  def wait(self):
80
- """Waits for the dashboard rendering thread to finish."""
153
+ """
154
+ Waits for the dashboard rendering thread to complete.
155
+
156
+ This is a blocking call that is useful for ensuring the dashboard has
157
+ fully shut down before the main program exits.
158
+ """
81
159
  self._dashboard.wait()