siliconcompiler 0.26.5__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 (251) hide show
  1. siliconcompiler/__init__.py +24 -0
  2. siliconcompiler/__main__.py +12 -0
  3. siliconcompiler/_common.py +49 -0
  4. siliconcompiler/_metadata.py +36 -0
  5. siliconcompiler/apps/__init__.py +0 -0
  6. siliconcompiler/apps/_common.py +76 -0
  7. siliconcompiler/apps/sc.py +92 -0
  8. siliconcompiler/apps/sc_dashboard.py +94 -0
  9. siliconcompiler/apps/sc_issue.py +178 -0
  10. siliconcompiler/apps/sc_remote.py +199 -0
  11. siliconcompiler/apps/sc_server.py +39 -0
  12. siliconcompiler/apps/sc_show.py +142 -0
  13. siliconcompiler/apps/smake.py +232 -0
  14. siliconcompiler/checklists/__init__.py +0 -0
  15. siliconcompiler/checklists/oh_tapeout.py +41 -0
  16. siliconcompiler/core.py +3221 -0
  17. siliconcompiler/data/RobotoMono/LICENSE.txt +202 -0
  18. siliconcompiler/data/RobotoMono/RobotoMono-Regular.ttf +0 -0
  19. siliconcompiler/data/heartbeat.v +18 -0
  20. siliconcompiler/data/logo.png +0 -0
  21. siliconcompiler/flowgraph.py +570 -0
  22. siliconcompiler/flows/__init__.py +0 -0
  23. siliconcompiler/flows/_common.py +67 -0
  24. siliconcompiler/flows/asicflow.py +180 -0
  25. siliconcompiler/flows/asictopflow.py +38 -0
  26. siliconcompiler/flows/dvflow.py +86 -0
  27. siliconcompiler/flows/fpgaflow.py +202 -0
  28. siliconcompiler/flows/generate_openroad_rcx.py +66 -0
  29. siliconcompiler/flows/lintflow.py +35 -0
  30. siliconcompiler/flows/screenshotflow.py +51 -0
  31. siliconcompiler/flows/showflow.py +59 -0
  32. siliconcompiler/flows/signoffflow.py +53 -0
  33. siliconcompiler/flows/synflow.py +128 -0
  34. siliconcompiler/fpgas/__init__.py +0 -0
  35. siliconcompiler/fpgas/lattice_ice40.py +42 -0
  36. siliconcompiler/fpgas/vpr_example.py +109 -0
  37. siliconcompiler/issue.py +300 -0
  38. siliconcompiler/libs/__init__.py +0 -0
  39. siliconcompiler/libs/asap7sc7p5t.py +8 -0
  40. siliconcompiler/libs/gf180mcu.py +8 -0
  41. siliconcompiler/libs/nangate45.py +8 -0
  42. siliconcompiler/libs/sky130hd.py +8 -0
  43. siliconcompiler/libs/sky130io.py +8 -0
  44. siliconcompiler/package.py +412 -0
  45. siliconcompiler/pdks/__init__.py +0 -0
  46. siliconcompiler/pdks/asap7.py +8 -0
  47. siliconcompiler/pdks/freepdk45.py +8 -0
  48. siliconcompiler/pdks/gf180.py +8 -0
  49. siliconcompiler/pdks/skywater130.py +8 -0
  50. siliconcompiler/remote/__init__.py +36 -0
  51. siliconcompiler/remote/client.py +891 -0
  52. siliconcompiler/remote/schema.py +106 -0
  53. siliconcompiler/remote/server.py +507 -0
  54. siliconcompiler/remote/server_schema/requests/cancel_job.json +51 -0
  55. siliconcompiler/remote/server_schema/requests/check_progress.json +61 -0
  56. siliconcompiler/remote/server_schema/requests/check_server.json +38 -0
  57. siliconcompiler/remote/server_schema/requests/delete_job.json +51 -0
  58. siliconcompiler/remote/server_schema/requests/get_results.json +48 -0
  59. siliconcompiler/remote/server_schema/requests/remote_run.json +40 -0
  60. siliconcompiler/remote/server_schema/responses/cancel_job.json +18 -0
  61. siliconcompiler/remote/server_schema/responses/check_progress.json +30 -0
  62. siliconcompiler/remote/server_schema/responses/check_server.json +32 -0
  63. siliconcompiler/remote/server_schema/responses/delete_job.json +18 -0
  64. siliconcompiler/remote/server_schema/responses/get_results.json +21 -0
  65. siliconcompiler/remote/server_schema/responses/remote_run.json +25 -0
  66. siliconcompiler/report/__init__.py +13 -0
  67. siliconcompiler/report/html_report.py +74 -0
  68. siliconcompiler/report/report.py +355 -0
  69. siliconcompiler/report/streamlit_report.py +137 -0
  70. siliconcompiler/report/streamlit_viewer.py +944 -0
  71. siliconcompiler/report/summary_image.py +117 -0
  72. siliconcompiler/report/summary_table.py +105 -0
  73. siliconcompiler/report/utils.py +163 -0
  74. siliconcompiler/scheduler/__init__.py +2092 -0
  75. siliconcompiler/scheduler/docker_runner.py +253 -0
  76. siliconcompiler/scheduler/run_node.py +138 -0
  77. siliconcompiler/scheduler/send_messages.py +178 -0
  78. siliconcompiler/scheduler/slurm.py +208 -0
  79. siliconcompiler/scheduler/validation/email_credentials.json +54 -0
  80. siliconcompiler/schema/__init__.py +7 -0
  81. siliconcompiler/schema/schema_cfg.py +4014 -0
  82. siliconcompiler/schema/schema_obj.py +1841 -0
  83. siliconcompiler/schema/utils.py +93 -0
  84. siliconcompiler/sphinx_ext/__init__.py +0 -0
  85. siliconcompiler/sphinx_ext/dynamicgen.py +1006 -0
  86. siliconcompiler/sphinx_ext/schemagen.py +221 -0
  87. siliconcompiler/sphinx_ext/utils.py +166 -0
  88. siliconcompiler/targets/__init__.py +0 -0
  89. siliconcompiler/targets/asap7_demo.py +68 -0
  90. siliconcompiler/targets/asic_demo.py +38 -0
  91. siliconcompiler/targets/fpgaflow_demo.py +47 -0
  92. siliconcompiler/targets/freepdk45_demo.py +59 -0
  93. siliconcompiler/targets/gf180_demo.py +77 -0
  94. siliconcompiler/targets/skywater130_demo.py +70 -0
  95. siliconcompiler/templates/email/general.j2 +66 -0
  96. siliconcompiler/templates/email/summary.j2 +43 -0
  97. siliconcompiler/templates/issue/README.txt +26 -0
  98. siliconcompiler/templates/issue/run.sh +6 -0
  99. siliconcompiler/templates/report/bootstrap.min.css +7 -0
  100. siliconcompiler/templates/report/bootstrap.min.js +7 -0
  101. siliconcompiler/templates/report/bootstrap_LICENSE.md +24 -0
  102. siliconcompiler/templates/report/sc_report.j2 +427 -0
  103. siliconcompiler/templates/slurm/run.sh +9 -0
  104. siliconcompiler/templates/tcl/manifest.tcl.j2 +137 -0
  105. siliconcompiler/tools/__init__.py +0 -0
  106. siliconcompiler/tools/_common/__init__.py +432 -0
  107. siliconcompiler/tools/_common/asic.py +115 -0
  108. siliconcompiler/tools/_common/sdc/sc_constraints.sdc +76 -0
  109. siliconcompiler/tools/_common/tcl/sc_pin_constraints.tcl +63 -0
  110. siliconcompiler/tools/bambu/bambu.py +32 -0
  111. siliconcompiler/tools/bambu/convert.py +77 -0
  112. siliconcompiler/tools/bluespec/bluespec.py +40 -0
  113. siliconcompiler/tools/bluespec/convert.py +103 -0
  114. siliconcompiler/tools/builtin/_common.py +155 -0
  115. siliconcompiler/tools/builtin/builtin.py +26 -0
  116. siliconcompiler/tools/builtin/concatenate.py +85 -0
  117. siliconcompiler/tools/builtin/join.py +27 -0
  118. siliconcompiler/tools/builtin/maximum.py +46 -0
  119. siliconcompiler/tools/builtin/minimum.py +57 -0
  120. siliconcompiler/tools/builtin/mux.py +70 -0
  121. siliconcompiler/tools/builtin/nop.py +38 -0
  122. siliconcompiler/tools/builtin/verify.py +83 -0
  123. siliconcompiler/tools/chisel/SCDriver.scala +10 -0
  124. siliconcompiler/tools/chisel/build.sbt +27 -0
  125. siliconcompiler/tools/chisel/chisel.py +37 -0
  126. siliconcompiler/tools/chisel/convert.py +140 -0
  127. siliconcompiler/tools/execute/exec_input.py +41 -0
  128. siliconcompiler/tools/execute/execute.py +17 -0
  129. siliconcompiler/tools/genfasm/bitstream.py +61 -0
  130. siliconcompiler/tools/genfasm/genfasm.py +40 -0
  131. siliconcompiler/tools/ghdl/convert.py +87 -0
  132. siliconcompiler/tools/ghdl/ghdl.py +41 -0
  133. siliconcompiler/tools/icarus/compile.py +87 -0
  134. siliconcompiler/tools/icarus/icarus.py +36 -0
  135. siliconcompiler/tools/icepack/bitstream.py +20 -0
  136. siliconcompiler/tools/icepack/icepack.py +43 -0
  137. siliconcompiler/tools/klayout/export.py +117 -0
  138. siliconcompiler/tools/klayout/klayout.py +119 -0
  139. siliconcompiler/tools/klayout/klayout_export.py +205 -0
  140. siliconcompiler/tools/klayout/klayout_operations.py +363 -0
  141. siliconcompiler/tools/klayout/klayout_show.py +242 -0
  142. siliconcompiler/tools/klayout/klayout_utils.py +176 -0
  143. siliconcompiler/tools/klayout/operations.py +194 -0
  144. siliconcompiler/tools/klayout/screenshot.py +98 -0
  145. siliconcompiler/tools/klayout/show.py +101 -0
  146. siliconcompiler/tools/magic/drc.py +49 -0
  147. siliconcompiler/tools/magic/extspice.py +19 -0
  148. siliconcompiler/tools/magic/magic.py +85 -0
  149. siliconcompiler/tools/magic/sc_drc.tcl +96 -0
  150. siliconcompiler/tools/magic/sc_extspice.tcl +54 -0
  151. siliconcompiler/tools/magic/sc_magic.tcl +47 -0
  152. siliconcompiler/tools/montage/montage.py +30 -0
  153. siliconcompiler/tools/montage/tile.py +66 -0
  154. siliconcompiler/tools/netgen/count_lvs.py +132 -0
  155. siliconcompiler/tools/netgen/lvs.py +90 -0
  156. siliconcompiler/tools/netgen/netgen.py +36 -0
  157. siliconcompiler/tools/netgen/sc_lvs.tcl +46 -0
  158. siliconcompiler/tools/nextpnr/apr.py +24 -0
  159. siliconcompiler/tools/nextpnr/nextpnr.py +59 -0
  160. siliconcompiler/tools/openfpgaloader/openfpgaloader.py +39 -0
  161. siliconcompiler/tools/openroad/__init__.py +0 -0
  162. siliconcompiler/tools/openroad/cts.py +45 -0
  163. siliconcompiler/tools/openroad/dfm.py +66 -0
  164. siliconcompiler/tools/openroad/export.py +131 -0
  165. siliconcompiler/tools/openroad/floorplan.py +70 -0
  166. siliconcompiler/tools/openroad/openroad.py +977 -0
  167. siliconcompiler/tools/openroad/physyn.py +27 -0
  168. siliconcompiler/tools/openroad/place.py +41 -0
  169. siliconcompiler/tools/openroad/rcx_bench.py +95 -0
  170. siliconcompiler/tools/openroad/rcx_extract.py +34 -0
  171. siliconcompiler/tools/openroad/route.py +45 -0
  172. siliconcompiler/tools/openroad/screenshot.py +60 -0
  173. siliconcompiler/tools/openroad/scripts/sc_apr.tcl +499 -0
  174. siliconcompiler/tools/openroad/scripts/sc_cts.tcl +64 -0
  175. siliconcompiler/tools/openroad/scripts/sc_dfm.tcl +20 -0
  176. siliconcompiler/tools/openroad/scripts/sc_export.tcl +98 -0
  177. siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +413 -0
  178. siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +158 -0
  179. siliconcompiler/tools/openroad/scripts/sc_physyn.tcl +7 -0
  180. siliconcompiler/tools/openroad/scripts/sc_place.tcl +84 -0
  181. siliconcompiler/tools/openroad/scripts/sc_procs.tcl +423 -0
  182. siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +63 -0
  183. siliconcompiler/tools/openroad/scripts/sc_rcx_bench.tcl +20 -0
  184. siliconcompiler/tools/openroad/scripts/sc_rcx_extract.tcl +12 -0
  185. siliconcompiler/tools/openroad/scripts/sc_route.tcl +133 -0
  186. siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +21 -0
  187. siliconcompiler/tools/openroad/scripts/sc_write.tcl +5 -0
  188. siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +361 -0
  189. siliconcompiler/tools/openroad/show.py +94 -0
  190. siliconcompiler/tools/openroad/templates/pex.tcl +8 -0
  191. siliconcompiler/tools/opensta/__init__.py +101 -0
  192. siliconcompiler/tools/opensta/report_libraries.py +28 -0
  193. siliconcompiler/tools/opensta/scripts/sc_procs.tcl +47 -0
  194. siliconcompiler/tools/opensta/scripts/sc_report_libraries.tcl +74 -0
  195. siliconcompiler/tools/opensta/scripts/sc_timing.tcl +268 -0
  196. siliconcompiler/tools/opensta/timing.py +214 -0
  197. siliconcompiler/tools/slang/__init__.py +49 -0
  198. siliconcompiler/tools/slang/lint.py +101 -0
  199. siliconcompiler/tools/surelog/__init__.py +123 -0
  200. siliconcompiler/tools/surelog/parse.py +183 -0
  201. siliconcompiler/tools/surelog/templates/output.v +7 -0
  202. siliconcompiler/tools/sv2v/convert.py +46 -0
  203. siliconcompiler/tools/sv2v/sv2v.py +37 -0
  204. siliconcompiler/tools/template/template.py +125 -0
  205. siliconcompiler/tools/verilator/compile.py +139 -0
  206. siliconcompiler/tools/verilator/lint.py +19 -0
  207. siliconcompiler/tools/verilator/parse.py +27 -0
  208. siliconcompiler/tools/verilator/verilator.py +172 -0
  209. siliconcompiler/tools/vivado/__init__.py +7 -0
  210. siliconcompiler/tools/vivado/bitstream.py +21 -0
  211. siliconcompiler/tools/vivado/place.py +21 -0
  212. siliconcompiler/tools/vivado/route.py +21 -0
  213. siliconcompiler/tools/vivado/scripts/sc_bitstream.tcl +6 -0
  214. siliconcompiler/tools/vivado/scripts/sc_place.tcl +2 -0
  215. siliconcompiler/tools/vivado/scripts/sc_route.tcl +4 -0
  216. siliconcompiler/tools/vivado/scripts/sc_run.tcl +45 -0
  217. siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +25 -0
  218. siliconcompiler/tools/vivado/syn_fpga.py +20 -0
  219. siliconcompiler/tools/vivado/vivado.py +147 -0
  220. siliconcompiler/tools/vpr/_json_constraint.py +63 -0
  221. siliconcompiler/tools/vpr/_xml_constraint.py +109 -0
  222. siliconcompiler/tools/vpr/place.py +137 -0
  223. siliconcompiler/tools/vpr/route.py +124 -0
  224. siliconcompiler/tools/vpr/screenshot.py +54 -0
  225. siliconcompiler/tools/vpr/show.py +88 -0
  226. siliconcompiler/tools/vpr/vpr.py +357 -0
  227. siliconcompiler/tools/xyce/xyce.py +36 -0
  228. siliconcompiler/tools/yosys/lec.py +56 -0
  229. siliconcompiler/tools/yosys/prepareLib.py +59 -0
  230. siliconcompiler/tools/yosys/sc_lec.tcl +84 -0
  231. siliconcompiler/tools/yosys/sc_syn.tcl +79 -0
  232. siliconcompiler/tools/yosys/syn_asic.py +565 -0
  233. siliconcompiler/tools/yosys/syn_asic.tcl +377 -0
  234. siliconcompiler/tools/yosys/syn_asic_fpga_shared.tcl +31 -0
  235. siliconcompiler/tools/yosys/syn_fpga.py +146 -0
  236. siliconcompiler/tools/yosys/syn_fpga.tcl +233 -0
  237. siliconcompiler/tools/yosys/syn_strategies.tcl +81 -0
  238. siliconcompiler/tools/yosys/techmaps/lcu_kogge_stone.v +39 -0
  239. siliconcompiler/tools/yosys/templates/abc.const +2 -0
  240. siliconcompiler/tools/yosys/yosys.py +147 -0
  241. siliconcompiler/units.py +259 -0
  242. siliconcompiler/use.py +177 -0
  243. siliconcompiler/utils/__init__.py +423 -0
  244. siliconcompiler/utils/asic.py +158 -0
  245. siliconcompiler/utils/showtools.py +25 -0
  246. siliconcompiler-0.26.5.dist-info/LICENSE +190 -0
  247. siliconcompiler-0.26.5.dist-info/METADATA +195 -0
  248. siliconcompiler-0.26.5.dist-info/RECORD +251 -0
  249. siliconcompiler-0.26.5.dist-info/WHEEL +5 -0
  250. siliconcompiler-0.26.5.dist-info/entry_points.txt +12 -0
  251. siliconcompiler-0.26.5.dist-info/top_level.txt +1 -0
