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,413 @@
1
+ ########################################################
2
+ # FLOORPLANNING
3
+ ########################################################
4
+
5
+ ###########################
6
+ # Setup Global Connections
7
+ ###########################
8
+
9
+ if { [sc_cfg_tool_task_exists {file} global_connect] } {
10
+ foreach global_connect [sc_cfg_tool_task_get {file} global_connect] {
11
+ puts "Sourcing global connect configuration: ${global_connect}"
12
+ source $global_connect
13
+ }
14
+ }
15
+
16
+ ###########################
17
+ # Initialize floorplan
18
+ ###########################
19
+
20
+ if { [sc_cfg_exists input asic floorplan] } {
21
+ set def [lindex [sc_cfg_get input asic floorplan] 0]
22
+ puts "Reading floorplan DEF: ${def}"
23
+ read_def -floorplan_initialize $def
24
+ } else {
25
+ #NOTE: assuming a two tuple value as lower left, upper right
26
+ set sc_diearea [sc_cfg_get constraint outline]
27
+ set sc_corearea [sc_cfg_get constraint corearea]
28
+ if { $sc_diearea != "" && \
29
+ $sc_corearea != "" } {
30
+ # Use die and core sizes
31
+ set sc_diesize "[lindex $sc_diearea 0] [lindex $sc_diearea 1]"
32
+ set sc_coresize "[lindex $sc_corearea 0] [lindex $sc_corearea 1]"
33
+
34
+ initialize_floorplan -die_area $sc_diesize \
35
+ -core_area $sc_coresize \
36
+ -site $sc_site
37
+ } else {
38
+ # Use density
39
+ initialize_floorplan -aspect_ratio [sc_cfg_get constraint aspectratio] \
40
+ -utilization [sc_cfg_get constraint density] \
41
+ -core_space [sc_cfg_get constraint coremargin] \
42
+ -site $sc_site
43
+ }
44
+ }
45
+
46
+ puts "Floorplan information:"
47
+ puts "Die area: [ord::get_die_area]"
48
+ puts "Core area: [ord::get_core_area]"
49
+
50
+ ###########################
51
+ # Track Creation
52
+ ###########################
53
+
54
+ # source tracks from file if found, else else use schema entries
55
+ if { [sc_cfg_exists library $sc_mainlib option file openroad_tracks] } {
56
+ set tracks_file [lindex [sc_cfg_get library $sc_mainlib option file openroad_tracks] 0]
57
+ puts "Sourcing tracks configuration: ${tracks_file}"
58
+ source $tracks_file
59
+ } else {
60
+ make_tracks
61
+ }
62
+
63
+ set do_automatic_pins 1
64
+ if { [sc_cfg_tool_task_exists file padring] && \
65
+ [llength [sc_cfg_tool_task_get file padring]] > 0 } {
66
+ set do_automatic_pins 0
67
+
68
+ ###########################
69
+ # Generate pad ring
70
+ ###########################
71
+ foreach padring_file [sc_cfg_tool_task_get {file} padring] {
72
+ puts "Sourcing padring configuration: ${padring_file}"
73
+ source $padring_file
74
+ }
75
+
76
+ if { [sc_design_has_unplaced_pads] } {
77
+ foreach inst [[ord::get_db_block] getInsts] {
78
+ if { [$inst isPad] && ![$inst isFixed] } {
79
+ utl::warn FLW 1 "[$inst getName] has not been placed"
80
+ }
81
+ }
82
+ utl::error FLW 1 "Design contains unplaced IOs"
83
+ }
84
+ }
85
+
86
+ ###########################
87
+ # Pin placement
88
+ ###########################
89
+ if { [sc_cfg_exists constraint pin] } {
90
+ source "[sc_cfg_tool_task_get file sc_pin_constraint]"
91
+
92
+ proc sc_pin_print { arg } { utl::warn FLW 1 $arg }
93
+ proc sc_pin_layer_select { pin } {
94
+ global sc_hpinmetal
95
+ global sc_vpinmetal
96
+
97
+ set layer [sc_cfg_get constraint pin $pin layer]
98
+ if { [llength $layer] != 0 } {
99
+ return [sc_get_layer_name [lindex $layer 0]]
100
+ }
101
+ set side [sc_cfg_get constraint pin $pin side]
102
+ if { [llength $side] != 0 } {
103
+ switch -regexp $side {
104
+ "1|3" {
105
+ return [lindex $sc_hpinmetal 0]
106
+ }
107
+ "2|4" {
108
+ return [lindex $sc_vpinmetal 0]
109
+ }
110
+ default {
111
+ utl::error FLW 1 "Side number ($side) on $pin is not supported."
112
+ }
113
+ }
114
+ }
115
+
116
+ utl::error FLW 1 "$pin needs to either specify side or layer parameter."
117
+ }
118
+ sc_collect_pin_constraints \
119
+ pin_placement \
120
+ pin_order \
121
+ sc_pin_layer_select \
122
+ sc_pin_print
123
+
124
+ foreach pin $pin_placement {
125
+ set layer [sc_pin_layer_select $pin]
126
+ set place [sc_cfg_get constraint pin $pin placement]
127
+
128
+ set x_loc [lindex $place 0]
129
+ set y_loc [lindex $place 1]
130
+
131
+ place_pin -pin_name $pin \
132
+ -layer $layer \
133
+ -location "$x_loc $y_loc" \
134
+ -force_to_die_boundary
135
+ }
136
+
137
+ dict for {side layer_pins} $pin_order {
138
+ set edge_length 0
139
+ switch -regexp $side {
140
+ "1|3" {
141
+ set edge_length [expr { [lindex [ord::get_die_area] 3] - [lindex [ord::get_die_area] 1] }]
142
+ }
143
+ "2|4" {
144
+ set edge_length [expr { [lindex [ord::get_die_area] 2] - [lindex [ord::get_die_area] 0] }]
145
+ }
146
+ default {
147
+ utl::error FLW 1 "Side number ($side) is not supported."
148
+ }
149
+ }
150
+
151
+ dict for {layer ordered_pins} $layer_pins {
152
+ set spacing [expr { $edge_length / ([llength $ordered_pins] + 1) }]
153
+
154
+ for { set i 0 } { $i < [llength $ordered_pins] } { incr i } {
155
+ set name [lindex $ordered_pins $i]
156
+ switch -regexp $side {
157
+ "1" {
158
+ set x_loc [lindex [ord::get_die_area] 1]
159
+ set y_loc [expr { ($i + 1) * $spacing }]
160
+ }
161
+ "2" {
162
+ set x_loc [expr { ($i + 1) * $spacing }]
163
+ set y_loc [lindex [ord::get_die_area] 3]
164
+ }
165
+ "3" {
166
+ set x_loc [lindex [ord::get_die_area] 2]
167
+ set y_loc [expr { ($i + 1) * $spacing }]
168
+ }
169
+ "4" {
170
+ set x_loc [expr { ($i + 1) * $spacing }]
171
+ set y_loc [lindex [ord::get_die_area] 1]
172
+ }
173
+ }
174
+
175
+ place_pin -pin_name $name \
176
+ -layer $layer \
177
+ -location "$x_loc $y_loc" \
178
+ -force_to_die_boundary
179
+ }
180
+ }
181
+ }
182
+ }
183
+
184
+ ###########################
185
+ # Macro placement
186
+ ###########################
187
+
188
+ # If manual macro placement is provided use that first
189
+ if { [sc_cfg_exists constraint component] } {
190
+ set sc_snap_strategy [sc_cfg_tool_task_get {var} ifp_snap_strategy]
191
+
192
+ if { $sc_snap_strategy == "manufacturing_grid" } {
193
+ if { [[ord::get_db_tech] hasManufacturingGrid] } {
194
+ set x_grid [[ord::get_db_tech] getManufacturingGrid]
195
+ set y_grid $x_grid
196
+ } else {
197
+ utl::warn FLW 1 "Manufacturing grid is not defined, defaulting to 'none' snapping strategy"
198
+ set x_grid 1
199
+ set y_grid 1
200
+ }
201
+ } elseif { $sc_snap_strategy == "site" } {
202
+ set x_grid 0
203
+ set y_grid 0
204
+ foreach row [[ord::get_db_block] getRows] {
205
+ set site [$row getSite]
206
+ if { [$site getClass] == "PAD" } {
207
+ continue
208
+ }
209
+
210
+ set site_height [$site getHeight]
211
+ set site_width [$site getWidth]
212
+ if { $y_grid == 0 } {
213
+ set y_grid $site_height
214
+ } elseif { $y_grid > $site_height } {
215
+ set y_grid $site_height
216
+ }
217
+ if { $x_grid == 0 } {
218
+ set x_grid $site_width
219
+ } elseif { $x_grid > $site_width } {
220
+ set x_grid $site_width
221
+ }
222
+ }
223
+ } else {
224
+ set x_grid 1
225
+ set y_grid 1
226
+ }
227
+
228
+ if { $x_grid == 0 || $y_grid == 0 } {
229
+ utl::warn FLW 1 "Unable to determine snapping grid."
230
+ set x_grid 1
231
+ set y_grid 1
232
+ }
233
+
234
+ set x_grid [ord::dbu_to_microns $x_grid]
235
+ set y_grid [ord::dbu_to_microns $y_grid]
236
+
237
+ dict for {name params} [sc_cfg_get constraint component] {
238
+ set location [dict get $params placement]
239
+ set rotation [dict get $params rotation]
240
+ if { [llength $rotation] == 0 } {
241
+ set rotation 0
242
+ }
243
+ set rotation [expr { int($rotation) }]
244
+ set flip [dict get $params flip]
245
+ if { [dict exists $params partname] } {
246
+ set cell [dict get $params partname]
247
+ } else {
248
+ set cell ""
249
+ }
250
+ if { [llength [dict get $params halo]] != 0 } {
251
+ utl::warn FLW 1 "Halo is not supported in OpenROAD"
252
+ }
253
+
254
+ set transform_r [odb::dbTransform]
255
+ $transform_r setOrient "R${rotation}"
256
+ set transform_f [odb::dbTransform]
257
+ if { $flip == "true" } {
258
+ $transform_f setOrient [odb::dbTransform "MY"]
259
+ }
260
+ set transform_final [odb::dbTransform]
261
+ odb::dbTransform_concat $transform_r $transform_f $transform_final
262
+
263
+ set inst [[ord::get_db_block] findInst $name]
264
+ if { $inst == "NULL" } {
265
+ utl::warn FLW 1 "Could not find instance: $name"
266
+
267
+ if { $cell == "" } {
268
+ utl::error FLW 1 "Unable to create instance for $name as the cell has not been specified"
269
+ } else {
270
+ set master [[ord::get_db] findMaster $cell]
271
+ if { $master == "NULL" } {
272
+ utl::error FLW 1 "Unable to create $name, $cell is not a valid type"
273
+ }
274
+ set inst [odb::dbInst_create [ord::get_db_block] $master $name]
275
+ }
276
+ }
277
+ set master [$inst getMaster]
278
+ set height [ord::dbu_to_microns [$master getHeight]]
279
+ set width [ord::dbu_to_microns [$master getWidth]]
280
+
281
+ set x_loc [expr { [lindex $location 0] - $width / 2 }]
282
+ set y_loc [expr { [lindex $location 1] - $height / 2 }]
283
+
284
+ set x_loc [expr { round($x_loc / $x_grid) * $x_grid }]
285
+ set y_loc [expr { round($y_loc / $y_grid) * $y_grid }]
286
+
287
+ $inst setOrient [$transform_final getOrient]
288
+ $inst setLocation [ord::microns_to_dbu $x_loc] [ord::microns_to_dbu $y_loc]
289
+ $inst setPlacementStatus FIRM
290
+ }
291
+ }
292
+
293
+ if { $do_automatic_pins } {
294
+ ###########################
295
+ # Automatic Random Pin Placement
296
+ ###########################
297
+
298
+ sc_pin_placement -random
299
+ }
300
+
301
+ # Need to check if we have any macros before performing macro placement,
302
+ # since we get an error otherwise.
303
+ if { [sc_design_has_unplaced_macros] } {
304
+ if { $openroad_rtlmp_enable == "true" } {
305
+ set halo_max [expr { max([lindex $openroad_mpl_macro_place_halo 0], \
306
+ [lindex $openroad_mpl_macro_place_halo 1]) }]
307
+
308
+ set rtlmp_args []
309
+ if { $openroad_rtlmp_min_instances != "" } {
310
+ lappend rtlmp_args -min_num_inst $openroad_rtlmp_min_instances
311
+ }
312
+ if { $openroad_rtlmp_max_instances != "" } {
313
+ lappend rtlmp_args -max_num_inst $openroad_rtlmp_max_instances
314
+ }
315
+ if { $openroad_rtlmp_min_macros != "" } {
316
+ lappend rtlmp_args -min_num_macro $openroad_rtlmp_min_macros
317
+ }
318
+ if { $openroad_rtlmp_max_macros != "" } {
319
+ lappend rtlmp_args -max_num_macro $openroad_rtlmp_max_macros
320
+ }
321
+
322
+ rtl_macro_placer -report_directory reports/rtlmp \
323
+ -halo_width $halo_max \
324
+ {*}$rtlmp_args
325
+ } else {
326
+ ###########################
327
+ # TDMS Global Placement
328
+ ###########################
329
+
330
+ sc_global_placement -disable_routability_driven
331
+
332
+ ###########################
333
+ # Macro placement
334
+ ###########################
335
+
336
+ macro_placement -halo $openroad_mpl_macro_place_halo \
337
+ -channel $openroad_mpl_macro_place_channel
338
+
339
+ # Note: some platforms set a "macro blockage halo" at this point, but the
340
+ # technologies we support do not, so we don't include that step for now.
341
+ }
342
+ }
343
+ if { [sc_design_has_unplaced_macros] } {
344
+ utl::error FLW 1 "Design contains unplaced macros."
345
+ }
346
+
347
+ ###########################
348
+ # Insert tie cells
349
+ ###########################
350
+
351
+ foreach tie_type "high low" {
352
+ if { [has_tie_cell $tie_type] } {
353
+ insert_tiecells [get_tie_cell $tie_type]
354
+ }
355
+ }
356
+ global_connect
357
+
358
+ ###########################
359
+ # Tap Cells
360
+ ###########################
361
+
362
+ if { [sc_cfg_tool_task_exists {file} ifp_tapcell] } {
363
+ set tapcell_file [lindex [sc_cfg_tool_task_get {file} ifp_tapcell] 0]
364
+ puts "Sourcing tapcell file: ${tapcell_file}"
365
+ source $tapcell_file
366
+ global_connect
367
+ }
368
+
369
+ ###########################
370
+ # Power Network
371
+ ###########################
372
+
373
+ if { $openroad_pdn_enable == "true" && \
374
+ [sc_cfg_tool_task_exists {file} pdn_config] && \
375
+ [llength [sc_cfg_tool_task_get {file} pdn_config]] > 0 } {
376
+ set pdn_files []
377
+ foreach pdnconfig [sc_cfg_tool_task_get {file} pdn_config] {
378
+ if { [lsearch -exact $pdn_files $pdnconfig] != -1 } {
379
+ continue
380
+ }
381
+ puts "Sourcing PDNGEN configuration: ${pdnconfig}"
382
+ source $pdnconfig
383
+
384
+ lappend pdn_files $pdnconfig
385
+ }
386
+ pdngen -failed_via_report "reports/${sc_design}_pdngen_failed_vias.rpt"
387
+ } else {
388
+ utl::warn FLW 1 "No power grid inserted"
389
+ }
390
+
391
+ ###########################
392
+ # Check Power Network
393
+ ###########################
394
+
395
+ foreach net [sc_supply_nets] {
396
+ if { ![[[ord::get_db_block] findNet $net] isSpecial] } {
397
+ utl::warn FLW 1 "$net_name is marked as a supply net, but is not marked as a special net"
398
+ }
399
+ }
400
+
401
+ foreach net [sc_psm_check_nets] {
402
+ puts "Check supply net: $net"
403
+ check_power_grid \
404
+ -floorplanning \
405
+ -error_file "reports/power_grid_${net}.rpt" \
406
+ -net $net
407
+ }
408
+
409
+ ###########################
410
+ # Remove buffers inserted by synthesis
411
+ ###########################
412
+
413
+ remove_buffers
@@ -0,0 +1,158 @@
1
+ ###############################
2
+ # Report Metrics
3
+ ###############################
4
+
5
+ proc sc_display_report {report} {
6
+ if { ![file exists $report] } {
7
+ return
8
+ }
9
+ set fid [open $report r]
10
+ set report_content [read $fid]
11
+ close $fid
12
+ puts $report_content
13
+ }
14
+
15
+ set fields "{capacitance slew input_pins nets fanout}"
16
+ set PREFIX "SC_METRIC:"
17
+
18
+ if { [sc_cfg_tool_task_check_in_list setup var reports] } {
19
+ puts "$PREFIX report_checks -path_delay max"
20
+ report_checks -fields $fields -path_delay max -format full_clock_expanded \
21
+ > reports/timing/setup.rpt
22
+ sc_display_report reports/timing/setup.rpt
23
+ report_checks -path_delay max -group_count $openroad_sta_top_n_paths \
24
+ > reports/timing/setup.topN.rpt
25
+
26
+ puts "$PREFIX setupslack"
27
+ report_worst_slack -max > reports/timing/worst_slack.setup.rpt
28
+ sc_display_report reports/timing/worst_slack.setup.rpt
29
+ report_worst_slack_metric -setup
30
+
31
+ puts "$PREFIX tns"
32
+ report_tns > reports/timing/total_negative_slack.rpt
33
+ sc_display_report reports/timing/total_negative_slack.rpt
34
+ report_tns_metric -setup
35
+ }
36
+
37
+ if { [sc_cfg_tool_task_check_in_list hold var reports] } {
38
+ puts "$PREFIX report_checks -path_delay min"
39
+ report_checks -fields $fields -path_delay min -format full_clock_expanded \
40
+ > reports/timing/hold.rpt
41
+ sc_display_report reports/timing/hold.rpt
42
+ report_checks -path_delay min -group_count $openroad_sta_top_n_paths \
43
+ > reports/timing/hold.topN.rpt
44
+
45
+ puts "$PREFIX holdslack"
46
+ report_worst_slack -min > reports/timing/worst_slack.hold.rpt
47
+ sc_display_report reports/timing/worst_slack.hold.rpt
48
+ report_worst_slack_metric -hold
49
+
50
+ report_tns_metric -hold
51
+ }
52
+
53
+ if { [sc_cfg_tool_task_check_in_list unconstrained var reports] } {
54
+ puts "$PREFIX unconstrained"
55
+ report_checks -fields $fields -unconstrained -format full_clock_expanded \
56
+ > reports/timing/unconstrained.rpt
57
+ sc_display_report reports/timing/unconstrained.rpt
58
+ report_checks -unconstrained -group_count $openroad_sta_top_n_paths \
59
+ > reports/timing/unconstrained.topN.rpt
60
+ }
61
+
62
+ if { [sc_cfg_tool_task_check_in_list clock_skew var reports] && \
63
+ [llength [all_clocks]] > 0 } {
64
+ puts "$PREFIX clock_skew"
65
+ report_clock_skew -setup -digits 4 > reports/timing/skew.setup.rpt
66
+ sc_display_report reports/timing/skew.setup.rpt
67
+ report_clock_skew_metric -setup
68
+ report_clock_skew -hold -digits 4 > reports/timing/skew.hold.rpt
69
+ sc_display_report reports/timing/skew.hold.rpt
70
+ report_clock_skew_metric -hold
71
+ }
72
+
73
+ if { [sc_cfg_tool_task_check_in_list drv_violations var reports] } {
74
+ puts "$PREFIX DRV violators"
75
+ report_check_types -max_slew -max_capacitance -max_fanout -violators \
76
+ > reports/timing/drv_violators.rpt
77
+ sc_display_report reports/timing/drv_violators.rpt
78
+ report_erc_metrics
79
+
80
+ puts "$PREFIX floating nets"
81
+ report_floating_nets -verbose > reports/floating_nets.rpt
82
+ sc_display_report reports/floating_nets.rpt
83
+ }
84
+
85
+ utl::metric_int "timing__clocks" [llength [all_clocks]]
86
+
87
+ if { [sc_cfg_tool_task_check_in_list fmax var reports] } {
88
+ puts "$PREFIX fmax"
89
+ # Model on: https://github.com/The-OpenROAD-Project/OpenSTA/blob/f913c3ddbb3e7b4364ed4437c65ac78c4da9174b/tcl/Search.tcl#L1078
90
+ set fmax_metric 0
91
+ foreach clk [sta::sort_by_name [all_clocks]] {
92
+ set clk_name [get_name $clk]
93
+ set min_period [sta::find_clk_min_period $clk 1]
94
+ if { $min_period == 0.0 } {
95
+ continue
96
+ }
97
+ set fmax [expr { 1.0 / $min_period }]
98
+ utl::metric_float "timing__fmax__clock:${clk_name}" $fmax
99
+ puts "$clk_name fmax = [format %.2f [expr { $fmax / 1e6 }]] MHz"
100
+ set fmax_metric [expr { max($fmax_metric, $fmax) }]
101
+ }
102
+ if { $fmax_metric > 0 } {
103
+ utl::metric_float "timing__fmax" $fmax_metric
104
+ }
105
+ }
106
+
107
+ # get logic depth of design
108
+ utl::metric_int "design__logic__depth" [count_logic_depth]
109
+
110
+ if { [sc_cfg_tool_task_check_in_list power var reports] } {
111
+ puts "$PREFIX power"
112
+ foreach corner [sta::corners] {
113
+ set corner_name [$corner name]
114
+ puts "Power for corner: $corner_name"
115
+ report_power -corner $corner_name > reports/power/${corner_name}.rpt
116
+ sc_display_report reports/power/${corner_name}.rpt
117
+ }
118
+ report_power_metric -corner $sc_power_corner
119
+ }
120
+
121
+ puts "$PREFIX cellarea"
122
+ report_design_area
123
+ report_design_area_metrics
124
+
125
+ # get number of nets in design
126
+ utl::metric_int "design__nets" [llength [[ord::get_db_block] getNets]]
127
+
128
+ # get number of registers
129
+ utl::metric_int "design__registers" [llength [all_registers]]
130
+
131
+ # get number of buffers
132
+ set bufs 0
133
+ set invs 0
134
+ foreach inst [get_cells -hierarchical *] {
135
+ set cell [$inst cell]
136
+ if { $cell == "NULL" } {
137
+ continue
138
+ }
139
+ set liberty_cell [$cell liberty_cell]
140
+ if { $liberty_cell == "NULL" } {
141
+ continue
142
+ }
143
+ if { [$liberty_cell is_buffer] } {
144
+ incr bufs
145
+ } elseif { [$liberty_cell is_inverter] } {
146
+ incr invs
147
+ }
148
+ }
149
+ utl::metric_int "design__buffers" $bufs
150
+ utl::metric_int "design__inverters" $invs
151
+
152
+ # get number of unconstrained endpoints
153
+ with_output_to_variable endpoints {check_setup -unconstrained_endpoints}
154
+ set unconstrained_endpoints [regexp -all -inline {[0-9]+} $endpoints]
155
+ if { $unconstrained_endpoints == "" } {
156
+ set unconstrained_endpoints 0
157
+ }
158
+ utl::metric_int "timing__unconstrained" $unconstrained_endpoints
@@ -0,0 +1,7 @@
1
+
2
+ # while (not good enough):
3
+ # global placement
4
+ # estimate parasitics
5
+ # logic remapping, buffering
6
+
7
+ puts "NOP"
@@ -0,0 +1,84 @@
1
+ #######################
2
+ # Global Placement and Refinement of Pin Placement
3
+ #######################
4
+
5
+ if { [sc_design_has_placeable_ios] } {
6
+ #######################
7
+ # Global Placement (without considering IO placements)
8
+ #######################
9
+
10
+ if { $openroad_gpl_enable_skip_io } {
11
+ utl::info FLW 1 "Performing global placement without considering IO"
12
+ sc_global_placement -skip_io
13
+ }
14
+
15
+ ###########################
16
+ # Refine Automatic Pin Placement
17
+ ###########################
18
+
19
+ if { ![sc_has_unplaced_instances] } {
20
+ sc_pin_placement
21
+ } else {
22
+ utl::info FLW 1 "Skipping pin placements refinement due to unplaced instances"
23
+ }
24
+ }
25
+
26
+ #######################
27
+ # Global Placement
28
+ #######################
29
+
30
+ sc_global_placement
31
+
32
+ #######################
33
+ # Repair Design
34
+ #######################
35
+
36
+ estimate_parasitics -placement
37
+
38
+ if { $openroad_rsz_buffer_inputs == "true" } {
39
+ buffer_ports -inputs
40
+ }
41
+ if { $openroad_rsz_buffer_outputs == "true" } {
42
+ buffer_ports -outputs
43
+ }
44
+
45
+ set repair_design_args []
46
+ if { $openroad_rsz_cap_margin != "false" } {
47
+ lappend repair_design_args "-cap_margin" $openroad_rsz_cap_margin
48
+ }
49
+ if { $openroad_rsz_slew_margin != "false" } {
50
+ lappend repair_design_args "-slew_margin" $openroad_rsz_slew_margin
51
+ }
52
+ repair_design -verbose {*}$repair_design_args
53
+
54
+ #######################
55
+ # TIE FANOUT
56
+ #######################
57
+
58
+ foreach tie_type "high low" {
59
+ if { [has_tie_cell $tie_type] } {
60
+ repair_tie_fanout -separation $openroad_ifp_tie_separation [get_tie_cell $tie_type]
61
+ }
62
+ }
63
+
64
+ #######################
65
+ # DETAILED PLACEMENT
66
+ #######################
67
+
68
+ sc_detailed_placement
69
+
70
+ if { $openroad_dpo_enable == "true" } {
71
+ improve_placement -max_displacement $openroad_dpo_max_displacement
72
+
73
+ # Do another detailed placement in case DPO leaves violations behind
74
+ sc_detailed_placement
75
+ }
76
+
77
+ optimize_mirroring
78
+
79
+ check_placement -verbose
80
+
81
+ global_connect
82
+
83
+ # estimate for metrics
84
+ estimate_parasitics -placement