siliconcompiler 0.32.2__py3-none-any.whl → 0.33.0__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 (277) hide show
  1. siliconcompiler/__init__.py +19 -2
  2. siliconcompiler/_metadata.py +3 -2
  3. siliconcompiler/apps/sc.py +2 -2
  4. siliconcompiler/apps/sc_install.py +3 -3
  5. siliconcompiler/apps/sc_issue.py +1 -1
  6. siliconcompiler/apps/sc_remote.py +4 -4
  7. siliconcompiler/apps/sc_show.py +2 -2
  8. siliconcompiler/apps/utils/replay.py +5 -3
  9. siliconcompiler/asic.py +120 -0
  10. siliconcompiler/checklist.py +150 -0
  11. siliconcompiler/core.py +319 -345
  12. siliconcompiler/{templates → data/templates}/replay/replay.sh.j2 +2 -2
  13. siliconcompiler/flowgraph.py +803 -515
  14. siliconcompiler/fpga.py +84 -0
  15. siliconcompiler/metric.py +420 -0
  16. siliconcompiler/optimizer/vizier.py +2 -3
  17. siliconcompiler/package/__init__.py +29 -6
  18. siliconcompiler/pdk.py +415 -0
  19. siliconcompiler/record.py +449 -0
  20. siliconcompiler/remote/client.py +61 -19
  21. siliconcompiler/remote/schema.py +116 -112
  22. siliconcompiler/remote/server.py +3 -5
  23. siliconcompiler/report/__init__.py +3 -2
  24. siliconcompiler/report/dashboard/__init__.py +61 -170
  25. siliconcompiler/report/dashboard/cli/__init__.py +79 -0
  26. siliconcompiler/report/dashboard/cli/board.py +895 -0
  27. siliconcompiler/report/dashboard/web/__init__.py +196 -0
  28. siliconcompiler/report/dashboard/{components → web/components}/__init__.py +9 -8
  29. siliconcompiler/report/dashboard/{components → web/components}/flowgraph.py +3 -3
  30. siliconcompiler/report/dashboard/{components → web/components}/graph.py +7 -4
  31. siliconcompiler/report/dashboard/{layouts → web/layouts}/__init__.py +3 -3
  32. siliconcompiler/report/dashboard/{layouts → web/layouts}/_common.py +1 -1
  33. siliconcompiler/report/dashboard/{layouts → web/layouts}/vertical_flowgraph.py +5 -5
  34. siliconcompiler/report/dashboard/{layouts → web/layouts}/vertical_flowgraph_node_tab.py +6 -6
  35. siliconcompiler/report/dashboard/{layouts → web/layouts}/vertical_flowgraph_sac_tabs.py +6 -6
  36. siliconcompiler/report/dashboard/{state.py → web/state.py} +1 -1
  37. siliconcompiler/report/dashboard/{utils → web/utils}/__init__.py +4 -3
  38. siliconcompiler/report/dashboard/{viewer.py → web/viewer.py} +4 -4
  39. siliconcompiler/report/html_report.py +2 -3
  40. siliconcompiler/report/report.py +13 -7
  41. siliconcompiler/report/summary_image.py +1 -1
  42. siliconcompiler/report/summary_table.py +3 -3
  43. siliconcompiler/report/utils.py +11 -10
  44. siliconcompiler/scheduler/__init__.py +153 -286
  45. siliconcompiler/scheduler/run_node.py +2 -1
  46. siliconcompiler/scheduler/send_messages.py +4 -4
  47. siliconcompiler/scheduler/slurm.py +2 -2
  48. siliconcompiler/schema/__init__.py +19 -2
  49. siliconcompiler/schema/baseschema.py +493 -0
  50. siliconcompiler/schema/cmdlineschema.py +250 -0
  51. siliconcompiler/{sphinx_ext → schema/docs}/__init__.py +3 -1
  52. siliconcompiler/{sphinx_ext → schema/docs}/dynamicgen.py +63 -81
  53. siliconcompiler/{sphinx_ext → schema/docs}/schemagen.py +73 -85
  54. siliconcompiler/{sphinx_ext → schema/docs}/utils.py +12 -13
  55. siliconcompiler/schema/editableschema.py +136 -0
  56. siliconcompiler/schema/journalingschema.py +238 -0
  57. siliconcompiler/schema/namedschema.py +41 -0
  58. siliconcompiler/schema/packageschema.py +101 -0
  59. siliconcompiler/schema/parameter.py +791 -0
  60. siliconcompiler/schema/parametertype.py +323 -0
  61. siliconcompiler/schema/parametervalue.py +736 -0
  62. siliconcompiler/schema/safeschema.py +37 -0
  63. siliconcompiler/schema/schema_cfg.py +109 -1789
  64. siliconcompiler/schema/utils.py +5 -68
  65. siliconcompiler/schema_obj.py +119 -0
  66. siliconcompiler/tool.py +1308 -0
  67. siliconcompiler/tools/_common/__init__.py +8 -10
  68. siliconcompiler/tools/_common/sdc/sc_constraints.sdc +1 -1
  69. siliconcompiler/tools/bluespec/convert.py +7 -7
  70. siliconcompiler/tools/builtin/_common.py +1 -1
  71. siliconcompiler/tools/builtin/concatenate.py +2 -2
  72. siliconcompiler/tools/builtin/minimum.py +1 -1
  73. siliconcompiler/tools/builtin/mux.py +2 -1
  74. siliconcompiler/tools/builtin/nop.py +1 -1
  75. siliconcompiler/tools/builtin/verify.py +6 -4
  76. siliconcompiler/tools/chisel/convert.py +4 -4
  77. siliconcompiler/tools/genfasm/bitstream.py +3 -3
  78. siliconcompiler/tools/ghdl/convert.py +1 -1
  79. siliconcompiler/tools/icarus/compile.py +4 -4
  80. siliconcompiler/tools/icepack/bitstream.py +6 -1
  81. siliconcompiler/tools/klayout/convert_drc_db.py +5 -0
  82. siliconcompiler/tools/klayout/klayout_export.py +0 -1
  83. siliconcompiler/tools/klayout/klayout_utils.py +3 -10
  84. siliconcompiler/tools/nextpnr/apr.py +6 -1
  85. siliconcompiler/tools/nextpnr/nextpnr.py +4 -4
  86. siliconcompiler/tools/openroad/_apr.py +17 -0
  87. siliconcompiler/tools/openroad/fillmetal_insertion.py +14 -14
  88. siliconcompiler/tools/openroad/rdlroute.py +3 -3
  89. siliconcompiler/tools/openroad/scripts/apr/postamble.tcl +1 -1
  90. siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +5 -5
  91. siliconcompiler/tools/openroad/scripts/apr/sc_antenna_repair.tcl +3 -3
  92. siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +3 -3
  93. siliconcompiler/tools/openroad/scripts/apr/sc_detailed_placement.tcl +3 -3
  94. siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +3 -3
  95. siliconcompiler/tools/openroad/scripts/apr/sc_endcap_tapcell_insertion.tcl +3 -3
  96. siliconcompiler/tools/openroad/scripts/apr/sc_fillercell_insertion.tcl +3 -3
  97. siliconcompiler/tools/openroad/scripts/apr/sc_fillmetal_insertion.tcl +4 -4
  98. siliconcompiler/tools/openroad/scripts/apr/sc_global_placement.tcl +3 -3
  99. siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +3 -3
  100. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +3 -3
  101. siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +4 -4
  102. siliconcompiler/tools/openroad/scripts/apr/sc_metrics.tcl +3 -3
  103. siliconcompiler/tools/openroad/scripts/apr/sc_pin_placement.tcl +3 -3
  104. siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +3 -3
  105. siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +3 -3
  106. siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +4 -4
  107. siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +3 -3
  108. siliconcompiler/tools/openroad/scripts/common/procs.tcl +58 -2
  109. siliconcompiler/tools/openroad/scripts/common/reports.tcl +2 -2
  110. siliconcompiler/tools/openroad/scripts/common/screenshot.tcl +2 -2
  111. siliconcompiler/tools/openroad/scripts/common/write_images.tcl +28 -3
  112. siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +2 -2
  113. siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +4 -4
  114. siliconcompiler/tools/openroad/scripts/sc_show.tcl +7 -7
  115. siliconcompiler/tools/opensta/__init__.py +1 -1
  116. siliconcompiler/tools/opensta/scripts/sc_check_library.tcl +1 -1
  117. siliconcompiler/tools/opensta/scripts/sc_procs.tcl +16 -0
  118. siliconcompiler/tools/opensta/scripts/sc_report_libraries.tcl +1 -1
  119. siliconcompiler/tools/opensta/scripts/sc_timing.tcl +35 -7
  120. siliconcompiler/tools/opensta/timing.py +6 -2
  121. siliconcompiler/tools/slang/__init__.py +10 -10
  122. siliconcompiler/tools/surelog/parse.py +4 -4
  123. siliconcompiler/tools/sv2v/convert.py +20 -3
  124. siliconcompiler/tools/verilator/compile.py +2 -2
  125. siliconcompiler/tools/verilator/verilator.py +3 -3
  126. siliconcompiler/tools/vpr/place.py +1 -1
  127. siliconcompiler/tools/vpr/route.py +4 -4
  128. siliconcompiler/tools/vpr/screenshot.py +1 -1
  129. siliconcompiler/tools/vpr/show.py +5 -5
  130. siliconcompiler/tools/vpr/vpr.py +24 -24
  131. siliconcompiler/tools/xdm/convert.py +2 -2
  132. siliconcompiler/tools/xyce/simulate.py +1 -1
  133. siliconcompiler/tools/yosys/sc_synth_asic.tcl +104 -90
  134. siliconcompiler/tools/yosys/syn_asic.py +13 -4
  135. siliconcompiler/toolscripts/_tools.json +12 -7
  136. siliconcompiler/toolscripts/rhel8/install-chisel.sh +2 -0
  137. siliconcompiler/toolscripts/rhel8/install-icarus.sh +1 -0
  138. siliconcompiler/toolscripts/rhel8/install-klayout.sh +2 -0
  139. siliconcompiler/toolscripts/rhel8/install-magic.sh +1 -2
  140. siliconcompiler/toolscripts/rhel8/install-netgen.sh +1 -1
  141. siliconcompiler/toolscripts/rhel8/install-slang.sh +2 -0
  142. siliconcompiler/toolscripts/rhel8/install-surelog.sh +3 -1
  143. siliconcompiler/toolscripts/rhel8/install-sv2v.sh +1 -0
  144. siliconcompiler/toolscripts/rhel8/install-verible.sh +2 -0
  145. siliconcompiler/toolscripts/rhel8/install-verilator.sh +1 -0
  146. siliconcompiler/toolscripts/rhel8/install-xyce.sh +2 -0
  147. siliconcompiler/toolscripts/rhel9/install-chisel.sh +2 -0
  148. siliconcompiler/toolscripts/rhel9/install-ghdl.sh +1 -0
  149. siliconcompiler/toolscripts/rhel9/install-gtkwave.sh +1 -0
  150. siliconcompiler/toolscripts/rhel9/install-icarus.sh +1 -0
  151. siliconcompiler/toolscripts/rhel9/install-klayout.sh +2 -0
  152. siliconcompiler/toolscripts/rhel9/install-magic.sh +1 -2
  153. siliconcompiler/toolscripts/rhel9/install-netgen.sh +1 -1
  154. siliconcompiler/toolscripts/rhel9/install-openroad.sh +2 -0
  155. siliconcompiler/toolscripts/rhel9/install-opensta.sh +76 -0
  156. siliconcompiler/toolscripts/rhel9/install-slang.sh +3 -1
  157. siliconcompiler/toolscripts/rhel9/install-surelog.sh +2 -1
  158. siliconcompiler/toolscripts/rhel9/install-sv2v.sh +1 -0
  159. siliconcompiler/toolscripts/rhel9/install-verible.sh +2 -0
  160. siliconcompiler/toolscripts/rhel9/install-verilator.sh +1 -0
  161. siliconcompiler/toolscripts/rhel9/install-vpr.sh +2 -0
  162. siliconcompiler/toolscripts/rhel9/install-xdm.sh +2 -0
  163. siliconcompiler/toolscripts/rhel9/install-xyce.sh +2 -0
  164. siliconcompiler/toolscripts/rhel9/install-yosys-moosic.sh +2 -0
  165. siliconcompiler/toolscripts/rhel9/install-yosys-parmys.sh +2 -0
  166. siliconcompiler/toolscripts/rhel9/install-yosys-slang.sh +3 -1
  167. siliconcompiler/toolscripts/rhel9/install-yosys.sh +2 -0
  168. siliconcompiler/toolscripts/ubuntu20/install-bambu.sh +2 -0
  169. siliconcompiler/toolscripts/ubuntu20/install-bluespec.sh +2 -0
  170. siliconcompiler/toolscripts/ubuntu20/install-chisel.sh +2 -0
  171. siliconcompiler/toolscripts/ubuntu20/install-ghdl.sh +2 -0
  172. siliconcompiler/toolscripts/ubuntu20/install-gtkwave.sh +2 -0
  173. siliconcompiler/toolscripts/ubuntu20/install-icarus.sh +2 -0
  174. siliconcompiler/toolscripts/ubuntu20/install-icepack.sh +2 -0
  175. siliconcompiler/toolscripts/ubuntu20/install-klayout.sh +2 -0
  176. siliconcompiler/toolscripts/ubuntu20/install-magic.sh +2 -0
  177. siliconcompiler/toolscripts/ubuntu20/install-netgen.sh +2 -0
  178. siliconcompiler/toolscripts/ubuntu20/install-nextpnr.sh +1 -3
  179. siliconcompiler/toolscripts/ubuntu20/install-openroad.sh +2 -0
  180. siliconcompiler/toolscripts/ubuntu20/install-opensta.sh +72 -0
  181. siliconcompiler/toolscripts/ubuntu20/install-slang.sh +3 -1
  182. siliconcompiler/toolscripts/ubuntu20/install-slurm.sh +2 -0
  183. siliconcompiler/toolscripts/ubuntu20/install-surelog.sh +3 -1
  184. siliconcompiler/toolscripts/ubuntu20/install-sv2v.sh +1 -1
  185. siliconcompiler/toolscripts/ubuntu20/install-verible.sh +2 -0
  186. siliconcompiler/toolscripts/ubuntu20/install-verilator.sh +2 -0
  187. siliconcompiler/toolscripts/ubuntu20/install-xdm.sh +2 -0
  188. siliconcompiler/toolscripts/ubuntu20/install-xyce.sh +2 -0
  189. siliconcompiler/toolscripts/ubuntu20/install-yosys-moosic.sh +2 -0
  190. siliconcompiler/toolscripts/ubuntu20/install-yosys.sh +2 -0
  191. siliconcompiler/toolscripts/ubuntu22/install-bambu.sh +2 -0
  192. siliconcompiler/toolscripts/ubuntu22/install-bluespec.sh +2 -0
  193. siliconcompiler/toolscripts/ubuntu22/install-chisel.sh +2 -0
  194. siliconcompiler/toolscripts/ubuntu22/install-ghdl.sh +2 -0
  195. siliconcompiler/toolscripts/ubuntu22/install-gtkwave.sh +2 -0
  196. siliconcompiler/toolscripts/ubuntu22/install-icarus.sh +2 -0
  197. siliconcompiler/toolscripts/ubuntu22/install-icepack.sh +2 -0
  198. siliconcompiler/toolscripts/ubuntu22/install-klayout.sh +2 -0
  199. siliconcompiler/toolscripts/ubuntu22/install-magic.sh +2 -0
  200. siliconcompiler/toolscripts/ubuntu22/install-netgen.sh +2 -0
  201. siliconcompiler/toolscripts/ubuntu22/install-nextpnr.sh +1 -2
  202. siliconcompiler/toolscripts/ubuntu22/install-openroad.sh +2 -0
  203. siliconcompiler/toolscripts/ubuntu22/install-opensta.sh +72 -0
  204. siliconcompiler/toolscripts/ubuntu22/install-slang.sh +3 -1
  205. siliconcompiler/toolscripts/ubuntu22/install-slurm.sh +2 -0
  206. siliconcompiler/toolscripts/ubuntu22/install-surelog.sh +3 -1
  207. siliconcompiler/toolscripts/ubuntu22/install-sv2v.sh +1 -1
  208. siliconcompiler/toolscripts/ubuntu22/install-verible.sh +2 -0
  209. siliconcompiler/toolscripts/ubuntu22/install-verilator.sh +2 -0
  210. siliconcompiler/toolscripts/ubuntu22/install-vpr.sh +2 -2
  211. siliconcompiler/toolscripts/ubuntu22/install-xdm.sh +2 -0
  212. siliconcompiler/toolscripts/ubuntu22/install-xyce.sh +2 -0
  213. siliconcompiler/toolscripts/ubuntu22/install-yosys-moosic.sh +2 -0
  214. siliconcompiler/toolscripts/ubuntu22/install-yosys-parmys.sh +2 -0
  215. siliconcompiler/toolscripts/ubuntu22/install-yosys-slang.sh +3 -1
  216. siliconcompiler/toolscripts/ubuntu22/install-yosys.sh +2 -0
  217. siliconcompiler/toolscripts/ubuntu24/install-bambu.sh +2 -0
  218. siliconcompiler/toolscripts/ubuntu24/install-bluespec.sh +2 -0
  219. siliconcompiler/toolscripts/ubuntu24/install-chisel.sh +2 -0
  220. siliconcompiler/toolscripts/ubuntu24/install-ghdl.sh +2 -0
  221. siliconcompiler/toolscripts/ubuntu24/install-gtkwave.sh +2 -0
  222. siliconcompiler/toolscripts/ubuntu24/install-icarus.sh +2 -0
  223. siliconcompiler/toolscripts/ubuntu24/install-icepack.sh +2 -0
  224. siliconcompiler/toolscripts/ubuntu24/install-klayout.sh +2 -0
  225. siliconcompiler/toolscripts/ubuntu24/install-magic.sh +2 -0
  226. siliconcompiler/toolscripts/ubuntu24/install-netgen.sh +2 -0
  227. siliconcompiler/toolscripts/ubuntu24/install-nextpnr.sh +1 -3
  228. siliconcompiler/toolscripts/ubuntu24/install-openroad.sh +2 -0
  229. siliconcompiler/toolscripts/ubuntu24/install-opensta.sh +72 -0
  230. siliconcompiler/toolscripts/ubuntu24/install-slang.sh +3 -1
  231. siliconcompiler/toolscripts/ubuntu24/install-slurm.sh +2 -0
  232. siliconcompiler/toolscripts/ubuntu24/install-surelog.sh +3 -1
  233. siliconcompiler/toolscripts/ubuntu24/install-sv2v.sh +1 -1
  234. siliconcompiler/toolscripts/ubuntu24/install-verible.sh +2 -0
  235. siliconcompiler/toolscripts/ubuntu24/install-verilator.sh +2 -0
  236. siliconcompiler/toolscripts/ubuntu24/install-vpr.sh +2 -2
  237. siliconcompiler/toolscripts/ubuntu24/install-xdm.sh +2 -0
  238. siliconcompiler/toolscripts/ubuntu24/install-xyce.sh +2 -0
  239. siliconcompiler/toolscripts/ubuntu24/install-yosys-moosic.sh +2 -0
  240. siliconcompiler/toolscripts/ubuntu24/install-yosys-parmys.sh +2 -0
  241. siliconcompiler/toolscripts/ubuntu24/install-yosys-slang.sh +3 -1
  242. siliconcompiler/toolscripts/ubuntu24/install-yosys.sh +2 -0
  243. siliconcompiler/utils/__init__.py +8 -112
  244. siliconcompiler/utils/flowgraph.py +339 -0
  245. siliconcompiler/{issue.py → utils/issue.py} +7 -4
  246. siliconcompiler/utils/logging.py +86 -33
  247. {siliconcompiler-0.32.2.dist-info → siliconcompiler-0.33.0.dist-info}/METADATA +10 -8
  248. siliconcompiler-0.33.0.dist-info/RECORD +487 -0
  249. {siliconcompiler-0.32.2.dist-info → siliconcompiler-0.33.0.dist-info}/WHEEL +1 -1
  250. {siliconcompiler-0.32.2.dist-info → siliconcompiler-0.33.0.dist-info}/entry_points.txt +8 -8
  251. siliconcompiler/schema/schema_obj.py +0 -1936
  252. siliconcompiler/toolscripts/ubuntu20/install-vpr.sh +0 -27
  253. siliconcompiler/toolscripts/ubuntu20/install-yosys-parmys.sh +0 -59
  254. siliconcompiler-0.32.2.dist-info/RECORD +0 -464
  255. /siliconcompiler/{templates → data/templates}/__init__.py +0 -0
  256. /siliconcompiler/{templates → data/templates}/email/__init__.py +0 -0
  257. /siliconcompiler/{templates → data/templates}/email/general.j2 +0 -0
  258. /siliconcompiler/{templates → data/templates}/email/summary.j2 +0 -0
  259. /siliconcompiler/{templates → data/templates}/issue/README.txt +0 -0
  260. /siliconcompiler/{templates → data/templates}/issue/__init__.py +0 -0
  261. /siliconcompiler/{templates → data/templates}/issue/run.sh +0 -0
  262. /siliconcompiler/{templates → data/templates}/replay/replay.py.j2 +0 -0
  263. /siliconcompiler/{templates → data/templates}/replay/requirements.txt +0 -0
  264. /siliconcompiler/{templates → data/templates}/replay/setup.sh +0 -0
  265. /siliconcompiler/{templates → data/templates}/report/__init__.py +0 -0
  266. /siliconcompiler/{templates → data/templates}/report/bootstrap.min.css +0 -0
  267. /siliconcompiler/{templates → data/templates}/report/bootstrap.min.js +0 -0
  268. /siliconcompiler/{templates → data/templates}/report/bootstrap_LICENSE.md +0 -0
  269. /siliconcompiler/{templates → data/templates}/report/sc_report.j2 +0 -0
  270. /siliconcompiler/{templates → data/templates}/slurm/__init__.py +0 -0
  271. /siliconcompiler/{templates → data/templates}/slurm/run.sh +0 -0
  272. /siliconcompiler/{templates → data/templates}/tcl/__init__.py +0 -0
  273. /siliconcompiler/{templates → data/templates}/tcl/manifest.tcl.j2 +0 -0
  274. /siliconcompiler/report/dashboard/{utils → web/utils}/file_utils.py +0 -0
  275. /siliconcompiler/{units.py → utils/units.py} +0 -0
  276. {siliconcompiler-0.32.2.dist-info → siliconcompiler-0.33.0.dist-info}/licenses/LICENSE +0 -0
  277. {siliconcompiler-0.32.2.dist-info → siliconcompiler-0.33.0.dist-info}/top_level.txt +0 -0
