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,132 @@
1
+ #!/usr/bin/python3
2
+ # SPDX-FileCopyrightText: 2020 Efabless Corporation
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ # SPDX-License-Identifier: Apache-2.0
16
+
17
+ #
18
+ # ---------------------------------------------------------
19
+ # LVS failure check
20
+ #
21
+ # This is a Python script that parses the comp.json
22
+ # output from netgen and reports on the number of
23
+ # errors in the top-level netlist.
24
+ #
25
+ # ---------------------------------------------------------
26
+ # Written by Tim Edwards
27
+ # efabless, inc.
28
+ # Pulled from qflow GUI as standalone script Aug 20, 2018
29
+ # ---------------------------------------------------------
30
+
31
+ import re
32
+ import json
33
+ import argparse
34
+ from siliconcompiler import sc_open
35
+
36
+
37
+ def count_LVS_failures(filename):
38
+ with sc_open(filename) as cfile:
39
+ lvsdata = json.load(cfile)
40
+
41
+ # Count errors in the JSON file
42
+ failures = 0
43
+ devfail = 0
44
+ netfail = 0
45
+ pinfail = 0
46
+ propfail = 0
47
+ netdiff = 0
48
+ devdiff = 0
49
+ ncells = len(lvsdata)
50
+ for c in range(0, ncells):
51
+ cellrec = lvsdata[c]
52
+
53
+ if c == ncells - 1:
54
+ topcell = True
55
+ else:
56
+ topcell = False
57
+
58
+ # Most errors must only be counted for the top cell, because individual
59
+ # failing cells are flattened and the matching attempted again on the
60
+ # flattened netlist.
61
+
62
+ if topcell:
63
+ if 'devices' in cellrec:
64
+ devices = cellrec['devices']
65
+ devlist = [val for pair in zip(devices[0], devices[1]) for val in pair]
66
+ devpair = list(devlist[p:p + 2] for p in range(0, len(devlist), 2))
67
+ for dev in devpair:
68
+ c1dev = dev[0]
69
+ c2dev = dev[1]
70
+ diffdevs = abs(c1dev[1] - c2dev[1])
71
+ failures += diffdevs
72
+ devdiff += diffdevs
73
+
74
+ if 'nets' in cellrec:
75
+ nets = cellrec['nets']
76
+ diffnets = abs(nets[0] - nets[1])
77
+ failures += diffnets
78
+ netdiff += diffnets
79
+
80
+ if 'badnets' in cellrec:
81
+ badnets = cellrec['badnets']
82
+ failures += len(badnets)
83
+ netfail += len(badnets)
84
+
85
+ if 'badelements' in cellrec:
86
+ badelements = cellrec['badelements']
87
+ failures += len(badelements)
88
+ devfail += len(badelements)
89
+
90
+ if 'pins' in cellrec:
91
+ pins = cellrec['pins']
92
+ pinlist = [val for pair in zip(pins[0], pins[1]) for val in pair]
93
+ pinpair = list(pinlist[p:p + 2] for p in range(0, len(pinlist), 2))
94
+ for pin in pinpair:
95
+ # Avoid flagging global vs. local names, e.g., "gnd" vs. "gnd!,"
96
+ # and ignore case when comparing pins.
97
+ pin0 = re.sub('!$', '', pin[0].lower())
98
+ pin1 = re.sub('!$', '', pin[1].lower())
99
+ if pin0 != pin1:
100
+ failures += 1
101
+ pinfail += 1
102
+
103
+ # Property errors must be counted for every cell
104
+ if 'properties' in cellrec:
105
+ properties = cellrec['properties']
106
+ failures += len(properties)
107
+ propfail += len(properties)
108
+
109
+ return [failures, netfail, devfail, pinfail, propfail, netdiff, devdiff]
110
+
111
+
112
+ if __name__ == '__main__':
113
+
114
+ parser = argparse.ArgumentParser(description='Parses netgen lvs')
115
+ parser.add_argument('--file', '-f', required=True)
116
+ args = parser.parse_args()
117
+ failures = count_LVS_failures(args.file)
118
+ total = failures[0]
119
+ if total > 0:
120
+ failed = True
121
+ print('LVS reports:')
122
+ print(' net count difference = ' + str(failures[5]))
123
+ print(' device count difference = ' + str(failures[6]))
124
+ print(' unmatched nets = ' + str(failures[1]))
125
+ print(' unmatched devices = ' + str(failures[2]))
126
+ print(' unmatched pins = ' + str(failures[3]))
127
+ print(' property failures = ' + str(failures[4]))
128
+ else:
129
+ print('LVS reports no net, device, pin, or property mismatches.')
130
+
131
+ print('')
132
+ print('Total errors = ' + str(total))
@@ -0,0 +1,90 @@
1
+ import os
2
+
3
+ from siliconcompiler.tools.netgen import count_lvs
4
+ from siliconcompiler import sc_open
5
+ from siliconcompiler.tools._common import get_tool_task, record_metric
6
+
7
+
8
+ def setup(chip):
9
+ '''
10
+ Perform LVS on the supplied netlists
11
+ '''
12
+
13
+ tool = 'netgen'
14
+ refdir = 'tools/' + tool
15
+ step = chip.get('arg', 'step')
16
+ index = chip.get('arg', 'index')
17
+ _, task = get_tool_task(chip, step, index)
18
+
19
+ # magic used for drc and lvs
20
+ script = 'sc_lvs.tcl'
21
+
22
+ chip.set('tool', tool, 'exe', tool)
23
+ chip.set('tool', tool, 'vswitch', '-batch')
24
+ chip.set('tool', tool, 'version', '>=1.5.192', clobber=False)
25
+ chip.set('tool', tool, 'format', 'tcl')
26
+
27
+ chip.set('tool', tool, 'task', task, 'threads', os.cpu_count(),
28
+ step=step, index=index, clobber=False)
29
+ chip.set('tool', tool, 'task', task, 'refdir', refdir,
30
+ step=step, index=index,
31
+ package='siliconcompiler', clobber=False)
32
+ chip.set('tool', tool, 'task', task, 'script', script,
33
+ step=step, index=index, clobber=False)
34
+
35
+ # set options
36
+ options = []
37
+ options.append('-batch')
38
+ options.append('source')
39
+ chip.set('tool', tool, 'task', task, 'option', options, step=step, index=index, clobber=False)
40
+
41
+ design = chip.top()
42
+ chip.add('tool', tool, 'task', task, 'input', f'{design}.spice', step=step, index=index)
43
+ if chip.valid('input', 'netlist', 'verilog'):
44
+ chip.add('tool', tool, 'task', task, 'require',
45
+ ','.join(['input', 'netlist', 'verilog']),
46
+ step=step, index=index)
47
+ else:
48
+ chip.add('tool', tool, 'task', task, 'input', f'{design}.vg', step=step, index=index)
49
+
50
+ # Netgen doesn't have a standard error prefix that we can grep for, but it
51
+ # does print all errors to stderr, so we can redirect them to <step>.errors
52
+ # and use that file to count errors.
53
+ chip.set('tool', tool, 'task', task, 'stderr', 'suffix', 'errors', step=step, index=index)
54
+
55
+ chip.set('tool', tool, 'task', task, 'regex', 'warnings', '^Warning:',
56
+ step=step, index=index, clobber=False)
57
+
58
+
59
+ ################################
60
+ # Post_process (post executable)
61
+ ################################
62
+ def post_process(chip):
63
+ ''' Tool specific function to run after step execution
64
+
65
+ Reads error count from output and fills in appropriate entry in metrics
66
+ '''
67
+ step = chip.get('arg', 'step')
68
+ index = chip.get('arg', 'index')
69
+ design = chip.top()
70
+
71
+ with sc_open(f'{step}.errors') as f:
72
+ errors = len([line for line in f.readlines() if not line.startswith("Note:")])
73
+ record_metric(chip, step, index, 'errors', errors, f'{step}.errors')
74
+
75
+ # Export metrics
76
+ lvs_report = f'reports/{design}.lvs.json'
77
+ if not os.path.isfile(lvs_report):
78
+ chip.logger.warning('No LVS report generated. Netgen may have encountered errors.')
79
+ return
80
+
81
+ lvs_failures = count_lvs.count_LVS_failures(lvs_report)
82
+
83
+ # We don't count top-level pin mismatches as errors b/c we seem to get
84
+ # false positives for disconnected pins. Report them as warnings
85
+ # instead, the designer can then take a look at the full report for
86
+ # details.
87
+ pin_failures = lvs_failures[3]
88
+ errors = lvs_failures[0] - pin_failures
89
+ record_metric(chip, step, index, 'drcs', errors, lvs_report)
90
+ record_metric(chip, step, index, 'warnings', pin_failures, lvs_report)
@@ -0,0 +1,36 @@
1
+
2
+ '''
3
+ Netgen is a tool for comparing netlists. By comparing a Verilog netlist with
4
+ one extracted from a circuit layout, it can be used to perform LVS
5
+ verification.
6
+
7
+ Documentation: http://www.opencircuitdesign.com/netgen/
8
+
9
+ Installation: https://github.com/RTimothyEdwards/netgen
10
+
11
+ Sources: https://github.com/RTimothyEdwards/netgen
12
+ '''
13
+
14
+
15
+ ####################################################################
16
+ # Make Docs
17
+ ####################################################################
18
+ def make_docs(chip):
19
+ from siliconcompiler.tools.netgen.lvs import setup
20
+ setup(chip)
21
+ return chip
22
+
23
+
24
+ ################################
25
+ # Version Check
26
+ ################################
27
+ def parse_version(stdout):
28
+ # First line: Netgen 1.5.190 compiled on Fri Jun 25 16:05:36 EDT 2021
29
+ return stdout.split()[1]
30
+
31
+
32
+ ##################################################
33
+ if __name__ == "__main__":
34
+
35
+ chip = make_docs()
36
+ chip.write_manifest("netgen.json")
@@ -0,0 +1,46 @@
1
+ source ./sc_manifest.tcl
2
+
3
+ set sc_step [sc_cfg_get arg step]
4
+ set sc_index [sc_cfg_get arg index]
5
+ set sc_task $sc_step
6
+
7
+ set sc_design [sc_top]
8
+ set sc_macrolibs [sc_get_asic_libraries macro]
9
+ set sc_stackup [sc_cfg_get option stackup]
10
+ set sc_pdk [sc_cfg_get option pdk]
11
+ set sc_runset [sc_cfg_get pdk $sc_pdk lvs runset netgen $sc_stackup basic]
12
+
13
+ if { [sc_cfg_tool_task_exists var exclude] } {
14
+ set sc_exclude [sc_cfg_tool_task_get var exclude]
15
+ } else {
16
+ set sc_exclude [list]
17
+ }
18
+
19
+ set layout_file "inputs/$sc_design.spice"
20
+ if { [sc_cfg_exists "input" netlist verilog] } {
21
+ set schematic_file [sc_cfg_get "input" netlist verilog]
22
+ } else {
23
+ set schematic_file "inputs/$sc_design.vg"
24
+ }
25
+
26
+ # readnet returns a number that can be used to associate additional files with
27
+ # each netlist read in here
28
+ set layout_fileset [readnet spice $layout_file]
29
+ set schematic_fileset [readnet verilog $schematic_file]
30
+
31
+ # Read netlists associated with all non-excluded macro libraries
32
+ foreach lib $sc_macrolibs {
33
+ if { [lsearch -exact $sc_exclude $lib] < 0 } {
34
+ set netlist [sc_cfg_get library $lib output netlist verilog]
35
+ # Read $netlist into group of files associated with schematic
36
+ readnet verilog $netlist $schematic_fileset
37
+ }
38
+ }
39
+
40
+ lvs "$layout_file $sc_design" \
41
+ "$schematic_file $sc_design" \
42
+ $sc_runset \
43
+ reports/$sc_design.lvs.out \
44
+ -json
45
+
46
+ exit
@@ -0,0 +1,24 @@
1
+ from siliconcompiler.tools._common import get_tool_task
2
+
3
+
4
+ def setup(chip):
5
+ '''
6
+ Perform automated place and route on FPGAs
7
+ '''
8
+
9
+ tool = 'nextpnr'
10
+ step = chip.get('arg', 'step')
11
+ index = chip.get('arg', 'index')
12
+ _, task = get_tool_task(chip, step, index)
13
+
14
+ topmodule = chip.top()
15
+
16
+ clobber = False
17
+ chip.set('tool', tool, 'exe', 'nextpnr-ice40')
18
+ chip.set('tool', tool, 'vswitch', '--version')
19
+ chip.set('tool', tool, 'version', '>=0.2', clobber=clobber)
20
+
21
+ chip.set('tool', tool, 'task', task, 'option', "", step=step, index=index, clobber=clobber)
22
+ chip.set('tool', tool, 'task', task, 'input', f'{topmodule}.netlist.json',
23
+ step=step, index=index)
24
+ chip.set('tool', tool, 'task', task, 'output', f'{topmodule}.asc', step=step, index=index)
@@ -0,0 +1,59 @@
1
+ '''
2
+ nextpnr is a vendor neutral FPGA place and route tool with
3
+ support for the ICE40, ECP5, and Nexus devices from Lattice.
4
+
5
+ Documentation: https://github.com/YosysHQ/nextpnr
6
+
7
+ Sources: https://github.com/YosysHQ/nextpnr
8
+
9
+ Installation: https://github.com/YosysHQ/nextpnr
10
+ '''
11
+
12
+
13
+ #####################################################################
14
+ # Make Docs
15
+ #####################################################################
16
+ def make_docs(chip):
17
+ from siliconcompiler.tools.nextpnr.apr import setup
18
+ setup(chip)
19
+ return chip
20
+
21
+
22
+ ################################
23
+ # Custom runtime options
24
+ ################################
25
+ def runtime_options(chip):
26
+ ''' Custom runtime options, returns list of command line options.
27
+ '''
28
+ step = chip.get('arg', 'step')
29
+ index = chip.get('arg', 'index')
30
+
31
+ partname = chip.get('fpga', 'partname')
32
+ topmodule = chip.top()
33
+
34
+ options = []
35
+
36
+ options.append('--json inputs/' + topmodule + '.netlist.json')
37
+ options.append('--asc outputs/' + topmodule + '.asc')
38
+
39
+ if partname == 'ice40up5k-sg48':
40
+ options.append('--up5k --package sg48')
41
+
42
+ for constraint_file in chip.find_files('input', 'constraint', 'pcf', step=step, index=index):
43
+ options.append('--pcf ' + constraint_file)
44
+
45
+ return options
46
+
47
+
48
+ ################################
49
+ # Version Check
50
+ ################################
51
+ def parse_version(stdout):
52
+ # Examples:
53
+ # nextpnr-ice40 -- Next Generation Place and Route (Version c73d4cf6)
54
+ # nextpnr-ice40 -- Next Generation Place and Route (Version nextpnr-0.2)
55
+ version = stdout.split()[-1].rstrip(')')
56
+ if version.startswith('nextpnr-'):
57
+ return version.split('-')[1]
58
+ else:
59
+ return version
@@ -0,0 +1,39 @@
1
+ '''
2
+ The OpenFPGALoader is a universal utility for programming
3
+ FPGAs. Compatible with many boards, cables and FPGA from
4
+ major manufacturers (Xilinx, Altera/Intel, Lattice, Gowin,
5
+ Efinix, Anlogic). openFPGALoader works on Linux, Windows and
6
+ macOS.
7
+
8
+ Documentation: https://github.com/trabucayre/openFPGALoader
9
+
10
+ Sources: https://github.com/trabucayre/openFPGALoader
11
+
12
+ Installation: https://github.com/trabucayre/openFPGALoader
13
+
14
+ Status: SC integration WIP
15
+ '''
16
+ from siliconcompiler.tools._common import get_tool_task
17
+
18
+
19
+ ################################
20
+ # Setup Tool (pre executable)
21
+ ################################
22
+ def setup(chip):
23
+ ''' openFPGALoader setup function
24
+ '''
25
+
26
+ # If the 'lock' bit is set, don't reconfigure.
27
+ tool = 'openfpgaloader'
28
+ step = chip.get('arg', 'step')
29
+ index = chip.get('arg', 'index')
30
+ _, task = get_tool_task(chip, step, index)
31
+
32
+ # tool setup
33
+ chip.set('tool', tool, 'exe', tool)
34
+ chip.set('tool', tool, 'vswitch', '--Version', clobber=False)
35
+ chip.set('tool', tool, 'version', '0.5.0', clobber=False)
36
+
37
+ options = []
38
+ options.append("inputs" + chip.top() + ".bit")
39
+ chip.add('tool', tool, 'task', task, 'option', options, step=step, index=index)
File without changes
@@ -0,0 +1,45 @@
1
+
2
+ from siliconcompiler.tools.openroad.openroad import setup as setup_tool
3
+ from siliconcompiler.tools.openroad.openroad import build_pex_corners
4
+ from siliconcompiler.tools.openroad.openroad import post_process as or_post_process
5
+ from siliconcompiler.tools.openroad.openroad import pre_process as or_pre_process
6
+ from siliconcompiler.tools.openroad.openroad import _set_reports, set_pnr_inputs, set_pnr_outputs
7
+
8
+
9
+ def setup(chip):
10
+ '''
11
+ Perform clock tree synthesis and timing repair
12
+ '''
13
+
14
+ # Generic tool setup.
15
+ setup_tool(chip)
16
+
17
+ set_pnr_inputs(chip)
18
+ set_pnr_outputs(chip)
19
+
20
+ _set_reports(chip, [
21
+ 'setup',
22
+ 'hold',
23
+ 'unconstrained',
24
+ 'clock_skew',
25
+ 'power',
26
+ 'drv_violations',
27
+ 'fmax',
28
+
29
+ # Images
30
+ 'placement_density',
31
+ 'routing_congestion',
32
+ 'power_density',
33
+ 'clock_placement',
34
+ 'clock_trees',
35
+ 'optimization_placement'
36
+ ])
37
+
38
+
39
+ def pre_process(chip):
40
+ or_pre_process(chip)
41
+ build_pex_corners(chip)
42
+
43
+
44
+ def post_process(chip):
45
+ or_post_process(chip)
@@ -0,0 +1,66 @@
1
+
2
+ from siliconcompiler.tools.openroad.openroad import setup as setup_tool
3
+ from siliconcompiler.tools.openroad.openroad import build_pex_corners
4
+ from siliconcompiler.tools.openroad.openroad import post_process as or_post_process
5
+ from siliconcompiler.tools.openroad.openroad import pre_process as or_pre_process
6
+ from siliconcompiler.tools.openroad.openroad import _set_reports, set_pnr_inputs, set_pnr_outputs
7
+ from siliconcompiler.tools._common import get_tool_task
8
+ from siliconcompiler.tools._common.asic import get_mainlib
9
+ from siliconcompiler import NodeStatus
10
+
11
+
12
+ def setup(chip):
13
+ '''
14
+ Design for manufacturing step will insert fill if specified
15
+ '''
16
+
17
+ # Generic tool setup.
18
+ setup_tool(chip)
19
+
20
+ set_pnr_inputs(chip)
21
+ set_pnr_outputs(chip)
22
+
23
+ _set_reports(chip, [
24
+ 'setup',
25
+ 'hold',
26
+ 'unconstrained',
27
+ 'clock_skew',
28
+ 'power',
29
+ 'drv_violations',
30
+ 'fmax',
31
+
32
+ # Images
33
+ 'placement_density',
34
+ 'routing_congestion',
35
+ 'power_density',
36
+ 'clock_placement',
37
+ 'clock_trees',
38
+ 'optimization_placement'
39
+ ])
40
+
41
+
42
+ def pre_process(chip):
43
+ step = chip.get('arg', 'step')
44
+ index = chip.get('arg', 'index')
45
+ tool, task = get_tool_task(chip, step, index)
46
+ if not chip.find_files('tool', tool, 'task', task, 'prescript',
47
+ step=step, index=index) and \
48
+ not chip.find_files('tool', tool, 'task', task, 'postscript',
49
+ step=step, index=index) and \
50
+ chip.get('tool', tool, 'task', task, 'var', 'fin_add_fill',
51
+ step=step, index=index) == ["true"]:
52
+ pdk = chip.get('option', 'pdk')
53
+ stackup = chip.get('option', 'stackup')
54
+ mainlib = get_mainlib(chip)
55
+ libtype = chip.get('library', mainlib, 'asic', 'libarch', step=step, index=index)
56
+
57
+ if not chip.find_files('pdk', pdk, 'aprtech', tool, stackup, libtype, 'fill'):
58
+ chip.set('record', 'status', NodeStatus.SKIPPED, step=step, index=index)
59
+ chip.logger.warning(f'{step}{index} will be skipped since there is nothing to do.')
60
+
61
+ or_pre_process(chip)
62
+ build_pex_corners(chip)
63
+
64
+
65
+ def post_process(chip):
66
+ or_post_process(chip)
@@ -0,0 +1,131 @@
1
+
2
+ from siliconcompiler.tools.openroad.openroad import setup as setup_tool
3
+ from siliconcompiler.tools.openroad.openroad import build_pex_corners
4
+ from siliconcompiler.tools.openroad.openroad import post_process as or_post_process
5
+ from siliconcompiler.tools.openroad.openroad import pre_process as or_pre_process
6
+ from siliconcompiler.tools._common.asic import set_tool_task_var, get_libraries
7
+ from siliconcompiler.tools.openroad.openroad import _set_reports, set_pnr_inputs, set_pnr_outputs
8
+ from siliconcompiler.tools._common import get_tool_task
9
+
10
+
11
+ def setup(chip):
12
+ '''
13
+ Generate abstract views (LEF), timing libraries (liberty files),
14
+ circuit descriptions (CDL), and parasitic annotation files (SPEF)
15
+ '''
16
+
17
+ # Generic tool setup.
18
+ setup_tool(chip)
19
+
20
+ set_pnr_inputs(chip)
21
+ set_pnr_outputs(chip)
22
+
23
+ tool = 'openroad'
24
+ design = chip.top()
25
+ step = chip.get('arg', 'step')
26
+ index = chip.get('arg', 'index')
27
+ _, task = get_tool_task(chip, step, index)
28
+
29
+ # Set thread count to 1 while issue related to write_timing_model segfaulting
30
+ # when multiple threads are on is resolved.
31
+ chip.set('tool', tool, 'task', task, 'threads', 1,
32
+ step=step, index=index, clobber=True)
33
+
34
+ stackup = chip.get('option', 'stackup')
35
+ pdk = chip.get('option', 'pdk')
36
+
37
+ targetlibs = get_libraries(chip, 'logic')
38
+ macrolibs = get_libraries(chip, 'macro')
39
+
40
+ # Determine if exporting the cdl
41
+ set_tool_task_var(chip, param_key='write_cdl',
42
+ default_value='false',
43
+ schelp='true/false, when true enables writing the CDL file for the design')
44
+ do_cdl = chip.get('tool', tool, 'task', task, 'var', 'write_cdl',
45
+ step=step, index=index)[0] == 'true'
46
+
47
+ if do_cdl:
48
+ chip.add('tool', tool, 'task', task, 'output', design + '.cdl', step=step, index=index)
49
+ for lib in targetlibs + macrolibs:
50
+ chip.add('tool', tool, 'task', task, 'require',
51
+ ",".join(['library', lib, 'output', stackup, 'cdl']),
52
+ step=step, index=index)
53
+
54
+ set_tool_task_var(chip, param_key='write_spef',
55
+ default_value='true',
56
+ schelp='true/false, when true enables writing the SPEF file for the design')
57
+ do_spef = chip.get('tool', tool, 'task', task, 'var', 'write_spef',
58
+ step=step, index=index)[0] == 'true'
59
+ set_tool_task_var(chip, param_key='use_spef',
60
+ default_value=do_spef,
61
+ schelp='true/false, when true enables reading in SPEF files.')
62
+
63
+ if do_spef:
64
+ # Require openrcx pex models
65
+ for corner in chip.get('tool', tool, 'task', task, 'var', 'pex_corners',
66
+ step=step, index=index):
67
+ chip.add('tool', tool, 'task', task, 'require',
68
+ ",".join(['pdk', pdk, 'pexmodel', 'openroad-openrcx', stackup, corner]),
69
+ step=step, index=index)
70
+
71
+ # Add outputs SPEF in the format {design}.{pexcorner}.spef
72
+ for corner in chip.get('tool', tool, 'task', task, 'var', 'pex_corners',
73
+ step=step, index=index):
74
+ chip.add('tool', tool, 'task', task, 'output', design + '.' + corner + '.spef',
75
+ step=step, index=index)
76
+
77
+ # Add outputs LEF
78
+ chip.add('tool', tool, 'task', task, 'output', design + '.lef', step=step, index=index)
79
+
80
+ set_tool_task_var(chip, param_key='write_liberty',
81
+ default_value='true',
82
+ schelp='true/false, when true enables writing the liberty '
83
+ 'timing model for the design')
84
+ do_liberty = chip.get('tool', tool, 'task', task, 'var', 'write_liberty',
85
+ step=step, index=index)[0] == 'true'
86
+
87
+ if do_liberty:
88
+ # Add outputs liberty model in the format {design}.{libcorner}.lib
89
+ for corner in chip.getkeys('constraint', 'timing'):
90
+ chip.add('tool', tool, 'task', task, 'output', design + '.' + corner + '.lib',
91
+ step=step, index=index)
92
+
93
+ set_tool_task_var(chip, param_key='write_sdf',
94
+ default_value='true',
95
+ schelp='true/false, when true enables writing the SDF timing model '
96
+ 'for the design')
97
+ do_sdf = chip.get('tool', tool, 'task', task, 'var', 'write_sdf',
98
+ step=step, index=index)[0] == 'true'
99
+ if do_sdf:
100
+ # Add outputs liberty model in the format {design}.{libcorner}.sdf
101
+ for corner in chip.getkeys('constraint', 'timing'):
102
+ chip.add('tool', tool, 'task', task, 'output', design + '.' + corner + '.sdf',
103
+ step=step, index=index)
104
+
105
+ _set_reports(chip, [
106
+ 'setup',
107
+ 'hold',
108
+ 'unconstrained',
109
+ 'clock_skew',
110
+ 'power',
111
+ 'drv_violations',
112
+ 'fmax',
113
+
114
+ # Images
115
+ 'placement_density',
116
+ 'routing_congestion',
117
+ 'power_density',
118
+ 'ir_drop',
119
+ 'clock_placement',
120
+ 'clock_trees',
121
+ 'optimization_placement'
122
+ ])
123
+
124
+
125
+ def pre_process(chip):
126
+ or_pre_process(chip)
127
+ build_pex_corners(chip)
128
+
129
+
130
+ def post_process(chip):
131
+ or_post_process(chip)