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,180 @@
1
+ import siliconcompiler
2
+
3
+ from siliconcompiler.flows._common import setup_multiple_frontends
4
+ from siliconcompiler.flows._common import _make_docs
5
+
6
+ from siliconcompiler.tools.yosys import syn_asic
7
+ from siliconcompiler.tools.openroad import floorplan
8
+ from siliconcompiler.tools.openroad import physyn
9
+ from siliconcompiler.tools.openroad import place
10
+ from siliconcompiler.tools.openroad import cts
11
+ from siliconcompiler.tools.openroad import route
12
+ from siliconcompiler.tools.openroad import dfm
13
+ from siliconcompiler.tools.openroad import export as openroad_export
14
+ from siliconcompiler.tools.klayout import export as klayout_export
15
+
16
+ from siliconcompiler.tools.builtin import minimum
17
+
18
+
19
+ ############################################################################
20
+ # DOCS
21
+ ############################################################################
22
+ def make_docs(chip):
23
+ n = 3
24
+ _make_docs(chip)
25
+ return setup(chip, syn_np=n, floorplan_np=n, physyn_np=n, place_np=n, cts_np=n, route_np=n)
26
+
27
+
28
+ ###########################################################################
29
+ # Flowgraph Setup
30
+ ############################################################################
31
+ def setup(chip,
32
+ flowname='asicflow',
33
+ syn_np=1,
34
+ floorplan_np=1,
35
+ physyn_np=1,
36
+ place_np=1,
37
+ cts_np=1,
38
+ route_np=1):
39
+ '''
40
+ A configurable ASIC compilation flow.
41
+
42
+ The 'asicflow' includes the stages below. The steps syn, floorplan,
43
+ physyn, place, cts, route, and dfm have minimization associated
44
+ with them. To view the flowgraph, see the .png file.
45
+
46
+ * **import**: Sources are collected and packaged for compilation
47
+ * **syn**: Translates RTL to netlist using Yosys
48
+ * **floorplan**: Floorplanning
49
+ * **physyn**: Physical Synthesis
50
+ * **place**: Global and detailed placement
51
+ * **cts**: Clock tree synthesis
52
+ * **route**: Global and detailed routing
53
+ * **dfm**: Metal fill, atenna fixes and any other post routing steps
54
+ * **export**: Export design from APR tool and merge with library GDS
55
+ * **sta**: Static timing analysis (signoff)
56
+ * **lvs**: Layout versus schematic check (signoff)
57
+ * **drc**: Design rule check (signoff)
58
+
59
+ The syn, physyn, place, cts, route steps supports per process
60
+ options that can be set up by setting '<step>_np'
61
+ arg to a value > 1, as detailed below:
62
+
63
+ * syn_np : Number of parallel synthesis jobs to launch
64
+ * floorplan_np : Number of parallel floorplan jobs to launch
65
+ * physyn_np : Number of parallel physical synthesis jobs to launch
66
+ * place_np : Number of parallel place jobs to launch
67
+ * cts_np : Number of parallel clock tree synthesis jobs to launch
68
+ * route_np : Number of parallel routing jobs to launch
69
+ '''
70
+
71
+ flow = siliconcompiler.Flow(chip, flowname)
72
+
73
+ # Linear flow, up until branch to run parallel verification steps.
74
+ longpipe = ['syn',
75
+ 'synmin',
76
+ 'floorplan',
77
+ 'floorplanmin',
78
+ 'place',
79
+ 'placemin',
80
+ 'cts',
81
+ 'ctsmin',
82
+ 'route',
83
+ 'routemin',
84
+ 'dfm']
85
+
86
+ # step --> task
87
+ tasks = {
88
+ 'syn': syn_asic,
89
+ 'synmin': minimum,
90
+ 'floorplan': floorplan,
91
+ 'floorplanmin': minimum,
92
+ 'physyn': physyn,
93
+ 'physynmin': minimum,
94
+ 'place': place,
95
+ 'placemin': minimum,
96
+ 'cts': cts,
97
+ 'ctsmin': minimum,
98
+ 'route': route,
99
+ 'routemin': minimum,
100
+ 'dfm': dfm
101
+ }
102
+
103
+ np = {
104
+ "syn": syn_np,
105
+ "floorplan": floorplan_np,
106
+ "physyn": physyn_np,
107
+ "place": place_np,
108
+ "cts": cts_np,
109
+ "route": route_np
110
+ }
111
+
112
+ prevstep = None
113
+ # Remove built in steps where appropriate
114
+ flowpipe = []
115
+ for step in longpipe:
116
+ task = tasks[step]
117
+ if task == minimum:
118
+ if prevstep in np and np[prevstep] > 1:
119
+ flowpipe.append(step)
120
+ else:
121
+ flowpipe.append(step)
122
+ prevstep = step
123
+
124
+ flowtasks = []
125
+ for step in flowpipe:
126
+ flowtasks.append((step, tasks[step]))
127
+
128
+ # Programmatically build linear portion of flowgraph and fanin/fanout args
129
+ prevstep = setup_multiple_frontends(chip, flow)
130
+ for step, task in flowtasks:
131
+ fanout = 1
132
+ if step in np:
133
+ fanout = np[step]
134
+ # create nodes
135
+ for index in range(fanout):
136
+ # nodes
137
+ flow.node(flowname, step, task, index=index)
138
+
139
+ # edges
140
+ if task == minimum:
141
+ fanin = 1
142
+ if prevstep in np:
143
+ fanin = np[prevstep]
144
+ for i in range(fanin):
145
+ flow.edge(flowname, prevstep, step, tail_index=i)
146
+ elif prevstep:
147
+ flow.edge(flowname, prevstep, step, head_index=index)
148
+
149
+ # metrics
150
+ goal_metrics = ()
151
+ weight_metrics = ()
152
+ if task in (syn_asic, ):
153
+ goal_metrics = ('errors',)
154
+ weight_metrics = ()
155
+ elif task in (floorplan, physyn, place, cts, route, dfm):
156
+ goal_metrics = ('errors', 'setupwns', 'setuptns')
157
+ weight_metrics = ('cellarea', 'peakpower', 'leakagepower')
158
+
159
+ for metric in goal_metrics:
160
+ flow.set('flowgraph', flowname, step, str(index), 'goal', metric, 0)
161
+ for metric in weight_metrics:
162
+ flow.set('flowgraph', flowname, step, str(index), 'weight', metric, 1.0)
163
+ prevstep = step
164
+
165
+ # add write information steps
166
+ flow.node(flowname, 'write_gds', klayout_export)
167
+ flow.edge(flowname, prevstep, 'write_gds')
168
+ flow.node(flowname, 'write_data', openroad_export)
169
+ flow.edge(flowname, prevstep, 'write_data')
170
+
171
+ return flow
172
+
173
+
174
+ ##################################################
175
+ if __name__ == "__main__":
176
+ chip = siliconcompiler.Chip('design')
177
+ chip.set('input', 'constraint', 'sdc', 'test')
178
+ flow = make_docs(chip)
179
+ chip.use(flow)
180
+ chip.write_flowgraph(f"{flow.top()}.png", flow=flow.top())
@@ -0,0 +1,38 @@
1
+ import siliconcompiler
2
+
3
+ from siliconcompiler.tools.surelog import parse as surelog_parse
4
+ from siliconcompiler.tools.yosys import syn_asic
5
+ from siliconcompiler.tools.klayout import export
6
+ from siliconcompiler.flows._common import _make_docs
7
+
8
+
9
+ def setup(chip):
10
+ '''A flow for stitching together hardened blocks without doing any automated
11
+ place-and-route.
12
+
13
+ This flow generates a GDS and a netlist for passing to a
14
+ verification/signoff flow.
15
+ '''
16
+ flow = siliconcompiler.Flow(chip, 'asictopflow')
17
+
18
+ flow.node(flow.design, 'import', surelog_parse)
19
+ flow.node(flow.design, 'syn', syn_asic)
20
+ flow.node(flow.design, 'export', export)
21
+
22
+ flow.edge(flow.design, 'import', 'export')
23
+ flow.edge(flow.design, 'import', 'syn')
24
+
25
+ # Set default goal
26
+ for step in flow.getkeys('flowgraph', flow.design):
27
+ flow.set('flowgraph', flow.design, step, '0', 'goal', 'errors', 0)
28
+
29
+ return flow
30
+
31
+
32
+ ##################################################
33
+ if __name__ == "__main__":
34
+ chip = siliconcompiler.Chip('design')
35
+ _make_docs(chip)
36
+ flow = setup(chip)
37
+ chip.use(flow)
38
+ chip.write_flowgraph(f"{flow.top()}.png", flow=flow.top())
@@ -0,0 +1,86 @@
1
+ import siliconcompiler
2
+
3
+ from siliconcompiler.tools.icarus import compile as icarus_compile
4
+ from siliconcompiler.tools.verilator import compile as verilator_compile
5
+ from siliconcompiler.tools.execute import exec_input
6
+
7
+
8
+ ############################################################################
9
+ # DOCS
10
+ ############################################################################
11
+ def make_docs(chip):
12
+ chip.set('input', 'rtl', 'netlist', 'test')
13
+ return setup(chip, np=5)
14
+
15
+
16
+ #############################################################################
17
+ # Flowgraph Setup
18
+ #############################################################################
19
+ def setup(chip,
20
+ flowname='dvflow',
21
+ tool='icarus',
22
+ np=1):
23
+ '''
24
+ A configurable constrained random stimulus DV flow.
25
+
26
+ The verification pipeline includes the following steps:
27
+
28
+ * **compile**: RTL sources are compiled into object form (once)
29
+ * **sim**: Compiled RTL is exercised using generated test
30
+
31
+ The dvflow can be parametrized using a single 'np' parameter.
32
+ Setting 'np' > 1 results in multiple independent verification
33
+ pipelines to be launched.
34
+
35
+ This flow is a WIP
36
+ '''
37
+
38
+ flow = siliconcompiler.Flow(chip, flowname)
39
+
40
+ tasks = {
41
+ 'compile': None,
42
+ 'sim': None
43
+ }
44
+
45
+ if tool == 'icarus':
46
+ tasks['compile'] = icarus_compile
47
+ tasks['sim'] = exec_input
48
+ elif tool == 'verilator':
49
+ tasks['compile'] = verilator_compile
50
+ tasks['sim'] = exec_input
51
+ else:
52
+ raise ValueError(f'{tool} is not a supported tool for {flowname}: icarus')
53
+
54
+ flowpipe = [
55
+ 'compile',
56
+ 'sim'
57
+ ]
58
+ flow_np = {
59
+ 'compile': 1,
60
+ 'sim': np
61
+ }
62
+
63
+ prevstep = None
64
+ # Flow setup
65
+ for step in flowpipe:
66
+ task = tasks[step]
67
+
68
+ parallel = flow_np[step]
69
+
70
+ for n in range(parallel):
71
+ flow.node(flowname, step, task, index=n)
72
+
73
+ if prevstep:
74
+ flow.edge(flowname, prevstep, step, tail_index=0, head_index=n)
75
+
76
+ prevstep = step
77
+
78
+ return flow
79
+
80
+
81
+ ##################################################
82
+ if __name__ == "__main__":
83
+ chip = siliconcompiler.Chip('design')
84
+ flow = make_docs(chip)
85
+ chip.use(flow)
86
+ chip.write_flowgraph(f"{flow.top()}.png", flow=flow.top())
@@ -0,0 +1,202 @@
1
+ import siliconcompiler
2
+ import re
3
+
4
+ from siliconcompiler import SiliconCompilerError
5
+ from siliconcompiler.flows._common import setup_multiple_frontends
6
+ from siliconcompiler.flows._common import _make_docs
7
+
8
+ from siliconcompiler.tools.yosys import syn_fpga as yosys_syn
9
+ from siliconcompiler.tools.vpr import place as vpr_place
10
+ from siliconcompiler.tools.vpr import route as vpr_route
11
+ from siliconcompiler.tools.genfasm import bitstream as genfasm_bitstream
12
+
13
+ from siliconcompiler.tools.vivado import syn_fpga as vivado_syn
14
+ from siliconcompiler.tools.vivado import place as vivado_place
15
+ from siliconcompiler.tools.vivado import route as vivado_route
16
+ from siliconcompiler.tools.vivado import bitstream as vivado_bitstream
17
+
18
+ from siliconcompiler.tools.nextpnr import apr as nextpnr_apr
19
+
20
+
21
+ ############################################################################
22
+ # DOCS
23
+ ############################################################################
24
+ def make_docs(chip):
25
+ _make_docs(chip)
26
+ chip.set('fpga', 'partname', 'example_arch')
27
+ return setup(chip)
28
+
29
+
30
+ ############################################################################
31
+ # Flowgraph Setup
32
+ ############################################################################
33
+ def setup(chip, flowname='fpgaflow', fpgaflow_type=None, partname=None):
34
+ '''
35
+ A configurable FPGA compilation flow.
36
+
37
+ The 'fpgaflow' module is a configurable FPGA flow with support for
38
+ open source and commercial tool flows.
39
+
40
+ The following step convention is recommended for VPR.
41
+
42
+ * **import**: Sources are collected and packaged for compilation
43
+ * **syn**: Synthesize RTL into an device specific netlist
44
+ * **place**: FPGA specific placement step
45
+ * **route**: FPGA specific routing step
46
+ * **bitstream**: Bitstream generation
47
+
48
+ Note that nextpnr does not appear to support breaking placement, routing,
49
+ and bitstream generation into individual steps, leading to the following
50
+ recommended step convention
51
+
52
+ * **import**: Sources are collected and packaged for compilation
53
+ * **syn**: Synthesize RTL into an device specific netlist
54
+ * **apr**: One-step execution of place, route, bitstream with nextpnr
55
+
56
+ Args:
57
+ - fpgaflow_type (str): this parameter can be used to select a specific
58
+ fpga flow instead of one selected from the partname.
59
+ - partname (str): this parameter can be used to select a specific fpga
60
+ flow instead of one selected from the partname set in the schema.
61
+ '''
62
+
63
+ flow = siliconcompiler.Flow(chip, flowname)
64
+
65
+ if not partname:
66
+ partname = chip.get('fpga', 'partname')
67
+
68
+ if fpgaflow_type:
69
+ flow_pipe = flow_lookup_by_type(fpgaflow_type)
70
+ else:
71
+ flow_pipe = flow_lookup(partname)
72
+
73
+ # Minimal setup
74
+ prevstep = setup_multiple_frontends(chip, flow)
75
+ for step, tool_module in flow_pipe:
76
+ # Flow
77
+ flow.node(flowname, step, tool_module)
78
+ if prevstep:
79
+ flow.edge(flowname, prevstep, step)
80
+ # Hard goals
81
+ for metric in ('errors', 'warnings', 'drvs', 'unconstrained',
82
+ 'holdwns', 'holdtns', 'holdpaths',
83
+ 'setupwns', 'setuptns', 'setuppaths'):
84
+ flow.set('flowgraph', flowname, step, '0', 'goal', metric, 0)
85
+ # Metrics
86
+ for metric in ('luts', 'dsps', 'brams', 'registers', 'pins'):
87
+ flow.set('flowgraph', flowname, step, '0', 'weight', metric, 1.0)
88
+ prevstep = step
89
+
90
+ return flow
91
+
92
+
93
+ ##################################################
94
+ def flow_lookup_by_type(name):
95
+ '''
96
+ Returns a list for the the flow selected based on name of the flow type.
97
+ '''
98
+
99
+ vivado_flow = [
100
+ ('syn_fpga', vivado_syn),
101
+ ('place', vivado_place),
102
+ ('route', vivado_route),
103
+ ('bitstream', vivado_bitstream)]
104
+ nextpnr_flow = [('syn', yosys_syn),
105
+ ('apr', nextpnr_apr)]
106
+ vpr_flow = [('syn', yosys_syn),
107
+ ('place', vpr_place),
108
+ ('route', vpr_route),
109
+ ('bitstream', genfasm_bitstream)]
110
+
111
+ flow_map = {
112
+ "vivado": vivado_flow,
113
+ "nextpnr": nextpnr_flow,
114
+ "vpr": vpr_flow
115
+ }
116
+
117
+ if name not in flow_map:
118
+ raise SiliconCompilerError(f'{name} is not a supported FPGA flow type')
119
+
120
+ return flow_map[name]
121
+
122
+
123
+ ##################################################
124
+ def flow_lookup(partname):
125
+ '''
126
+ Returns a list for the the flow selected based on the part number
127
+ regular expression.
128
+ '''
129
+
130
+ if not partname:
131
+ raise SiliconCompilerError('A part number must be specified to setup the fpga flow.')
132
+
133
+ partname = partname.lower()
134
+
135
+ ###########
136
+ # xilinx
137
+ ###########
138
+
139
+ spartan6 = bool(re.match('^xc6', partname))
140
+ spartan7 = bool(re.match('^xc7s', partname))
141
+ artix = bool(re.match('^xc7a', partname))
142
+ artixultra = bool(re.match('^au', partname))
143
+ kintex7 = bool(re.match('^xc7k', partname))
144
+ kintexultra = bool(re.match('^xcku', partname))
145
+ zynq = bool(re.match(r'^z\-7', partname))
146
+ zynqultra = bool(re.match('^zu', partname))
147
+ virtex7 = bool(re.match('^xc7v', partname))
148
+ virtexultra = bool(re.match('^xcvu', partname))
149
+
150
+ xilinx = spartan6 or spartan7 or \
151
+ artix or artixultra or \
152
+ kintex7 or kintexultra or \
153
+ zynq or zynqultra or \
154
+ virtex7 or virtexultra
155
+
156
+ #############
157
+ # intel
158
+ #############
159
+
160
+ cyclone4 = bool(re.match('^ep4', partname))
161
+ cyclone5 = bool(re.match('^5cs', partname))
162
+ cyclone10 = bool(re.match('^10cl', partname))
163
+ stratix5 = bool(re.match('^5sg', partname))
164
+
165
+ intel = cyclone10 or cyclone4 or cyclone5 or stratix5
166
+
167
+ ###########
168
+ # lattice
169
+ ###########
170
+
171
+ ice40 = re.match('^ice40', partname)
172
+
173
+ ###########
174
+ # example
175
+ ###########
176
+
177
+ example = re.match('^example_arch', partname)
178
+
179
+ flow = None
180
+ if xilinx:
181
+ flow = flow_lookup_by_type('vivado')
182
+ elif intel:
183
+ flow = flow_lookup_by_type('intel')
184
+ elif ice40:
185
+ flow = flow_lookup_by_type('nextpnr')
186
+ elif example:
187
+ flow = flow_lookup_by_type('vpr')
188
+
189
+ if not flow:
190
+ raise SiliconCompilerError(
191
+ f'fpgaflow: unsupported partname {partname}'
192
+ )
193
+
194
+ return flow
195
+
196
+
197
+ ##################################################
198
+ if __name__ == "__main__":
199
+ chip = siliconcompiler.Chip('design')
200
+ flow = make_docs(chip)
201
+ chip.use(flow)
202
+ chip.write_flowgraph(f"{flow.top()}.png", flow=flow.top())
@@ -0,0 +1,66 @@
1
+ import siliconcompiler
2
+
3
+ from siliconcompiler.tools.openroad import rcx_bench
4
+ from siliconcompiler.tools.openroad import rcx_extract
5
+ from siliconcompiler.tools.builtin import nop
6
+ from siliconcompiler.flows._common import _make_docs
7
+
8
+
9
+ ############################################################################
10
+ # DOCS
11
+ ############################################################################
12
+ def make_docs(chip):
13
+ _make_docs(chip)
14
+ return setup(chip, corners=5)
15
+
16
+
17
+ ###########################################################################
18
+ # Flowgraph Setup
19
+ ############################################################################
20
+ def setup(chip, extraction_task=None, corners=1, serial_extraction=False):
21
+ '''
22
+ Flow to generate the OpenRCX decks needed by OpenROAD to do parasitic
23
+ extraction.
24
+ '''
25
+
26
+ flowname = 'generate_rcx'
27
+ flow = siliconcompiler.Flow(chip, flowname)
28
+
29
+ if not extraction_task:
30
+ chip.logger.warning('Valid extraction not specified, defaulting to builtin/nop')
31
+ extraction_task = nop
32
+
33
+ flow.node(flowname, 'bench', rcx_bench)
34
+ prev = 'bench'
35
+ for corner in range(corners):
36
+ # For each corner generate a pex step to build the reference SPEF file
37
+ # and the extract step to use the SPEF file to build the new OpenRCX deck
38
+ flow.node(flowname, 'pex', extraction_task, index=corner)
39
+ flow.node(flowname, 'extract', rcx_extract, index=corner)
40
+
41
+ if corner == 0:
42
+ prev = 'bench'
43
+ prev_index = 0
44
+ else:
45
+ prev = 'pex'
46
+ prev_index = corner - 1
47
+
48
+ flow.edge(flowname, 'bench', 'pex', head_index=corner, tail_index=0)
49
+ flow.edge(flowname, 'pex', 'extract', head_index=corner, tail_index=corner)
50
+ flow.edge(flowname, 'bench', 'extract', head_index=corner, tail_index=0)
51
+
52
+ if serial_extraction and corner > 0:
53
+ # For license restrictions make each pex step dependent on the previous pex step
54
+ flow.edge(flowname, prev, 'pex', head_index=corner, tail_index=prev_index)
55
+
56
+ flow.node(flowname, 'bench', rcx_bench)
57
+
58
+ return flow
59
+
60
+
61
+ ##################################################
62
+ if __name__ == "__main__":
63
+ chip = siliconcompiler.Chip('design')
64
+ flow = make_docs(chip)
65
+ chip.use(flow)
66
+ chip.write_flowgraph(f"{flow.top()}.png", flow=flow.top())
@@ -0,0 +1,35 @@
1
+ import siliconcompiler
2
+
3
+ from siliconcompiler.flows._common import _make_docs
4
+ from siliconcompiler.tools.verilator import lint as verilator_lint
5
+ from siliconcompiler.tools.slang import lint as slang_lint
6
+
7
+
8
+ ###########################################################################
9
+ # Flowgraph Setup
10
+ ############################################################################
11
+ def setup(chip, tool='verilator'):
12
+ '''
13
+ An RTL linting flow.
14
+ '''
15
+
16
+ flowname = 'lintflow'
17
+ flow = siliconcompiler.Flow(chip, flowname)
18
+
19
+ if tool == 'verilator':
20
+ flow.node(flowname, 'lint', verilator_lint)
21
+ elif tool == 'slang':
22
+ flow.node(flowname, 'lint', slang_lint)
23
+ else:
24
+ raise ValueError(f'Unsupported lint tool: {tool}')
25
+
26
+ return flow
27
+
28
+
29
+ ##################################################
30
+ if __name__ == "__main__":
31
+ chip = siliconcompiler.Chip('design')
32
+ _make_docs(chip)
33
+ flow = setup(chip)
34
+ chip.use(flow)
35
+ chip.write_flowgraph(f"{flow.top()}.png", flow=flow.top())
@@ -0,0 +1,51 @@
1
+ from siliconcompiler import Chip, Flow
2
+
3
+ from siliconcompiler.tools.klayout import operations
4
+ from siliconcompiler.tools.klayout import screenshot
5
+ from siliconcompiler.tools.montage import tile
6
+
7
+
8
+ def make_docs(chip):
9
+ chip.set('input', 'layout', 'gds', 'test')
10
+ chip.set('tool', 'klayout', 'task', 'screenshot', 'var', 'xbins', 2)
11
+ chip.set('tool', 'klayout', 'task', 'screenshot', 'var', 'ybins', 2)
12
+ chip.set('tool', 'montage', 'task', 'tile', 'var', 'xbins', 2)
13
+ chip.set('tool', 'montage', 'task', 'tile', 'var', 'ybins', 2)
14
+ return setup(chip)
15
+
16
+
17
+ def setup(chip, flowname='screenshotflow'):
18
+ '''
19
+ Flow to generate a high resolution design image from a GDS or OAS file.
20
+
21
+ The 'screenshotflow' includes the stages below.
22
+
23
+ * **prepare**: Prepare the stream file, such as flattening design, removing layers, and merging shapes
24
+ * **screenshot**: Generate a set of screenshots tiled across the design
25
+ * **merge**: Merge tiled images into a single image
26
+ ''' # noqa E501
27
+
28
+ pipe = [
29
+ ('prepare', operations),
30
+ ('screenshot', screenshot),
31
+ ('merge', tile)
32
+ ]
33
+
34
+ flow = Flow(chip, flowname)
35
+
36
+ prevstep = None
37
+ for step, task in pipe:
38
+ flow.node(flowname, step, task)
39
+ if prevstep:
40
+ flow.edge(flowname, prevstep, step)
41
+ prevstep = step
42
+
43
+ return flow
44
+
45
+
46
+ ##################################################
47
+ if __name__ == "__main__":
48
+ chip = Chip('design')
49
+ flow = make_docs(chip)
50
+ chip.use(flow)
51
+ chip.write_flowgraph(f"{flow.top()}.png", flow=flow.top())