@@ -1,117 +1,121 @@
1
- from siliconcompiler.schema.schema_cfg import scparam
2
- from siliconcompiler.schema import Schema
3
- from siliconcompiler.schema.utils import PerNode, Scope
1
+ from siliconcompiler.schema import BaseSchema
2
+ from siliconcompiler.schema import CommandLineSchema
3
+ from siliconcompiler.schema import EditableSchema
4
+ from siliconcompiler.schema import Parameter, Scope
4
5
 
5
6
 
6
7
  SCHEMA_VERSION = '0.0.2'
7
8
 
8
9
 
9
- def schema_cfg():
10
- # Basic schema setup
11
- cfg = {}
12
-
13
- scparam(cfg, ['schemaversion'],
14
- sctype='str',
15
- scope=Scope.GLOBAL,
16
- defvalue=SCHEMA_VERSION,
17
- require='all',
18
- shorthelp="Schema version number",
19
- lock=True,
20
- switch="-schemaversion <str>",
21
- example=["api: server.get('schemaversion')"],
22
- schelp="""SiliconCompiler server schema version number.""")
23
-
24
- scparam(cfg, ['option', 'port'],
25
- sctype='int',
26
- scope=Scope.GLOBAL,
27
- defvalue=8080,
28
- require='all',
29
- shorthelp="Port number to run the server on.",
30
- switch="-port <int>",
31
- example=["cli: -port 8000",
32
- "api: server.set('option', 'port', 8080)"],
33
- schelp="""Port number to run the server on.""")
34
-
35
- scparam(cfg, ['option', 'cluster'],
36
- sctype='enum',
37
- enum=['local', 'slurm'],
38
- scope=Scope.GLOBAL,
39
- defvalue='local',
40
- require='all',
41
- shorthelp="Type of compute cluster to use.",
42
- switch="-cluster <str>",
43
- example=["cli: -cluster slurm",
44
- "api: server.set('option', 'clister', 'slurm')"],
45
- schelp="""Type of compute cluster to use.""")
46
-
47
- scparam(cfg, ['option', 'nfsmount'],
48
- sctype='dir',
49
- scope=Scope.GLOBAL,
50
- defvalue='/nfs/sc_compute',
51
- require='all',
52
- shorthelp="Directory of mounted shared NFS storage.",
53
- switch="-nfsmount <dir>",
54
- example=["cli: -nfsmount ~/sc_server",
55
- "api: server.set('option', 'server', '~/sc_server')"],
56
- schelp="""Directory of mounted shared NFS storage.""")
57
-
58
- scparam(cfg, ['option', 'auth'],
59
- sctype='bool',
60
- scope=Scope.GLOBAL,
61
- defvalue=False,
62
- require='all',
63
- shorthelp="Flag determining whether to enable authenticated and encrypted jobs.",
64
- switch="-auth <bool>",
65
- example=["cli: -auth true",
66
- "api: server.set('option', 'auth', True)"],
67
- schelp="""Flag determining whether to enable authenticated and encrypted jobs.""")
68
-
69
- scparam(cfg, ['option', 'cfg'],
70
- sctype='[file]',
71
- scope=Scope.JOB,
72
- shorthelp="Configuration manifest",
73
- switch="-cfg <file>",
74
- example=["cli: -cfg mypdk.json",
75
- "api: chip.set('option', 'cfg', 'mypdk.json')"],
76
- schelp="""
77
- List of filepaths to JSON formatted schema configuration
78
- manifests. The files are read in automatically when using the
79
- command line application. In Python programs, JSON manifests
80
- can be merged into the current working manifest using the
81
- read_manifest() method.""")
82
-
83
- scparam(cfg, ['option', 'loglevel'],
84
- sctype='enum',
85
- enum=["info", "warning", "error", "critical", "debug"],
86
- pernode=PerNode.OPTIONAL,
87
- scope=Scope.JOB,
88
- defvalue='info',
89
- shorthelp="Logging level",
90
- switch="-loglevel <str>",
91
- example=[
92
- "cli: -loglevel info",
93
- "api: server.set('option', 'loglevel', 'info')"],
94
- schelp="""
95
- Provides explicit control over the level of debug logging printed.""")
96
-
97
- scparam(cfg, ['option', 'checkinterval'],
98
- sctype='int',
99
- defvalue=30,
100
- shorthelp="Interval for client",
101
- switch="-checkinterval <int>",
102
- example=["cli: -checkinterval 10",
103
- "api: chip.set('option', 'checkinterval', 10)"],
104
- schelp="""
105
- Interval between checks to announce to clients""")
106
-
107
- return cfg
108
-
109
-
110
- class ServerSchema(Schema):
111
- def __init__(self, cfg=None, manifest=None, logger=None):
112
- super().__init__(cfg=cfg,
113
- manifest=manifest,
114
- logger=logger)
115
-
116
- def _init_schema_cfg(self):
117
- return schema_cfg()
10
+ class ServerSchema(BaseSchema, CommandLineSchema):
11
+ def __init__(self):
12
+ super().__init__()
13
+
14
+ schema = EditableSchema(self)
15
+
16
+ schema.insert(
17
+ 'schemaversion',
18
+ Parameter(
19
+ 'str',
20
+ scope=Scope.GLOBAL,
21
+ defvalue=SCHEMA_VERSION,
22
+ require='all',
23
+ shorthelp="Schema version number",
24
+ lock=True,
25
+ switch="-schemaversion <str>",
26
+ example=["api: server.get('schemaversion')"],
27
+ help="""SiliconCompiler server schema version number."""))
28
+
29
+ schema.insert(
30
+ 'option', 'port',
31
+ Parameter(
32
+ 'int',
33
+ scope=Scope.GLOBAL,
34
+ defvalue=8080,
35
+ require='all',
36
+ shorthelp="Port number to run the server on.",
37
+ switch="-port <int>",
38
+ example=["cli: -port 8000",
39
+ "api: server.set('option', 'port', 8080)"],
40
+ help="""Port number to run the server on."""))
41
+
42
+ schema.insert(
43
+ 'option', 'cluster',
44
+ Parameter(
45
+ '<local,slurm>',
46
+ scope=Scope.GLOBAL,
47
+ defvalue='local',
48
+ require='all',
49
+ shorthelp="Type of compute cluster to use.",
50
+ switch="-cluster <str>",
51
+ example=["cli: -cluster slurm",
52
+ "api: server.set('option', 'clister', 'slurm')"],
53
+ help="""Type of compute cluster to use."""))
54
+
55
+ schema.insert(
56
+ 'option', 'nfsmount',
57
+ Parameter(
58
+ 'dir',
59
+ scope=Scope.GLOBAL,
60
+ defvalue='/nfs/sc_compute',
61
+ require='all',
62
+ shorthelp="Directory of mounted shared NFS storage.",
63
+ switch="-nfsmount <dir>",
64
+ example=["cli: -nfsmount ~/sc_server",
65
+ "api: server.set('option', 'server', '~/sc_server')"],
66
+ help="""Directory of mounted shared NFS storage."""))
67
+
68
+ schema.insert(
69
+ 'option', 'auth',
70
+ Parameter(
71
+ 'bool',
72
+ scope=Scope.GLOBAL,
73
+ defvalue=False,
74
+ require='all',
75
+ shorthelp="Flag determining whether to enable authenticated and encrypted jobs.",
76
+ switch="-auth <bool>",
77
+ example=["cli: -auth true",
78
+ "api: server.set('option', 'auth', True)"],
79
+ help="""Flag determining whether to enable authenticated and encrypted jobs."""))
80
+
81
+ schema.insert(
82
+ 'option', 'cfg',
83
+ Parameter(
84
+ '[file]',
85
+ scope=Scope.JOB,
86
+ shorthelp="Configuration manifest",
87
+ switch="-cfg <file>",
88
+ example=["cli: -cfg mypdk.json",
89
+ "api: chip.set('option', 'cfg', 'mypdk.json')"],
90
+ help="""
91
+ List of filepaths to JSON formatted schema configuration
92
+ manifests. The files are read in automatically when using the
93
+ command line application. In Python programs, JSON manifests
94
+ can be merged into the current working manifest using the
95
+ read_manifest() method."""))
96
+
97
+ schema.insert(
98
+ 'option', 'loglevel',
99
+ Parameter(
100
+ '<info,warning,error,critical,debug>',
101
+ scope=Scope.JOB,
102
+ defvalue='info',
103
+ shorthelp="Logging level",
104
+ switch="-loglevel <str>",
105
+ example=[
106
+ "cli: -loglevel info",
107
+ "api: server.set('option', 'loglevel', 'info')"],
108
+ help="""
109
+ Provides explicit control over the level of debug logging printed."""))
110
+
111
+ schema.insert(
112
+ 'option', 'checkinterval',
113
+ Parameter(
114
+ 'int',
115
+ defvalue=30,
116
+ shorthelp="Interval for client",
117
+ switch="-checkinterval <int>",
118
+ example=["cli: -checkinterval 10",
119
+ "api: chip.set('option', 'checkinterval', 10)"],
120
+ help="""
121
+ Interval between checks to announce to clients"""))
@@ -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.flowgraph import nodes_to_execute
24
+ from siliconcompiler.utils.flowgraph import nodes_to_execute
25
25
 