@@ -0,0 +1,87 @@
1
+ import os
2
+ from siliconcompiler.tools._common import add_require_input, add_frontend_requires, \
3
+ get_input_files, get_tool_task, has_input_files
4
+
5
+
6
+ def setup(chip):
7
+ '''
8
+ Imports VHDL and converts it to verilog
9
+ '''
10
+
11
+ # Standard Setup
12
+ tool = 'ghdl'
13
+ clobber = False
14
+
15
+ if not has_input_files(chip, 'input', 'rtl', 'vhdl'):
16
+ return "no files in [input,rtl,vhdl]"
17
+
18
+ step = chip.get('arg', 'step')
19
+ index = chip.get('arg', 'index')
20
+ _, task = get_tool_task(chip, step, index)
21
+
22
+ chip.set('tool', tool, 'exe', 'ghdl')
23
+ chip.set('tool', tool, 'vswitch', '--version')
24
+ chip.set('tool', tool, 'version', '>=4.0.0-dev', clobber=clobber)
25
+
26
+ chip.set('tool', tool, 'task', task, 'threads', os.cpu_count(),
27
+ step=step, index=index, clobber=clobber)
28
+ chip.set('tool', tool, 'task', task, 'option', '',
29
+ step=step, index=index, clobber=clobber)
30
+ chip.set('tool', tool, 'task', task, 'stdout', 'destination', 'output',
31
+ step=step, index=index)
32
+ chip.set('tool', tool, 'task', task, 'stdout', 'suffix', 'v',
33
+ step=step, index=index)
34
+
35
+ # Schema requirements
36
+ add_require_input(chip, 'input', 'rtl', 'vhdl')
37
+ add_frontend_requires(chip, ['define'])
38
+
39
+ design = chip.top()
40
+
41
+ chip.set('tool', tool, 'task', task, 'output', f'{design}.v', step=step, index=index)
42
+
43
+
44
+ ################################
45
+ # Custom runtime options
46
+ ################################
47
+ def runtime_options(chip):
48
+
49
+ ''' Custom runtime options, returnst list of command line options.
50
+ '''
51
+
52
+ step = chip.get('arg', 'step')
53
+ index = chip.get('arg', 'index')
54
+ _, task = get_tool_task(chip, step, index)
55
+
56
+ options = []
57
+
58
+ # Synthesize inputs and output Verilog netlist
59
+ options.append('--synth')
60
+ options.append('--std=08')
61
+ options.append('--out=verilog')
62
+ options.append('--no-formal')
63
+
64
+ # currently only -fsynopsys and --latches supported
65
+ valid_extraopts = ['-fsynopsys', '--latches']
66
+
67
+ extra_opts = chip.get('tool', 'ghdl', 'task', task, 'var', 'extraopts', step=step, index=index)
68
+ for opt in extra_opts:
69
+ if opt in valid_extraopts:
70
+ options.append(opt)
71
+ else:
72
+ chip.error('Unsupported option ' + opt)
73
+
74
+ # Add defines
75
+ for define in chip.get('option', 'define'):
76
+ options.append(f'-g{define}')
77
+
78
+ # Add sources
79
+ for value in get_input_files(chip, 'input', 'rtl', 'vhdl'):
80
+ options.append(value)
81
+
82
+ # Set top module
83
+ options.append('-e')
84
+
85
+ options.append(chip.top(step=step, index=index))
86
+
87
+ return options
@@ -0,0 +1,41 @@
1
+
2
+ '''
3
+ GHDL is an open-source analyzer, compiler, simulator and
4
+ (experimental) synthesizer for VHDL. It allows you to analyse
5
+ and elaborate sources for generating machine code from your design.
6
+ Native program execution is the only way for high speed simulation.
7
+
8
+ Documentation: https://ghdl.readthedocs.io/en/latest
9
+
10
+ Sources: https://github.com/ghdl/ghdl
11
+
12
+ Installation: https://github.com/ghdl/ghdl
13
+ '''
14
+
15
+ from siliconcompiler.tools.ghdl import convert
16
+
17
+
18
+ #####################################################################
19
+ # Make Docs
20
+ #####################################################################
21
+ def make_docs(chip):
22
+ convert.setup(chip)
23
+ return chip
24
+
25
+
26
+ ################################
27
+ # Version Check
28
+ ################################
29
+ def parse_version(stdout):
30
+ # first line: GHDL 2.0.0-dev (1.0.0.r827.ge49cb7b9) [Dunoon edition]
31
+
32
+ # '*-dev' is interpreted by packaging.version as a "developmental release",
33
+ # which has the correct semantics. e.g. Version('2.0.0') > Version('2.0.0-dev')
34
+ return stdout.split()[1]
35
+
36
+
37
+ ##################################################
38
+ if __name__ == "__main__":
39
+
40
+ chip = make_docs()
41
+ chip.write_manifest("ghdl.json")
@@ -0,0 +1,87 @@
1
+ import os
2
+ from siliconcompiler.tools._common import \
3
+ add_require_input, add_frontend_requires, get_input_files, get_frontend_options, \
4
+ get_tool_task
5
+
6
+
7
+ def setup(chip):
8
+ '''
9
+ Compile the input verilog into a vvp file that can be simulated.
10
+ '''
11
+
12
+ # If the 'lock' bit is set, don't reconfigure.
13
+ tool = 'icarus'
14
+ step = chip.get('arg', 'step')
15
+ index = chip.get('arg', 'index')
16
+ _, task = get_tool_task(chip, step, index)
17
+
18
+ # Standard Setup
19
+ chip.set('tool', tool, 'exe', 'iverilog')
20
+ chip.set('tool', tool, 'vswitch', '-V')
21
+ chip.set('tool', tool, 'version', '>=10.3', clobber=False)
22
+
23
+ chip.set('tool', tool, 'task', task, 'threads', os.cpu_count(),
24
+ step=step, index=index, clobber=False)
25
+
26
+ chip.set('tool', tool, 'task', task, 'var', 'verilog_generation',
27
+ 'Select Verilog language generation for Icarus to use. Legal values are '
28
+ '"1995", "2001", "2001-noconfig", "2005", "2005-sv", "2009", or "2012". '
29
+ 'See the corresponding "-g" flags in the Icarus manual for more information.',
30
+ field='help')
31
+
32
+ add_require_input(chip, 'input', 'rtl', 'netlist')
33
+ add_require_input(chip, 'input', 'rtl', 'verilog')
34
+ add_require_input(chip, 'input', 'rtl', 'systemverilog')
35
+ add_require_input(chip, 'input', 'cmdfile', 'f')
36
+ add_frontend_requires(chip, ['ydir', 'vlib', 'idir', 'define', 'libext'])
37
+
38
+ design = chip.top()
39
+ chip.add('tool', tool, 'task', task, 'output', f'{design}.vvp', step=step, index=index)
40
+
41
+
42
+ ################################
43
+ # Custom runtime options
44
+ ################################
45
+ def runtime_options(chip):
46
+
47
+ ''' Custom runtime options, returns list of command line options.
48
+ '''
49
+ step = chip.get('arg', 'step')
50
+ index = chip.get('arg', 'index')
51
+ tool, task = get_tool_task(chip, step, index)
52
+
53
+ cmdlist = []
54
+
55
+ design = chip.top()
56
+ cmdlist = ['-o', f'outputs/{design}.vvp']
57
+ cmdlist += ['-s', chip.top()]
58
+
59
+ verilog_gen = chip.get('tool', tool, 'task', task, 'var', 'verilog_generation',
60
+ step=step, index=index)
61
+ if verilog_gen:
62
+ cmdlist.append(f'-g{verilog_gen[0]}')
63
+
64
+ opts = get_frontend_options(chip, ['ydir', 'vlib', 'idir', 'define', 'libext'])
65
+
66
+ for libext in opts['libext']:
67
+ cmdlist.append(f'-Y.{libext}')
68
+
69
+ # source files
70
+ for value in opts['ydir']:
71
+ cmdlist.append('-y ' + value)
72
+ for value in opts['vlib']:
73
+ cmdlist.append('-v ' + value)
74
+ for value in opts['idir']:
75
+ cmdlist.append('-I' + value)
76
+ for value in opts['define']:
77
+ cmdlist.append('-D' + value)
78
+ for value in get_input_files(chip, 'input', 'cmdfile', 'f'):
79
+ cmdlist.append('-f ' + value)
80
+ for value in get_input_files(chip, 'input', 'rtl', 'netlist'):
81
+ cmdlist.append(value)
82
+ for value in get_input_files(chip, 'input', 'rtl', 'verilog'):
83
+ cmdlist.append(value)
84
+ for value in get_input_files(chip, 'input', 'rtl', 'systemverilog'):
85
+ cmdlist.append(value)
86
+
87
+ return cmdlist
@@ -0,0 +1,36 @@
1
+
2
+ '''
3
+ Icarus is a verilog simulator with full support for Verilog
4
+ IEEE-1364. Icarus can simulate synthesizable as well as
5
+ behavioral Verilog.
6
+
7
+ Documentation: https://steveicarus.github.io/iverilog/
8
+
9
+ Sources: https://github.com/steveicarus/iverilog
10
+
11
+ Installation: https://github.com/steveicarus/iverilog
12
+ '''
13
+
14
+
15
+ ####################################################################
16
+ # Make Docs
17
+ ####################################################################
18
+ def make_docs(chip):
19
+ from siliconcompiler.tools.icarus.compile import setup
20
+ setup(chip)
21
+ return chip
22
+
23
+
24
+ ################################
25
+ # Version Check
26
+ ################################
27
+ def parse_version(stdout):
28
+ # First line: Icarus Verilog version 10.1 (stable) ()
29
+ return stdout.split()[3]
30
+
31
+
32
+ ##################################################
33
+ if __name__ == "__main__":
34
+
35
+ chip = make_docs()
36
+ chip.write_manifest("icarus.json")
@@ -0,0 +1,20 @@
1
+ from siliconcompiler.tools._common import get_tool_task
2
+
3
+
4
+ def setup(chip):
5
+ '''
6
+ Generate a bitstream for the ICE40 FPGA
7
+ '''
8
+ tool = 'icepack'
9
+ step = chip.get('arg', 'step')
10
+ index = chip.get('arg', 'index')
11
+ _, task = get_tool_task(chip, step, index)
12
+
13
+ clobber = False
14
+ design = chip.top()
15
+
16
+ chip.set('tool', tool, 'exe', tool)
17
+
18
+ chip.set('tool', tool, 'task', task, 'option', "", step=step, index=index, clobber=clobber)
19
+ chip.set('tool', tool, 'task', task, 'input', f'{design}.asc', step=step, index=index)
20
+ chip.set('tool', tool, 'task', task, 'output', f'{design}.bit', step=step, index=index)
@@ -0,0 +1,43 @@
1
+
2
+ '''
3
+ Icepack converts an ASCII bitstream file to a .bin file for the
4
+ ICE40 FPGA.
5
+
6
+ Documentation: https://clifford.at/icestorm
7
+
8
+ Sources: https://github.com/YosysHQ/icestorm
9
+
10
+ Installation: https://github.com/YosysHQ/icestorm
11
+ '''
12
+
13
+
14
+ #####################################################################
15
+ # Make Docs
16
+ #####################################################################
17
+ def make_docs(chip):
18
+ from siliconcompiler.tools.icepack.bitstream import setup
19
+ setup(chip)
20
+ return chip
21
+
22
+
23
+ ################################
24
+ # Custom runtime options
25
+ ################################
26
+ def runtime_options(chip):
27
+ ''' Custom runtime options, returnst list of command line options.
28
+ '''
29
+
30
+ topmodule = chip.top()
31
+
32
+ cmdlist = []
33
+ cmdlist.append("inputs/" + topmodule + ".asc")
34
+ cmdlist.append("outputs/" + topmodule + ".bit")
35
+
36
+ return cmdlist
37
+
38
+
39
+ ##################################################
40
+ if __name__ == "__main__":
41
+
42
+ chip = make_docs()
43
+ chip.write_manifest("icepack.json")
@@ -0,0 +1,117 @@
1
+
2
+ from siliconcompiler.tools.klayout.klayout import setup as setup_tool
3
+ from siliconcompiler.tools.klayout.screenshot import setup_gui_screenshot
4
+ from siliconcompiler.tools._common import input_provides, get_tool_task
5
+ from siliconcompiler.tools._common.asic import get_libraries
6
+
7
+
8
+ def setup(chip):
9
+ '''
10
+ Generate a GDSII file from an input DEF file
11
+ '''
12
+
13
+ # Generic tool setup.
14
+ setup_tool(chip)
15
+
16
+ tool = 'klayout'
17
+ step = chip.get('arg', 'step')
18
+ index = chip.get('arg', 'index')
19
+ _, task = get_tool_task(chip, step, index)
20
+ clobber = False
21
+
22
+ script = 'klayout_export.py'
23
+ option = ['-z', '-nc', '-rx', '-r']
24
+ chip.set('tool', tool, 'task', task, 'script', script, step=step, index=index, clobber=clobber)
25
+ chip.set('tool', tool, 'task', task, 'option', option, step=step, index=index, clobber=clobber)
26
+
27
+ targetlibs = get_libraries(chip, 'logic')
28
+ stackup = chip.get('option', 'stackup')
29
+ pdk = chip.get('option', 'pdk')
30
+
31
+ # Set stream extension
32
+ streams = ('gds', 'oas')
33
+ chip.set('tool', tool, 'task', task, 'var', 'stream', 'gds',
34
+ step=step, index=index, clobber=False)
35
+ chip.set('tool', tool, 'task', task, 'var', 'stream',
36
+ f'Extension to use for stream generation ({streams})',
37
+ field='help')
38
+ default_stream = chip.get('tool', tool, 'task', task, 'var', 'stream',
39
+ step=step, index=index)[0]
40
+ sc_stream_order = [default_stream, *[s for s in streams if s != default_stream]]
41
+
42
+ if stackup and targetlibs:
43
+ macrolibs = get_libraries(chip, 'macro')
44
+
45
+ chip.add('tool', tool, 'task', task, 'require', ",".join(['asic', 'logiclib']),
46
+ step=step, index=index)
47
+ chip.add('tool', tool, 'task', task, 'require', ",".join(['option', 'stackup']),
48
+ step=step, index=index)
49
+ req_set = False
50
+ for s in sc_stream_order:
51
+ if chip.valid('pdk', pdk, 'layermap', 'klayout', 'def', s, stackup):
52
+ chip.add('tool', tool, 'task', task, 'require',
53
+ ",".join(['pdk', pdk, 'layermap', 'klayout', 'def', s, stackup]),
54
+ step=step, index=index)
55
+ req_set = True
56
+ break
57
+ if not req_set:
58
+ # add default require
59
+ chip.add('tool', tool, 'task', task, 'require',
60
+ ",".join(['pdk', pdk, 'layermap', 'klayout', 'def', 'klayout', stackup]),
61
+ step=step, index=index)
62
+
63
+ for lib in (targetlibs + macrolibs):
64
+ lib_requires_stream = True
65
+ if chip.valid('library', lib, 'option', 'var', 'klayout_allow_missing_cell') and \
66
+ chip.get('library', lib, 'option', 'var', 'klayout_allow_missing_cell'):
67
+ lib_requires_stream = False
68
+ req_set = False
69
+ for s in sc_stream_order:
70
+ if chip.valid('library', lib, 'output', stackup, s):
71
+ chip.add('tool', tool, 'task', task, 'require',
72
+ ",".join(['library', lib, 'output', stackup, s]),
73
+ step=step, index=index)
74
+ req_set = True
75
+ break
76
+ if not req_set and lib_requires_stream:
77
+ chip.add('tool', tool, 'task', task, 'require',
78
+ ",".join(['library', lib, 'output', stackup, default_stream]),
79
+ step=step, index=index)
80
+ chip.add('tool', tool, 'task', task, 'require',
81
+ ",".join(['library', lib, 'output', stackup, 'lef']),
82
+ step=step, index=index)
83
+ else:
84
+ chip.error('Stackup and targetlib parameters required for Klayout.')
85
+
86
+ # Input/Output requirements for default flow
87
+ design = chip.top()
88
+ if design + '.def' in input_provides(chip, step, index):
89
+ chip.add('tool', tool, 'task', task, 'input', design + '.def',
90
+ step=step, index=index)
91
+ else:
92
+ chip.add('tool', tool, 'task', task, 'require', 'input,layout,def',
93
+ step=step, index=index)
94
+
95
+ chip.add('tool', tool, 'task', task, 'output', f'{design}.{default_stream}',
96
+ step=step, index=index)
97
+ chip.add('tool', tool, 'task', task, 'output', f'{design}.lyt',
98
+ step=step, index=index)
99
+ chip.add('tool', tool, 'task', task, 'output', f'{design}.lyp',
100
+ step=step, index=index)
101
+
102
+ # Export GDS with timestamps by default.
103
+ chip.set('tool', tool, 'task', task, 'var', 'timestamps', 'true',
104
+ step=step, index=index, clobber=False)
105
+ chip.set('tool', tool, 'task', task, 'var', 'timestamps',
106
+ 'Export GDSII with timestamps',
107
+ field='help')
108
+
109
+ chip.set('tool', tool, 'task', task, 'var', 'screenshot', 'true',
110
+ step=step, index=index, clobber=False)
111
+ chip.set('tool', tool, 'task', task, 'var', 'screenshot',
112
+ 'true/false: true will cause KLayout to generate a screenshot of the layout',
113
+ field='help')
114
+
115
+ if chip.get('tool', tool, 'task', task, 'var', 'screenshot',
116
+ step=step, index=index) == ['true']:
117
+ setup_gui_screenshot(chip, require_input=False)
@@ -0,0 +1,119 @@
1
+
2
+ '''
3
+ Klayout is a production grade viewer and editor of GDSII and
4
+ Oasis data with customizable Python and Ruby interfaces.
5
+
6
+ Documentation: https://www.klayout.de
7
+
8
+ Sources: https://github.com/KLayout/klayout
9
+
10
+ Installation: https://www.klayout.de/build.html
11
+ '''
12
+
13
+ import os
14
+ from pathlib import Path
15
+ import platform
16
+ import shutil
17
+ from siliconcompiler.tools._common import get_tool_task
18
+
19
+
20
+ ####################################################################
21
+ # Make Docs
22
+ ####################################################################
23
+ def make_docs(chip):
24
+ chip.load_target("freepdk45_demo")
25
+
26
+
27
+ ####################################################################
28
+ # Setup tool
29
+ ####################################################################
30
+ def setup(chip, mode="batch"):
31
+ '''
32
+ Setup function for Klayout
33
+ '''
34
+
35
+ tool = 'klayout'
36
+ refdir = 'tools/' + tool
37
+ step = chip.get('arg', 'step')
38
+ index = chip.get('arg', 'index')
39
+ _, task = get_tool_task(chip, step, index)
40
+ clobber = False
41
+
42
+ klayout_exe = 'klayout'
43
+ if chip.get('option', 'scheduler', 'name', step=step, index=index) != 'docker':
44
+ if platform.system() == 'Windows':
45
+ klayout_exe = 'klayout_app.exe'
46
+ if not shutil.which(klayout_exe):
47
+ loc_dir = os.path.join(Path.home(), 'AppData', 'Roaming', 'KLayout')
48
+ global_dir = os.path.join(os.path.splitdrive(Path.home())[0],
49
+ os.path.sep,
50
+ 'Program Files (x86)',
51
+ 'KLayout')
52
+ if os.path.isdir(loc_dir):
53
+ chip.set('tool', tool, 'path', loc_dir)
54
+ elif os.path.isdir(global_dir):
55
+ chip.set('tool', tool, 'path', global_dir)
56
+ elif platform.system() == 'Darwin':
57
+ klayout_exe = 'klayout'
58
+ if not shutil.which(klayout_exe):
59
+ klayout_dir = os.path.join(os.path.sep,
60
+ 'Applications',
61
+ 'klayout.app',
62
+ 'Contents',
63
+ 'MacOS')
64
+ # different install directory when installed using Homebrew
65
+ klayout_brew_dir = os.path.join(os.path.sep,
66
+ 'Applications',
67
+ 'KLayout',
68
+ 'klayout.app',
69
+ 'Contents',
70
+ 'MacOS')
71
+ if os.path.isdir(klayout_dir):
72
+ chip.set('tool', tool, 'path', klayout_dir)
73
+ elif os.path.isdir(klayout_brew_dir):
74
+ chip.set('tool', tool, 'path', klayout_brew_dir)
75
+
76
+ # common to all
77
+ chip.set('tool', tool, 'exe', klayout_exe)
78
+ chip.set('tool', tool, 'vswitch', ['-zz', '-v'])
79
+ chip.set('tool', tool, 'version', '>=0.28.0', clobber=clobber)
80
+ chip.set('tool', tool, 'format', 'json', clobber=clobber)
81
+
82
+ chip.set('tool', tool, 'task', task, 'refdir', refdir, step=step, index=index,
83
+ package='siliconcompiler', clobber=clobber)
84
+
85
+ if chip.get('option', 'nodisplay'):
86
+ # Tells QT to use the offscreen platform if nodisplay is used
87
+ chip.set('tool', tool, 'task', task, 'env', 'QT_QPA_PLATFORM', 'offscreen',
88
+ step=step, index=index)
89
+
90
+ # Log file parsing
91
+ chip.set('tool', tool, 'task', task, 'regex', 'warnings', r'(WARNING|warning)',
92
+ step=step, index=index, clobber=False)
93
+ chip.set('tool', tool, 'task', task, 'regex', 'errors', r'ERROR',
94
+ step=step, index=index, clobber=False)
95
+
96
+
97
+ def runtime_options(chip):
98
+ # Provide KLayout with path to SC package so the driver can import the
99
+ # schema package directly. Since KL may be using a different Python
100
+ # environment than the user, it needs to import the limited Schema class
101
+ # that has no 3rd-party dependencies.
102
+ # This must be done at runtime to work in a remote context.
103
+
104
+ return ['-rd', f'SC_ROOT={chip.scroot}']
105
+
106
+
107
+ ################################
108
+ # Version Check
109
+ ################################
110
+ def parse_version(stdout):
111
+ # KLayout 0.26.11
112
+ return stdout.split()[1]
113
+
114
+
115
+ ##################################################
116
+ if __name__ == "__main__":
117
+
118
+ chip = make_docs()
119
+ chip.write_manifest("klayout.json")