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,423 @@
1
+ #######################
2
+ # Global Placement
3
+ #######################
4
+
5
+ proc sc_global_placement_density {} {
6
+ global openroad_gpl_padding
7
+ global openroad_gpl_place_density
8
+ global openroad_gpl_uniform_placement_adjustment
9
+
10
+ set or_uniform_density [gpl::get_global_placement_uniform_density \
11
+ -pad_left $openroad_gpl_padding \
12
+ -pad_right $openroad_gpl_padding]
13
+
14
+ # Small adder to ensure requested density is slightly over the uniform density
15
+ set or_adjust_density_adder 0.001
16
+
17
+ set selected_density $openroad_gpl_place_density
18
+
19
+ # User specified adjustment
20
+ if { $openroad_gpl_uniform_placement_adjustment > 0.0 } {
21
+ set or_uniform_adjusted_density \
22
+ [expr { $or_uniform_density + ((1.0 - $or_uniform_density) * \
23
+ $openroad_gpl_uniform_placement_adjustment) + $or_adjust_density_adder }]
24
+ if { $or_uniform_adjusted_density > 1.00 } {
25
+ utl::warn FLW 1 "Adjusted density exceeds 1.00 ([format %0.3f $or_uniform_adjusted_density]),\
26
+ reverting to use ($openroad_gpl_place_density) for global placement"
27
+ set selected_density $openroad_gpl_place_density
28
+ } else {
29
+ utl::info FLW 1 "Using computed density of ([format %0.3f $or_uniform_adjusted_density])\
30
+ for global placement"
31
+ set selected_density $or_uniform_adjusted_density
32
+ }
33
+ }
34
+
35
+ # Final selection
36
+ set or_uniform_zero_adjusted_density \
37
+ [expr { min($or_uniform_density + $or_adjust_density_adder, 1.0) }]
38
+
39
+ if { $selected_density < $or_uniform_density } {
40
+ utl::warn FLW 1 "Using computed density of ([format %0.3f $or_uniform_zero_adjusted_density])\
41
+ for global placement as [format %0.3f $selected_density] < [format %0.3f $or_uniform_density]"
42
+ set selected_density $or_uniform_zero_adjusted_density
43
+ }
44
+
45
+ return $selected_density
46
+ }
47
+
48
+ proc sc_global_placement { args } {
49
+ sta::parse_key_args "sc_global_placement" args \
50
+ keys {} \
51
+ flags {-skip_io -disable_routability_driven}
52
+ sta::check_argc_eq0 "sc_global_placement" $args
53
+
54
+ global openroad_gpl_routability_driven
55
+ global openroad_gpl_timing_driven
56
+ global openroad_gpl_padding
57
+
58
+ set openroad_gpl_args []
59
+ if { $openroad_gpl_routability_driven == "true" && \
60
+ ![info exists flags(-disable_routability_driven)] } {
61
+ lappend openroad_gpl_args "-routability_driven"
62
+ }
63
+ if { $openroad_gpl_timing_driven == "true" } {
64
+ lappend openroad_gpl_args "-timing_driven"
65
+ }
66
+
67
+ if { [info exists flags(-skip_io)] } {
68
+ lappend openroad_gpl_args "-skip_io"
69
+ }
70
+
71
+ global_placement {*}$openroad_gpl_args \
72
+ -density [sc_global_placement_density] \
73
+ -pad_left $openroad_gpl_padding \
74
+ -pad_right $openroad_gpl_padding
75
+ }
76
+
77
+ ###########################
78
+ # Detailed Placement
79
+ ###########################
80
+
81
+ proc sc_detailed_placement {} {
82
+ global openroad_dpl_padding
83
+ global openroad_dpl_padding
84
+ global openroad_dpl_disallow_one_site
85
+ global openroad_dpl_max_displacement
86
+
87
+ set_placement_padding -global \
88
+ -left $openroad_dpl_padding \
89
+ -right $openroad_dpl_padding
90
+
91
+ set dpl_args []
92
+ if { $openroad_dpl_disallow_one_site == "true" } {
93
+ lappend dpl_args "-disallow_one_site_gaps"
94
+ }
95
+
96
+ detailed_placement -max_displacement $openroad_dpl_max_displacement \
97
+ {*}$dpl_args
98
+ check_placement -verbose
99
+ }
100
+
101
+ ###########################
102
+ # Pin Placement
103
+ ###########################
104
+
105
+ proc sc_pin_placement { args } {
106
+ sta::parse_key_args "sc_pin_placement" args \
107
+ keys {} \
108
+ flags {-random}
109
+ sta::check_argc_eq0 "sc_pin_placement" $args
110
+
111
+ global sc_cfg
112
+ global sc_tool
113
+ global sc_task
114
+ global sc_hpinmetal
115
+ global sc_vpinmetal
116
+ global openroad_ppl_arguments
117
+
118
+ if { [sc_cfg_tool_task_exists var pin_thickness_h] } {
119
+ set h_mult [lindex [sc_cfg_tool_task_get var pin_thickness_h] 0]
120
+ set_pin_thick_multiplier -hor_multiplier $h_mult
121
+ }
122
+ if { [sc_cfg_tool_task_exists var pin_thickness_v] } {
123
+ set v_mult [lindex [sc_cfg_tool_task_get var pin_thickness_v] 0]
124
+ set_pin_thick_multiplier -ver_multiplier $v_mult
125
+ }
126
+ if { [sc_cfg_tool_task_exists {file} ppl_constraints] } {
127
+ foreach pin_constraint [sc_cfg_tool_task_get {file} ppl_constraints] {
128
+ puts "Sourcing pin constraints: ${pin_constraint}"
129
+ source $pin_constraint
130
+ }
131
+ }
132
+
133
+ set ppl_args []
134
+ if { [info exists flags(-random)] } {
135
+ lappend ppl_args "-random"
136
+ }
137
+
138
+ place_pins -hor_layers $sc_hpinmetal \
139
+ -ver_layers $sc_vpinmetal \
140
+ {*}$openroad_ppl_arguments \
141
+ {*}$ppl_args
142
+ }
143
+
144
+ ###########################
145
+ # Check if OR has a GUI
146
+ ###########################
147
+
148
+ proc sc_has_gui {} {
149
+ return [gui::supported]
150
+ }
151
+
152
+ ###########################
153
+ # Check if design has placed instances
154
+ ###########################
155
+
156
+ proc sc_has_placed_instances {} {
157
+ foreach inst [[ord::get_db_block] getInsts] {
158
+ if { [$inst isPlaced] } {
159
+ return true
160
+ }
161
+ }
162
+ return false
163
+ }
164
+
165
+ ###########################
166
+ # Check if design has unplaced instances
167
+ ###########################
168
+
169
+ proc sc_has_unplaced_instances {} {
170
+ foreach inst [[ord::get_db_block] getInsts] {
171
+ if { ![$inst isPlaced] } {
172
+ return true
173
+ }
174
+ }
175
+ return false
176
+ }
177
+
178
+ ###########################
179
+ # Check if design has routing
180
+ ###########################
181
+
182
+ proc sc_has_routing {} {
183
+ foreach net [[ord::get_db_block] getNets] {
184
+ if { [$net getWire] != "NULL" } {
185
+ return true
186
+ }
187
+ }
188
+ return false
189
+ }
190
+
191
+ ###########################
192
+ # Check if design has global routing
193
+ ###########################
194
+
195
+ proc sc_has_global_routing {} {
196
+ foreach net [[ord::get_db_block] getNets] {
197
+ if { [llength [$net getGuides]] != 0 } {
198
+ return true
199
+ }
200
+ }
201
+ return false
202
+ }
203
+
204
+ ###########################
205
+ # Design has unplaced macros
206
+ ###########################
207
+
208
+ # Function adapted from OpenROAD:
209
+ # https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/ca3004b85e0d4fbee3470115e63b83c498cfed85/flow/scripts/macro_place.tcl#L26
210
+ proc sc_design_has_unplaced_macros {} {
211
+ foreach inst [[ord::get_db_block] getInsts] {
212
+ if { [$inst isBlock] && ![$inst isFixed] } {
213
+ return true
214
+ }
215
+ }
216
+ return false
217
+ }
218
+
219
+ ###########################
220
+ # Design has unplaced pads
221
+ ###########################
222
+
223
+ proc sc_design_has_unplaced_pads {} {
224
+ foreach inst [[ord::get_db_block] getInsts] {
225
+ if { [$inst isPad] && ![$inst isFixed] } {
226
+ return true
227
+ }
228
+ }
229
+ return false
230
+ }
231
+
232
+ ###########################
233
+ # Design has placable IOs
234
+ ###########################
235
+
236
+ proc sc_design_has_placeable_ios {} {
237
+ foreach bterm [[ord::get_db_block] getBTerms] {
238
+ if { [$bterm getFirstPinPlacementStatus] != "FIXED" &&
239
+ [$bterm getFirstPinPlacementStatus] != "LOCKED" } {
240
+ return true
241
+ }
242
+ }
243
+ return false
244
+ }
245
+
246
+ ###########################
247
+ # Check if net has placed bpins
248
+ ###########################
249
+
250
+ proc sc_bterm_has_placed_io { net } {
251
+ set net [[ord::get_db_block] findNet $net]
252
+
253
+ foreach bterm [$net getBTerms] {
254
+ if { [$bterm getFirstPinPlacementStatus] != "UNPLACED" } {
255
+ return true
256
+ }
257
+ }
258
+ return false
259
+ }
260
+
261
+ ###########################
262
+ # Find nets regex
263
+ ###########################
264
+
265
+ proc sc_find_net_regex { net_name } {
266
+ set nets []
267
+
268
+ foreach net [[ord::get_db_block] getNets] {
269
+ if { [string match $net_name [$net getName]] } {
270
+ lappend nets [$net getName]
271
+ }
272
+ }
273
+
274
+ return $nets
275
+ }
276
+
277
+ ###########################
278
+ # Get supply nets in design
279
+ ###########################
280
+
281
+ proc sc_supply_nets {} {
282
+ set nets []
283
+
284
+ foreach net [[ord::get_db_block] getNets] {
285
+ set type [$net getSigType]
286
+ if { $type == "POWER" || $type == "GROUND" } {
287
+ lappend nets [$net getName]
288
+ }
289
+ }
290
+
291
+ return $nets
292
+ }
293
+
294
+ ###########################
295
+ # Get nets for PSM to check
296
+ ###########################
297
+
298
+ proc sc_psm_check_nets {} {
299
+ global openroad_psm_enable
300
+ global openroad_psm_skip_nets
301
+
302
+ if { $openroad_psm_enable == "true" } {
303
+ set psm_nets []
304
+
305
+ foreach net [sc_supply_nets] {
306
+ set skipped false
307
+ foreach skip_pattern $openroad_psm_skip_nets {
308
+ if { [string match $skip_pattern $net] } {
309
+ set skipped true
310
+ break
311
+ }
312
+ }
313
+ if { !$skipped } {
314
+ lappend psm_nets $net
315
+ }
316
+ }
317
+
318
+ return $psm_nets
319
+ }
320
+
321
+ return []
322
+ }
323
+
324
+ ###########################
325
+ # Save an image
326
+ ###########################
327
+
328
+ proc sc_save_image { title path { pixels 1000 } } {
329
+ utl::info FLW 1 "Saving \"$title\" to $path"
330
+
331
+ save_image -resolution [sc_image_resolution $pixels] \
332
+ -area [sc_image_area] \
333
+ $path
334
+ }
335
+
336
+ ###########################
337
+ # Get the image bounding box
338
+ ###########################
339
+
340
+ proc sc_image_area {} {
341
+ set box [[ord::get_db_block] getDieArea]
342
+ set width [$box dx]
343
+ set height [$box dy]
344
+
345
+ # apply 5% margin
346
+ set xmargin [expr { int(0.05 * $width) }]
347
+ set ymargin [expr { int(0.05 * $height) }]
348
+
349
+ set area []
350
+ lappend area [ord::dbu_to_microns [expr { [$box xMin] - $xmargin }]]
351
+ lappend area [ord::dbu_to_microns [expr { [$box yMin] - $ymargin }]]
352
+ lappend area [ord::dbu_to_microns [expr { [$box xMax] + $xmargin }]]
353
+ lappend area [ord::dbu_to_microns [expr { [$box yMax] + $ymargin }]]
354
+ return $area
355
+ }
356
+
357
+ ###########################
358
+ # Get the image resolution (um / pixel)
359
+ ###########################
360
+
361
+ proc sc_image_resolution { pixels } {
362
+ set box [[ord::get_db_block] getDieArea]
363
+ return [expr { [ord::dbu_to_microns [$box maxDXDY]] / $pixels }]
364
+ }
365
+
366
+ ###########################
367
+ # Clear gui selections
368
+ ###########################
369
+
370
+ proc sc_image_clear_selection {} {
371
+ gui::clear_highlights -1
372
+ gui::clear_selections
373
+ }
374
+
375
+ ###########################
376
+ # Setup default GUI setting for images
377
+ ###########################
378
+
379
+ proc sc_image_setup_default {} {
380
+ gui::restore_display_controls
381
+
382
+ sc_image_clear_selection
383
+
384
+ gui::fit
385
+
386
+ # Setup initial visibility to avoid any previous settings
387
+ gui::set_display_controls "*" visible false
388
+ gui::set_display_controls "Layers/*" visible true
389
+ gui::set_display_controls "Nets/*" visible true
390
+ gui::set_display_controls "Instances/*" visible true
391
+ gui::set_display_controls "Shape Types/*" visible true
392
+ gui::set_display_controls "Misc/Instances/*" visible true
393
+ gui::set_display_controls "Misc/Instances/Pin Names" visible false
394
+ gui::set_display_controls "Misc/Scale bar" visible true
395
+ gui::set_display_controls "Misc/Highlight selected" visible true
396
+ gui::set_display_controls "Misc/Detailed view" visible true
397
+ }
398
+
399
+ ###########################
400
+ # Count the logic depth of the critical path
401
+ ###########################
402
+
403
+ proc count_logic_depth {} {
404
+ set count 0
405
+ set paths [find_timing_paths -sort_by_slack]
406
+ if { [llength $paths] == 0 } {
407
+ return 0
408
+ }
409
+ set path_ref [[lindex $paths 0] path]
410
+ set pins [$path_ref pins]
411
+ foreach pin $pins {
412
+ if { [$pin is_driver] } {
413
+ incr count
414
+ }
415
+ set vertex [lindex [$pin vertices] 0]
416
+ # Stop at clock vertex
417
+ if { [$vertex is_clock] } {
418
+ break
419
+ }
420
+ }
421
+ # Subtract 1 to account for initial launch
422
+ return [expr { $count - 1 }]
423
+ }
@@ -0,0 +1,63 @@
1
+ ###############################
2
+ # Reading SC Schema
3
+ ###############################
4
+
5
+ source ./sc_manifest.tcl > /dev/null
6
+
7
+ ##############################
8
+ # Schema Helper functions
9
+ ###############################
10
+
11
+ proc sc_get_layer_name { name } {
12
+ if { [ string is integer $name ] } {
13
+ set layer [[ord::get_db_tech] findRoutingLayer $name]
14
+ if { $layer == "NULL" } {
15
+ utl::error FLW 1 "$name is not a valid routing layer."
16
+ }
17
+ return [$layer getName]
18
+ }
19
+ return $name
20
+ }
21
+
22
+ ##############################
23
+ # Schema Adapter
24
+ ###############################
25
+
26
+ set sc_tool openroad
27
+ set sc_step [sc_cfg_get arg step]
28
+ set sc_index [sc_cfg_get arg index]
29
+ set sc_flow [sc_cfg_get option flow]
30
+ set sc_task [sc_cfg_get flowgraph $sc_flow $sc_step $sc_index task]
31
+
32
+ set sc_refdir [sc_cfg_tool_task_get refdir]
33
+
34
+ # Design
35
+ set sc_design [sc_top]
36
+ set sc_pdk [sc_cfg_get option pdk]
37
+ set sc_stackup [sc_cfg_get option stackup]
38
+
39
+ # Library
40
+ set sc_libtype [lindex [sc_cfg_tool_task_get {var} libtype] 0]
41
+
42
+ # PDK Design Rules
43
+ set sc_techlef [sc_cfg_get pdk $sc_pdk aprtech openroad $sc_stackup $sc_libtype lef]
44
+
45
+ set sc_threads [sc_cfg_tool_task_get threads]
46
+
47
+ ###############################
48
+ # Read Files
49
+ ###############################
50
+
51
+ # Read techlef
52
+ puts "Reading tech LEF: $sc_techlef"
53
+ read_lef $sc_techlef
54
+
55
+ ###############################
56
+ # Run task
57
+ ###############################
58
+
59
+ set_thread_count $sc_threads
60
+
61
+ utl::set_metrics_stage "sc__step__{}"
62
+ source -echo "${sc_refdir}/sc_${sc_task}.tcl"
63
+ utl::pop_metrics_stage
@@ -0,0 +1,20 @@
1
+ #https://github.com/The-OpenROAD-Project/OpenROAD/blob/9b52b1d9cfb532f9872739ffe482afb5ac9def92/src/rcx/calibration/script/generate_rules.tcl
2
+
3
+ set openroad_bench_length \
4
+ [lindex [sc_cfg_tool_task_get {var} bench_length] 0]
5
+
6
+ set sc_maxmetal \
7
+ [sc_get_layer_name [lindex [sc_cfg_tool_task_get {var} max_layer] 0]]
8
+ set openroad_top_metal_number [[[ord::get_db_tech] findLayer $sc_maxmetal] getRoutingLevel]
9
+
10
+ # Creates the patterns and
11
+ # store it in the database
12
+ bench_wires \
13
+ -len $openroad_bench_length \
14
+ -met_cnt $openroad_top_metal_number \
15
+ -all
16
+
17
+ # Writes the verilog netlist
18
+ # of the patterns
19
+ bench_verilog "outputs/${sc_design}.vg"
20
+ write_def "outputs/${sc_design}.def"
@@ -0,0 +1,12 @@
1
+ # https://github.com/The-OpenROAD-Project/OpenROAD/blob/9b52b1d9cfb532f9872739ffe482afb5ac9def92/src/rcx/calibration/script/generate_rules.tcl
2
+
3
+ set openroad_corner [lindex [sc_cfg_tool_task_get {var} corner] 0]
4
+
5
+ # Read the patterns design
6
+ read_def "inputs/${sc_design}.def"
7
+
8
+ # Read the parasitics of the patterns
9
+ bench_read_spef "inputs/${sc_design}.${openroad_corner}.spef"
10
+
11
+ # Convert the parasitics into openrcx format
12
+ write_rules -db -file "outputs/${sc_design}.${openroad_corner}.rcx"
@@ -0,0 +1,133 @@
1
+ ##########################################################
2
+ # ROUTING
3
+ ##########################################################
4
+
5
+ #######################
6
+ # Helper functions
7
+ #######################
8
+
9
+ proc insert_fillers {} {
10
+ upvar sc_filler sc_filler
11
+ if { $sc_filler != "" } {
12
+ filler_placement $sc_filler
13
+ }
14
+
15
+ check_placement -verbose
16
+
17
+ global_connect
18
+ }
19
+
20
+ #######################
21
+ # Add Fillers
22
+ #######################
23
+
24
+ insert_fillers
25
+
26
+ ######################
27
+ # Setup detailed route options
28
+ ######################
29
+
30
+ foreach via $openroad_drt_default_vias {
31
+ utl::info FLW 1 "Marking $via a default routing via"
32
+ detailed_route_set_default_via $via
33
+ }
34
+ foreach layer $openroad_drt_unidirectional_layers {
35
+ utl::info FLW 1 "Marking $layer as a unidirectional routing layer"
36
+ detailed_route_set_unidirectional_layer $layer
37
+ }
38
+
39
+ ######################
40
+ # GLOBAL ROUTE
41
+ ######################
42
+
43
+ # Pin access
44
+ if { $openroad_grt_use_pin_access == "true" } {
45
+ set openroad_pin_access_args []
46
+ if { $openroad_drt_process_node != "false" } {
47
+ lappend openroad_pin_access_args "-db_process_node" $openroad_drt_process_node
48
+ }
49
+
50
+ pin_access -bottom_routing_layer $sc_minmetal \
51
+ -top_routing_layer $sc_maxmetal \
52
+ {*}$openroad_pin_access_args
53
+ }
54
+
55
+ set sc_grt_arguments []
56
+ if { $openroad_grt_allow_congestion == "true" } {
57
+ lappend sc_grt_arguments "-allow_congestion"
58
+ }
59
+ if { $openroad_grt_allow_overflow == "true" } {
60
+ lappend sc_grt_arguments "-allow_overflow"
61
+ }
62
+
63
+ global_route -guide_file "./route.guide" \
64
+ -congestion_iterations $openroad_grt_overflow_iter \
65
+ -congestion_report_file "reports/${sc_design}_congestion.rpt" \
66
+ -verbose \
67
+ {*}$sc_grt_arguments
68
+
69
+ ######################
70
+ # Report and Repair Antennas
71
+ ######################
72
+
73
+ estimate_parasitics -global_routing
74
+ if { $openroad_ant_check == "true" && \
75
+ [check_antennas -report_file "reports/${sc_design}_antenna.rpt"] != 0 } {
76
+ if { $openroad_ant_repair == "true" && \
77
+ [llength [sc_cfg_get library $sc_mainlib asic cells antenna]] != 0 } {
78
+ set sc_antenna [lindex [sc_cfg_get library $sc_mainlib asic cells antenna] 0]
79
+
80
+ # Remove filler cells before attempting to repair antennas
81
+ remove_fillers
82
+
83
+ repair_antenna $sc_antenna \
84
+ -iterations $openroad_ant_iterations \
85
+ -ratio_margin $openroad_ant_margin
86
+
87
+ # Add filler cells back
88
+ insert_fillers
89
+
90
+ # Check antennas again to get final report
91
+ check_antennas -report_file "reports/${sc_design}_antenna_post_repair.rpt"
92
+ }
93
+ }
94
+
95
+ ######################
96
+ # Detailed Route
97
+ ######################
98
+
99
+ set openroad_drt_arguments []
100
+ if { $openroad_drt_disable_via_gen == "true" } {
101
+ lappend openroad_drt_arguments "-disable_via_gen"
102
+ }
103
+ if { $openroad_drt_process_node != "" } {
104
+ lappend openroad_drt_arguments "-db_process_node" $openroad_drt_process_node
105
+ }
106
+ if { $openroad_drt_via_in_pin_bottom_layer != "" } {
107
+ lappend openroad_drt_arguments "-via_in_pin_bottom_layer" $openroad_drt_via_in_pin_bottom_layer
108
+ }
109
+ if { $openroad_drt_via_in_pin_top_layer != "" } {
110
+ lappend openroad_drt_arguments "-via_in_pin_top_layer" $openroad_drt_via_in_pin_top_layer
111
+ }
112
+ if { $openroad_drt_repair_pdn_vias != "" } {
113
+ lappend openroad_drt_arguments "-repair_pdn_vias" $openroad_drt_repair_pdn_vias
114
+ }
115
+
116
+ detailed_route -save_guide_updates \
117
+ -output_drc "reports/${sc_design}_drc.rpt" \
118
+ -output_maze "reports/${sc_design}_maze.log" \
119
+ -bottom_routing_layer $sc_minmetal \
120
+ -top_routing_layer $sc_maxmetal \
121
+ -verbose 1 \
122
+ {*}$openroad_drt_arguments
123
+
124
+ #########################
125
+ # Correct violations with the power grid
126
+ #########################
127
+
128
+ if { $openroad_drt_via_repair_post_route == "true" } {
129
+ repair_pdn_vias -all
130
+ }
131
+
132
+ # estimate for metrics
133
+ estimate_parasitics -global_routing
@@ -0,0 +1,21 @@
1
+ gui::save_display_controls
2
+
3
+ set sc_resolution \
4
+ [lindex [sc_cfg_tool_task_get {var} show_vertical_resolution] 0]
5
+
6
+ # Show the drc markers (if any)
7
+ if { [file exists reports/${sc_design}_drc.rpt] } {
8
+ gui::load_drc reports/${sc_design}_drc.rpt
9
+ }
10
+
11
+ sc_image_setup_default
12
+
13
+ sc_save_image "screenshot" "outputs/${sc_design}.png" $sc_resolution
14
+
15
+ gui::restore_display_controls
16
+
17
+ if { [sc_cfg_tool_task_exists {var} include_report_images] &&
18
+ [lindex [sc_cfg_tool_task_get {var} include_report_images] 0]
19
+ == "true" } {
20
+ source -echo "${sc_refdir}/sc_write_images.tcl"
21
+ }
@@ -0,0 +1,5 @@
1
+ write_db "outputs/${sc_design}.odb"
2
+ write_sdc "outputs/${sc_design}.sdc"
3
+
4
+ write_def "outputs/${sc_design}.def"
5
+ write_verilog -include_pwr_gnd "outputs/${sc_design}.vg"