26
26
 
27
27
  # Compile validation code for API request bodies.
@@ -78,7 +78,7 @@ class Server:
78
78
  self.logger.addHandler(handler)
79
79
  self.logger.setLevel(schema_utils.translate_loglevel(loglevel))
80
80
 
81
- self.schema = ServerSchema(logger=self.logger)
81
+ self.schema = ServerSchema()
82
82
 
83
83
  # Set up a dictionary to track running jobs.
84
84
  self.sc_jobs = {}
@@ -146,7 +146,6 @@ class Server:
146
146
  progname=progname,
147
147
  description=description,
148
148
  switchlist=switchlist,
149
- input_map=None,
150
149
  additional_args=additional_args,
151
150
  version=Server.__version__,
152
151
  print_banner=print_banner,
@@ -508,5 +507,4 @@ class Server:
508
507
  self.schema.set(*keypath, value, field=field, clobber=clobber)
509
508
 
510
509
  def write_configuration(self, filepath):
511
- with open(filepath, 'w') as f:
512
- self.schema.write_json(f)
510
+ self.schema.write_manifest(filepath)
@@ -1,7 +1,8 @@
1
1
  from .summary_image import _generate_summary_image, _open_summary_image
2
2
  from .html_report import _generate_html_report, _open_html_report
3
3
  from .summary_table import _show_summary_table
4
- from .dashboard import Dashboard
4
+ from .dashboard.web import WebDashboard
5
+ # from .dashboard import Dashboard
5
6
 
6
7
  __all__ = [
7
8
  "_generate_summary_image",
@@ -9,5 +10,5 @@ __all__ = [
9
10
  "_generate_html_report",
10
11
  "_open_html_report",
11
12
  "_show_summary_table",
12
- "Dashboard"
13
+ "WebDashboard"
13
14
  ]
@@ -1,190 +1,81 @@
1
- import os
2
- import time
3
- import tempfile
4
- import json
1
+ from abc import ABC, abstractmethod
2
+ from enum import Enum
5
3
 
6
- import multiprocessing
7
- import subprocess
8
- import atexit
9
- import shutil
10
- import fasteners
11
- import signal
12
- import socketserver
13
4
 
14
- from siliconcompiler.report.dashboard import utils
5
+ class DashboardType(Enum):
6
+ WEB = 'web'
7
+ CLI = 'cli'
15
8
 
16
- try:
17
- from streamlit.web import bootstrap
18
- from streamlit import config as _config
19
- except ModuleNotFoundError:
20
- bootstrap = None
21
- _config = None
22
9
 
10
+ class AbstractDashboard(ABC):
11
+ """
12
+ Abstract base class defining the interface for dashboard implementations.
13
+ Any concrete dashboard implementation should inherit from this class and
14
+ implement all abstract methods.
15
+ """
23
16
 
24
- class Dashboard():
25
- __port = 8501
17
+ @abstractmethod
18
+ def __init__(self, chip):
19
+ """
20
+ Initialize the dashboard.
26
21
 
27
- @staticmethod
28
- def __signal_handler(signal, frame):
29
- # used to avoid issues during shutdown
30
- pass
31
-
32
- def __init__(self, chip, port=None, graph_chips=None):
33
- if not bootstrap:
34
- raise NotImplementedError('streamlit is not available')
35
-
36
- if not port:
37
- port = Dashboard.get_next_port()
38
- if not port:
39
- port = Dashboard.__port
40
-
41
- self.__dashboard = None
42
- self.__chip = chip
43
- self.__directory = tempfile.mkdtemp(prefix='sc_dashboard_',
44
- suffix=f'_{self.__chip.design}')
45
- self.__manifest = os.path.join(self.__directory, 'manifest.json')
46
- self.__manifest_lock = os.path.join(self.__directory, 'manifest.lock')
47
- self.__port = port
48
- dirname = os.path.dirname(__file__)
49
- self.__streamlit_file = os.path.join(dirname, 'viewer.py')
50
-
51
- self.__streamlit_args = [
52
- ("browser.gatherUsageStats", False),
53
- ("browser.serverPort", self.__port),
54
- ("logger.level", 'error'),
55
- ("runner.fastReruns", True),
56
- ("server.port", self.__port),
57
- ("client.toolbarMode", "viewer")
58
- ]
59
-
60
- # pass in a json object called __graph_chips
61
- # the key is the chip_name and value is the filepath
62
- # if another argument is passed
63
-
64
- # use of list is to preserve order
65
- self.__graph_chips = []
66
- graph_chips_config = []
67
- if graph_chips:
68
- for chip_object_and_name in graph_chips:
69
- chip_file_path = \
70
- os.path.join(self.__directory,
71
- f"{chip_object_and_name['name']}.json")
72
- self.__graph_chips.append({
73
- 'chip': chip_object_and_name['chip'],
74
- 'name': chip_file_path
75
- })
76
- graph_chips_config.append({
77
- "path": chip_file_path,
78
- "cwd": utils.get_chip_cwd(
79
- chip_object_and_name['chip'],
80
- chip_object_and_name['cfg_path'])
81
- })
82
-
83
- self.__config = {
84
- "manifest": self.__manifest,
85
- "lock": self.__manifest_lock,
86
- "graph_chips": graph_chips_config
87
- }
88
-
89
- self.__sleep_time = 0.5
90
- self.__signal_handler = None
91
-
92
- self.__lock = fasteners.InterProcessLock(self.__manifest_lock)
93
-
94
- atexit.register(self.__cleanup)
22
+ Args:
23
+ chip: The chip object to display in the dashboard
24
+ """
25
+ self._chip = chip
95
26
 
27
+ @abstractmethod
96
28
  def open_dashboard(self):
97
- with open(self.__get_config_file(), 'w') as f:
98
- json.dump(self.__config, f, indent=4)
99
-
100
- self.update_manifest()
101
-
102
- self.update_graph_manifests()
103
-
104
- self.__dashboard = multiprocessing.Process(
105
- target=self._run_streamlit_bootstrap)
106
-
107
- self.__signal_handler = signal.signal(signal.SIGINT, Dashboard.__signal_handler)
108
-
109
- self.__dashboard.start()
110
-
111
- def update_manifest(self):
112
- if not self.__manifest:
113
- return
29
+ """
30
+ Open and start the dashboard service.
31
+ """
32
+ pass
114
33
 
115
- new_file = f"{self.__manifest}.new.json"
116
- self.__chip.write_manifest(new_file)
34
+ @abstractmethod
35
+ def update_manifest(self, payload=None):
36
+ """
37
+ Update the manifest file with the latest chip information.
117
38
 
118
- with self.__lock:
119
- shutil.move(new_file, self.__manifest)
39
+ Args:
40
+ payload (dict): Dictionary of metadata to pass along to dashboard.
41
+ {"starttimes" {<node>: time, ...}}
42
+ """
43
+ pass
120
44
 
45
+ @abstractmethod
121
46
  def update_graph_manifests(self):
122
- for chip_object_and_name in self.__graph_chips:
123
- chip = chip_object_and_name['chip']
124
- file_path = chip_object_and_name['name']
125
- chip.write_manifest(file_path)
126
-
127
- def __get_config_file(self):
128
- return os.path.join(self.__directory, 'config.json')
47
+ """
48
+ Update the manifest files for all graph chips.
49
+ """
50
+ pass
129
51
 
52
+ @abstractmethod
130
53
  def is_running(self):
131
- if self.__dashboard is None:
132
- return False
54
+ """
55
+ Check if the dashboard is currently running.
133
56
 
134
- if self.__dashboard.is_alive():
135
- return True
57
+ Returns:
58
+ bool: True if the dashboard is running, False otherwise
59
+ """
60
+ pass
136
61
 
137
- self.__dashboard = None
138
- self.__manifest = None
139
- return False
62
+ @abstractmethod
63
+ def end_of_run(self):
64
+ """
65
+ Announce that a run has completed
66
+ """
67
+ pass
140
68
 
69
+ @abstractmethod
141
70
  def stop(self):
142
- if not self.is_running():
143
- return
144
-
145
- while self.__dashboard.is_alive():
146
- self.__dashboard.terminate()
147
- self._sleep()
148
-
149
- if self.__signal_handler:
150
- signal.signal(signal.SIGINT, self.__signal_handler)
151
-
152
- self.__dashboard = None
153
- self.__manifest = None
154
- self.__signal_handler = None
71
+ """
72
+ Stop the dashboard service if it's running.
73
+ """
74
+ pass
155
75
 
76
+ @abstractmethod
156
77
  def wait(self):
157
- self.__dashboard.join()
158
-
159
- def _sleep(self):
160
- time.sleep(self.__sleep_time)
161
-
162
- def _run_streamlit_bootstrap(self):
163
- for config, val in self.__streamlit_args:
164
- _config.set_option(config, val)
165
-
166
- bootstrap.run(self.__streamlit_file,
167
- False,
168
- [self.__get_config_file()],
169
- flag_options={})
170
-
171
- def __run_streamlit_subproc(self):
172
- cmd = ['streamlit', 'run',
173
- self.__streamlit_file, self.__get_config_file()]
174
- for config, val in self.__streamlit_args:
175
- cmd.append(f'--{config}')
176
- cmd.append(val)
177
-
178
- subprocess.Popen(cmd)
179
-
180
- def __cleanup(self):
181
- self.stop()
182
-
183
- if os.path.exists(self.__directory):
184
- shutil.rmtree(self.__directory)
185
-
186
- @staticmethod
187
- def get_next_port():
188
- with socketserver.TCPServer(("localhost", 0), None) as s:
189
- return s.server_address[1]
190
- return None
78
+ """
79
+ Wait for the dashboard service to terminate.
80
+ """
81
+ pass
@@ -0,0 +1,79 @@
1
+ from siliconcompiler.report.dashboard import AbstractDashboard
2
+ from siliconcompiler.report.dashboard.cli.board import Board
3
+
4
+
5
+ class CliDashboard(AbstractDashboard):
6
+
7
+ def __init__(self, chip):
8
+ super().__init__(chip)
9
+
10
+ self._dashboard = Board()
11
+
12
+ self.__logger_console = None
13
+
14
+ self._logger = chip.logger
15
+
16
+ def set_logger(self, logger):
17
+ """
18
+ Sets the logger for the dashboard.
19
+
20
+ Args:
21
+ logger (logging.Logger): The logger to set.
22
+ """
23
+ self._logger = logger
24
+ if self._logger and self._dashboard._active:
25
+ # Hijack the console
26
+ self._logger.removeHandler(self._chip.logger._console)
27
+ 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._chip._init_logger_formats()
31
+
32
+ def open_dashboard(self):
33
+ """Starts the dashboard rendering thread if it is not already running."""
34
+
35
+ self.set_logger(self._logger)
36
+
37
+ self._dashboard.open_dashboard()
38
+
39
+ def update_manifest(self, payload=None):
40
+ """
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.
43
+ """
44
+ starttimes = None
45
+ if payload and "starttimes" in payload:
46
+ starttimes = payload["starttimes"]
47
+ self._dashboard.update_manifest(self._chip, starttimes=starttimes)
48
+
49
+ def update_graph_manifests(self):
50
+ """Placeholder method for updating graph manifests. Currently not implemented."""
51
+ pass
52
+
53
+ def is_running(self):
54
+ """Returns True to indicate that the dashboard is running."""
55
+ return self._dashboard.is_running()
56
+
57
+ def end_of_run(self):
58
+ """
59
+ Stops the dashboard rendering thread and ensures all rendering operations are completed.
60
+ """
61
+ self._dashboard.end_of_run(self._chip)
62
+
63
+ def stop(self):
64
+ """
65
+ Stops the dashboard rendering thread and ensures all rendering operations are completed.
66
+ """
67
+ self._dashboard.end_of_run(self._chip)
68
+
69
+ # Restore logger
70
+ if self.__logger_console:
71
+ self._logger.removeHandler(self._dashboard._log_handler)
72
+ self._chip.logger._console = self.__logger_console
73
+ self._logger.addHandler(self.__logger_console)
74
+ self._chip._init_logger_formats()
75
+ self.__logger_console = None
76
+
77
+ def wait(self):
78
+ """Waits for the dashboard rendering thread to finish."""
79
+ self._dashboard.wait()