siliconcompiler 0.28.8__py3-none-any.whl → 0.29.0__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 (122) hide show
  1. siliconcompiler/_metadata.py +1 -1
  2. siliconcompiler/apps/sc_remote.py +15 -14
  3. siliconcompiler/apps/sc_show.py +5 -5
  4. siliconcompiler/apps/utils/replay.py +136 -0
  5. siliconcompiler/core.py +14 -12
  6. siliconcompiler/flows/_common.py +11 -13
  7. siliconcompiler/flows/asicflow.py +83 -42
  8. siliconcompiler/remote/__init__.py +11 -0
  9. siliconcompiler/remote/client.py +753 -815
  10. siliconcompiler/report/report.py +2 -0
  11. siliconcompiler/report/summary_table.py +1 -1
  12. siliconcompiler/scheduler/__init__.py +51 -9
  13. siliconcompiler/scheduler/send_messages.py +37 -33
  14. siliconcompiler/scheduler/validation/email_credentials.json +7 -0
  15. siliconcompiler/schema/schema_cfg.py +15 -3
  16. siliconcompiler/schema/schema_obj.py +16 -0
  17. siliconcompiler/sphinx_ext/dynamicgen.py +4 -3
  18. siliconcompiler/targets/fpgaflow_demo.py +6 -7
  19. siliconcompiler/targets/gf180_demo.py +3 -3
  20. siliconcompiler/templates/replay/requirements.txt +6 -0
  21. siliconcompiler/templates/replay/run.py.j2 +22 -0
  22. siliconcompiler/templates/replay/setup.sh +17 -0
  23. siliconcompiler/tools/_common/__init__.py +17 -3
  24. siliconcompiler/tools/_common/asic.py +10 -3
  25. siliconcompiler/tools/builtin/concatenate.py +1 -1
  26. siliconcompiler/tools/openroad/__init__.py +103 -0
  27. siliconcompiler/tools/openroad/{openroad.py → _apr.py} +413 -422
  28. siliconcompiler/tools/openroad/antenna_repair.py +78 -0
  29. siliconcompiler/tools/openroad/clock_tree_synthesis.py +64 -0
  30. siliconcompiler/tools/openroad/detailed_placement.py +59 -0
  31. siliconcompiler/tools/openroad/detailed_route.py +62 -0
  32. siliconcompiler/tools/openroad/endcap_tapcell_insertion.py +52 -0
  33. siliconcompiler/tools/openroad/fillercell_insertion.py +58 -0
  34. siliconcompiler/tools/openroad/{dfm.py → fillmetal_insertion.py} +35 -19
  35. siliconcompiler/tools/openroad/global_placement.py +58 -0
  36. siliconcompiler/tools/openroad/global_route.py +63 -0
  37. siliconcompiler/tools/openroad/init_floorplan.py +103 -0
  38. siliconcompiler/tools/openroad/macro_placement.py +65 -0
  39. siliconcompiler/tools/openroad/metrics.py +23 -8
  40. siliconcompiler/tools/openroad/pin_placement.py +56 -0
  41. siliconcompiler/tools/openroad/power_grid.py +65 -0
  42. siliconcompiler/tools/openroad/rcx_bench.py +7 -4
  43. siliconcompiler/tools/openroad/rcx_extract.py +2 -1
  44. siliconcompiler/tools/openroad/rdlroute.py +4 -4
  45. siliconcompiler/tools/openroad/repair_design.py +59 -0
  46. siliconcompiler/tools/openroad/repair_timing.py +63 -0
  47. siliconcompiler/tools/openroad/screenshot.py +9 -20
  48. siliconcompiler/tools/openroad/scripts/apr/postamble.tcl +44 -0
  49. siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +95 -0
  50. siliconcompiler/tools/openroad/scripts/apr/sc_antenna_repair.tcl +51 -0
  51. siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +62 -0
  52. siliconcompiler/tools/openroad/scripts/apr/sc_detailed_placement.tcl +41 -0
  53. siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +71 -0
  54. siliconcompiler/tools/openroad/scripts/apr/sc_endcap_tapcell_insertion.tcl +55 -0
  55. siliconcompiler/tools/openroad/scripts/apr/sc_fillercell_insertion.tcl +27 -0
  56. siliconcompiler/tools/openroad/scripts/apr/sc_fillmetal_insertion.tcl +36 -0
  57. siliconcompiler/tools/openroad/scripts/apr/sc_global_placement.tcl +26 -0
  58. siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +61 -0
  59. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +333 -0
  60. siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +123 -0
  61. siliconcompiler/tools/openroad/scripts/apr/sc_metrics.tcl +22 -0
  62. siliconcompiler/tools/openroad/scripts/apr/sc_pin_placement.tcl +41 -0
  63. siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +60 -0
  64. siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +68 -0
  65. siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +83 -0
  66. siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +125 -0
  67. siliconcompiler/tools/openroad/scripts/common/debugging.tcl +28 -0
  68. siliconcompiler/tools/openroad/scripts/common/procs.tcl +675 -0
  69. siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +59 -0
  70. siliconcompiler/tools/openroad/scripts/common/read_liberty.tcl +20 -0
  71. siliconcompiler/tools/openroad/scripts/common/read_timing_constraints.tcl +16 -0
  72. siliconcompiler/tools/openroad/scripts/common/reports.tcl +180 -0
  73. siliconcompiler/tools/openroad/scripts/common/screenshot.tcl +18 -0
  74. siliconcompiler/tools/openroad/scripts/common/write_images.tcl +395 -0
  75. siliconcompiler/tools/openroad/scripts/{sc_rcx_bench.tcl → rcx/sc_rcx_bench.tcl} +5 -5
  76. siliconcompiler/tools/openroad/scripts/{sc_rcx_extract.tcl → rcx/sc_rcx_extract.tcl} +0 -0
  77. siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +5 -16
  78. siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +51 -51
  79. siliconcompiler/tools/openroad/scripts/sc_show.tcl +105 -0
  80. siliconcompiler/tools/openroad/show.py +28 -23
  81. siliconcompiler/tools/openroad/{export.py → write_data.py} +31 -26
  82. siliconcompiler/tools/opensta/__init__.py +1 -1
  83. siliconcompiler/tools/vivado/bitstream.py +8 -2
  84. siliconcompiler/tools/vivado/place.py +6 -2
  85. siliconcompiler/tools/vivado/route.py +6 -2
  86. siliconcompiler/tools/vivado/scripts/sc_bitstream.tcl +1 -1
  87. siliconcompiler/tools/vivado/scripts/sc_place.tcl +1 -1
  88. siliconcompiler/tools/vivado/scripts/sc_route.tcl +1 -1
  89. siliconcompiler/tools/vivado/scripts/sc_run.tcl +4 -2
  90. siliconcompiler/tools/vivado/syn_fpga.py +5 -1
  91. siliconcompiler/tools/vivado/vivado.py +26 -10
  92. siliconcompiler/tools/vpr/vpr.py +5 -0
  93. siliconcompiler/tools/yosys/syn_asic.py +7 -0
  94. siliconcompiler/tools/yosys/syn_asic.tcl +27 -6
  95. siliconcompiler/tools/yosys/syn_fpga.tcl +26 -18
  96. siliconcompiler/toolscripts/_tools.json +5 -5
  97. {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/METADATA +50 -48
  98. {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/RECORD +103 -76
  99. {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/WHEEL +1 -1
  100. siliconcompiler/tools/openroad/cts.py +0 -45
  101. siliconcompiler/tools/openroad/floorplan.py +0 -75
  102. siliconcompiler/tools/openroad/physyn.py +0 -27
  103. siliconcompiler/tools/openroad/place.py +0 -41
  104. siliconcompiler/tools/openroad/route.py +0 -45
  105. siliconcompiler/tools/openroad/scripts/__init__.py +0 -0
  106. siliconcompiler/tools/openroad/scripts/sc_apr.tcl +0 -514
  107. siliconcompiler/tools/openroad/scripts/sc_cts.tcl +0 -68
  108. siliconcompiler/tools/openroad/scripts/sc_dfm.tcl +0 -22
  109. siliconcompiler/tools/openroad/scripts/sc_export.tcl +0 -100
  110. siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +0 -456
  111. siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +0 -1
  112. siliconcompiler/tools/openroad/scripts/sc_physyn.tcl +0 -6
  113. siliconcompiler/tools/openroad/scripts/sc_place.tcl +0 -84
  114. siliconcompiler/tools/openroad/scripts/sc_procs.tcl +0 -494
  115. siliconcompiler/tools/openroad/scripts/sc_report.tcl +0 -189
  116. siliconcompiler/tools/openroad/scripts/sc_route.tcl +0 -143
  117. siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +0 -18
  118. siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +0 -393
  119. /siliconcompiler/tools/openroad/scripts/{sc_write.tcl → common/write_data.tcl} +0 -0
  120. {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/LICENSE +0 -0
  121. {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/entry_points.txt +0 -0
  122. {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,59 @@
1
+ ###############################
2
+ # Read design files
3
+ ###############################
4
+
5
+ if { [sc_has_input_files odb "input layout odb"] } {
6
+ foreach odb_file [sc_get_input_files odb "input layout odb"] {
7
+ puts "Reading ODB: ${odb_file}"
8
+ read_db $odb_file
9
+ }
10
+ } else {
11
+ set sc_libtype [sc_cfg_get library $sc_mainlib asic libarch]
12
+ set sc_techlef [sc_cfg_get pdk $sc_pdk aprtech openroad $sc_stackup $sc_libtype lef]
13
+
14
+ # Read techlef
15
+ puts "Reading techlef: ${sc_techlef}"
16
+ read_lef $sc_techlef
17
+
18
+ # Read Lefs
19
+ foreach lib "$sc_targetlibs $sc_macrolibs" {
20
+ foreach lef_file [sc_cfg_get library $lib output $sc_stackup lef] {
21
+ puts "Reading lef: ${lef_file}"
22
+ read_lef $lef_file
23
+ }
24
+ }
25
+
26
+ if { [file exists "inputs/${sc_design}.def"] } {
27
+ # Read DEF
28
+ # get from previous step
29
+ puts "Reading DEF: inputs/${sc_design}.def"
30
+ read_def "inputs/${sc_design}.def"
31
+ } elseif { [sc_cfg_exists input layout def] } {
32
+ # Read DEF
33
+ set sc_def [lindex [sc_cfg_get input layout def] 0]
34
+ puts "Reading DEF: ${sc_def}"
35
+ read_def $sc_def
36
+ } elseif { [file exists "inputs/${sc_design}.vg"] } {
37
+ # Read Verilog
38
+ puts "Reading netlist verilog: inputs/${sc_design}.vg"
39
+ read_verilog "inputs/${sc_design}.vg"
40
+ link_design $sc_design
41
+ } elseif { [sc_cfg_exists input netlist verilog] } {
42
+ # Read Verilog
43
+ foreach netlist [sc_cfg_get input netlist verilog] {
44
+ puts "Reading netlist verilog: ${netlist}"
45
+ read_verilog $netlist
46
+ }
47
+ link_design $sc_design
48
+ } else {
49
+ utl::error FLW 1 "No input files available"
50
+ }
51
+
52
+ # Handle global connect setup
53
+ if { [sc_cfg_tool_task_exists {file} global_connect] } {
54
+ foreach global_connect [sc_cfg_tool_task_get {file} global_connect] {
55
+ puts "Loading global connect configuration: ${global_connect}"
56
+ source $global_connect
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,20 @@
1
+ set sc_scenarios [dict keys [sc_cfg_get constraint timing]]
2
+ set sc_delaymodel [sc_cfg_get asic delaymodel]
3
+
4
+ # Read Liberty
5
+ utl::info FLW 1 "Defining timing corners: $sc_scenarios"
6
+ define_corners {*}$sc_scenarios
7
+ foreach lib "$sc_targetlibs $sc_macrolibs" {
8
+ #Liberty
9
+ foreach corner $sc_scenarios {
10
+ foreach libcorner [sc_cfg_get constraint timing $corner libcorner] {
11
+ if { [sc_cfg_exists library $lib output $libcorner $sc_delaymodel] } {
12
+ foreach lib_file [sc_cfg_get library $lib output $libcorner $sc_delaymodel] {
13
+ puts "Reading liberty file for ${corner} ($libcorner): ${lib_file}"
14
+ read_liberty -corner $corner $lib_file
15
+ }
16
+ break
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,16 @@
1
+ ###############################
2
+ # Read timing constraints
3
+ ###############################
4
+
5
+ if { [sc_has_input_files sdc "input constraint sdc"] } {
6
+ foreach sdc [sc_get_input_files sdc "input constraint sdc"] {
7
+ puts "Reading SDC: ${sdc}"
8
+ read_sdc $sdc
9
+ }
10
+ } else {
11
+ # fall back on default auto generated constraints file
12
+ set sdc [sc_cfg_tool_task_get {file} opensta_generic_sdc]
13
+ puts "Reading SDC: ${sdc}"
14
+ utl::warn FLW 1 "Defaulting back to default SDC"
15
+ read_sdc "${sdc}"
16
+ }
@@ -0,0 +1,180 @@
1
+ ###############################
2
+ # Report Metrics
3
+ ###############################
4
+
5
+ # Setup reports directories
6
+ file mkdir reports/timing
7
+ file mkdir reports/power
8
+ file mkdir reports/markers
9
+
10
+ set fields "{capacitance slew input_pins nets fanout}"
11
+ set sta_top_n_paths [lindex [sc_cfg_tool_task_get var sta_top_n_paths] 0]
12
+ set PREFIX "SC_METRIC:"
13
+
14
+ if { [sc_cfg_tool_task_check_in_list setup var reports] } {
15
+ puts "$PREFIX report_checks -path_delay max"
16
+ tee -file reports/timing/setup.rpt \
17
+ "report_checks -fields $fields -path_delay max -format full_clock_expanded"
18
+ tee -file reports/timing/setup.topN.rpt -quiet \
19
+ "report_checks -fields $fields -path_delay max -group_count $sta_top_n_paths"
20
+
21
+ puts "$PREFIX setupslack"
22
+ tee -file reports/timing/worst_slack.setup.rpt \
23
+ "report_worst_slack -max"
24
+ report_worst_slack_metric -setup
25
+
26
+ puts "$PREFIX tns"
27
+ tee -file reports/timing/total_negative_slack.rpt \
28
+ "report_tns"
29
+ report_tns_metric -setup
30
+ }
31
+
32
+ if { [sc_cfg_tool_task_check_in_list hold var reports] } {
33
+ puts "$PREFIX report_checks -path_delay min"
34
+ tee -file reports/timing/hold.rpt \
35
+ "report_checks -fields $fields -path_delay min -format full_clock_expanded"
36
+ tee -file reports/timing/hold.topN.rpt -quiet \
37
+ "report_checks -fields $fields -path_delay min -group_count $sta_top_n_paths"
38
+
39
+ puts "$PREFIX holdslack"
40
+ tee -file reports/timing/worst_slack.hold.rpt \
41
+ "report_worst_slack -min"
42
+ report_worst_slack_metric -hold
43
+
44
+ report_tns_metric -hold
45
+ }
46
+
47
+ if { [sc_cfg_tool_task_check_in_list unconstrained var reports] } {
48
+ puts "$PREFIX unconstrained"
49
+ tee -file reports/timing/unconstrained.rpt \
50
+ "report_checks -fields $fields -unconstrained -format full_clock_expanded"
51
+ tee -file reports/timing/unconstrained.topN.rpt -quiet \
52
+ "report_checks -fields $fields -unconstrained -group_count $sta_top_n_paths"
53
+ }
54
+
55
+ if {
56
+ [sc_cfg_tool_task_check_in_list clock_skew var reports] &&
57
+ [llength [all_clocks]] > 0
58
+ } {
59
+ puts "$PREFIX clock_skew"
60
+ tee -file reports/timing/skew.setup.rpt \
61
+ "report_clock_skew -setup -digits 4"
62
+ report_clock_skew_metric -setup
63
+ tee -file reports/timing/skew.hold.rpt \
64
+ "report_clock_skew -hold -digits 4"
65
+ report_clock_skew_metric -hold
66
+ }
67
+
68
+ if { [sc_cfg_tool_task_check_in_list drv_violations var reports] } {
69
+ puts "$PREFIX DRV violators"
70
+ tee -file reports/timing/drv_violators.rpt \
71
+ "report_check_types -max_slew -max_capacitance -max_fanout -violators"
72
+ report_erc_metrics
73
+
74
+ puts "$PREFIX floating nets"
75
+ tee -file reports/floating_nets.rpt \
76
+ "report_floating_nets -verbose"
77
+ }
78
+
79
+ utl::metric_int "timing__clocks" [llength [all_clocks]]
80
+
81
+ if { [sc_cfg_tool_task_check_in_list fmax var reports] } {
82
+ puts "$PREFIX fmax"
83
+ # Model on: https://github.com/The-OpenROAD-Project/OpenSTA/blob/f913c3ddbb3e7b4364ed4437c65ac78c4da9174b/tcl/Search.tcl#L1078
84
+ set fmax_metric 0
85
+ foreach clk [sta::sort_by_name [all_clocks]] {
86
+ set clk_name [get_name $clk]
87
+ set min_period [sta::find_clk_min_period $clk 1]
88
+ if { $min_period == 0.0 } {
89
+ continue
90
+ }
91
+ set fmax [expr { 1.0 / $min_period }]
92
+ utl::metric_float "timing__fmax__clock:${clk_name}" $fmax
93
+ puts "$clk_name fmax = [format %.2f [expr { $fmax / 1e6 }]] MHz"
94
+ set fmax_metric [expr { max($fmax_metric, $fmax) }]
95
+ }
96
+ if { $fmax_metric > 0 } {
97
+ utl::metric_float "timing__fmax" $fmax_metric
98
+ }
99
+ }
100
+
101
+ # get logic depth of design
102
+ utl::metric_int "design__logic__depth" [sc_count_logic_depth]
103
+
104
+ if { [sc_cfg_tool_task_check_in_list power var reports] } {
105
+ puts "$PREFIX power"
106
+ foreach corner [sta::corners] {
107
+ set corner_name [$corner name]
108
+ puts "Power for corner: $corner_name"
109
+
110
+ tee -file reports/power/${corner_name}.rpt \
111
+ "report_power -corner $corner_name"
112
+ }
113
+ report_power_metric -corner [sc_cfg_tool_task_get var power_corner]
114
+ }
115
+
116
+ puts "$PREFIX cellarea"
117
+ report_design_area
118
+ report_design_area_metrics
119
+
120
+ # get number of nets in design
121
+ utl::metric_int "design__nets" [llength [[ord::get_db_block] getNets]]
122
+
123
+ # get number of registers
124
+ utl::metric_int "design__registers" [llength [all_registers]]
125
+
126
+ # get number of buffers
127
+ set bufs 0
128
+ set invs 0
129
+ foreach inst [get_cells -hierarchical *] {
130
+ set cell [$inst cell]
131
+ if { $cell == "NULL" } {
132
+ continue
133
+ }
134
+ set liberty_cell [$cell liberty_cell]
135
+ if { $liberty_cell == "NULL" } {
136
+ continue
137
+ }
138
+ if { [$liberty_cell is_buffer] } {
139
+ incr bufs
140
+ } elseif { [$liberty_cell is_inverter] } {
141
+ incr invs
142
+ }
143
+ }
144
+ utl::metric_int "design__buffers" $bufs
145
+ utl::metric_int "design__inverters" $invs
146
+
147
+ # get number of unconstrained endpoints
148
+ with_output_to_variable endpoints {check_setup -unconstrained_endpoints}
149
+ set unconstrained_endpoints [regexp -all -inline {[0-9]+} $endpoints]
150
+ if { $unconstrained_endpoints == "" } {
151
+ set unconstrained_endpoints 0
152
+ }
153
+ utl::metric_int "timing__unconstrained" $unconstrained_endpoints
154
+
155
+ # Write markers
156
+ foreach markerdb [[ord::get_db_block] getMarkerCategories] {
157
+ if { [$markerdb getMarkerCount] == 0 } {
158
+ continue
159
+ }
160
+
161
+ $markerdb writeTR "reports/markers/${sc_design}.[$markerdb getName].rpt"
162
+ $markerdb writeJSON "reports/markers/${sc_design}.[$markerdb getName].json"
163
+ }
164
+
165
+ utl::push_metrics_stage "sc__cellarea__{}"
166
+ tee -file reports/cell_usage.rpt {report_cell_usage -verbose}
167
+
168
+ foreach modinst [[ord::get_db_block] getModInsts] {
169
+ tee -quiet -append -file reports/cell_usage.rpt { puts "" }
170
+ tee -quiet -append -file reports/cell_usage.rpt {
171
+ puts "########################################################"
172
+ }
173
+ tee -quiet -append -file reports/cell_usage.rpt { puts "" }
174
+
175
+ utl::metric "design__instance__name__in_module:[[$modinst getMaster] getName]" \
176
+ [$modinst getHierarchicalName]
177
+ tee -quiet -append -file reports/cell_usage.rpt \
178
+ "report_cell_usage -verbose [$modinst getHierarchicalName]"
179
+ }
180
+ utl::pop_metrics_stage
@@ -0,0 +1,18 @@
1
+ gui::save_display_controls
2
+
3
+ set sc_resolution \
4
+ [lindex [sc_cfg_tool_task_get {var} show_vertical_resolution] 0]
5
+
6
+ sc_image_setup_default
7
+
8
+ sc_save_image "screenshot" "outputs/${sc_design}.png" $sc_resolution
9
+
10
+ gui::restore_display_controls
11
+
12
+ if {
13
+ [sc_cfg_tool_task_exists {var} include_report_images] &&
14
+ [lindex [sc_cfg_tool_task_get {var} include_report_images] 0]
15
+ == "true"
16
+ } {
17
+ source -echo "${sc_refdir}/sc_write_images.tcl"
18
+ }
@@ -0,0 +1,395 @@
1
+ # Adopted from https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/3f9740e6b3643835e918d78ae1d377d65af0f0fb/flow/scripts/save_images.tcl
2
+
3
+ proc sc_image_heatmap { name ident image_name title { allow_bin_adjust 1 } } {
4
+ set ord_heatmap_bins_x [lindex [sc_cfg_tool_task_get var ord_heatmap_bins_x] 0]
5
+ set ord_heatmap_bins_y [lindex [sc_cfg_tool_task_get var ord_heatmap_bins_y] 0]
6
+
7
+ file mkdir reports/images/heatmap
8
+
9
+ gui::set_heatmap $ident ShowLegend 1
10
+ gui::set_heatmap $ident ShowNumbers 1
11
+
12
+ if { $allow_bin_adjust } {
13
+ set heatmap_xn $ord_heatmap_bins_x
14
+ set heatmap_yn $ord_heatmap_bins_y
15
+
16
+ if { $heatmap_xn < 1 } {
17
+ set heatmap_xn 1
18
+ }
19
+ if { $heatmap_yn < 1 } {
20
+ set heatmap_yn 1
21
+ }
22
+
23
+ set min_heatmap_bin 1.0
24
+ set max_heatmap_bin 100.0
25
+
26
+ set box [[ord::get_db_block] getDieArea]
27
+ set heatmap_x [expr { [ord::dbu_to_microns [$box dx]] / $heatmap_xn }]
28
+ set heatmap_y [expr { [ord::dbu_to_microns [$box dy]] / $heatmap_yn }]
29
+
30
+ if { $heatmap_x < $min_heatmap_bin } {
31
+ set heatmap_x $min_heatmap_bin
32
+ } elseif { $heatmap_x > $max_heatmap_bin } {
33
+ set heatmap_x $max_heatmap_bin
34
+ }
35
+ if { $heatmap_y < $min_heatmap_bin } {
36
+ set heatmap_y $min_heatmap_bin
37
+ } elseif { $heatmap_y > $max_heatmap_bin } {
38
+ set heatmap_y $max_heatmap_bin
39
+ }
40
+ gui::set_heatmap $ident GridX $heatmap_x
41
+ gui::set_heatmap $ident GridY $heatmap_y
42
+ }
43
+
44
+ gui::set_heatmap $ident rebuild
45
+
46
+ if { ![gui::get_heatmap_bool $ident has_data] } {
47
+ return
48
+ }
49
+
50
+ gui::set_display_controls "Heat Maps/${name}" visible true
51
+
52
+ sc_save_image "$title heatmap" reports/images/heatmap/${image_name}
53
+
54
+ gui::set_display_controls "Heat Maps/${name}" visible false
55
+ }
56
+
57
+ proc sc_image_placement { } {
58
+ if { ![sc_has_placed_instances] } {
59
+ return
60
+ }
61
+
62
+ global sc_design
63
+
64
+ sc_image_setup_default
65
+
66
+ # The placement view without routing
67
+ gui::set_display_controls "Layers/*" visible false
68
+ gui::set_display_controls "Instances/Physical/*" visible false
69
+
70
+ sc_save_image "placement" reports/images/${sc_design}.placement.png
71
+ }
72
+
73
+ proc sc_image_routing { } {
74
+ if { ![sc_has_routing] } {
75
+ return
76
+ }
77
+
78
+ global sc_design
79
+
80
+ sc_image_setup_default
81
+
82
+ gui::set_display_controls "Nets/Power" visible false
83
+ gui::set_display_controls "Nets/Ground" visible false
84
+
85
+ sc_save_image "routing" reports/images/${sc_design}.routing.png
86
+ }
87
+
88
+ proc sc_image_everything { } {
89
+ global sc_design
90
+
91
+ sc_image_setup_default
92
+ sc_save_image "snapshot" reports/images/${sc_design}.png
93
+ }
94
+
95
+ proc sc_image_irdrop { net corner } {
96
+ if { ![sc_has_placed_instances] || [sc_has_unplaced_instances] } {
97
+ return
98
+ }
99
+
100
+ sc_image_setup_default
101
+
102
+ file mkdir reports/images/heatmap/irdrop
103
+
104
+ # suppress error message related to failed analysis,
105
+ # that is okay, we just won't take a screenshot
106
+ set msgs "38 39 69"
107
+ foreach msg $msgs {
108
+ suppress_message PSM $msg
109
+ }
110
+ set failed [catch { analyze_power_grid -net $net -corner $corner -source_type STRAPS } err]
111
+ foreach msg $msgs {
112
+ unsuppress_message PSM $msg
113
+ }
114
+ if { $failed } {
115
+ utl::warn FLW 1 "Unable to generate IR drop heatmap for $net on $corner"
116
+ return
117
+ }
118
+
119
+ foreach layer [[ord::get_db_tech] getLayers] {
120
+ if { [$layer getRoutingLevel] == 0 } {
121
+ continue
122
+ }
123
+ set layer_name [$layer getName]
124
+
125
+ gui::set_heatmap IRDrop Net $net
126
+ gui::set_heatmap IRDrop Corner $corner
127
+ gui::set_heatmap IRDrop Layer $layer_name
128
+ gui::set_heatmap IRDrop rebuild
129
+
130
+ sc_image_heatmap "IR Drop" \
131
+ "IRDrop" \
132
+ "irdrop/${net}.${corner}.${layer_name}.png" \
133
+ "IR drop for $net on $layer_name for $corner"
134
+ }
135
+ }
136
+
137
+ proc sc_image_routing_congestion { } {
138
+ if { ![sc_has_global_routing] } {
139
+ return
140
+ }
141
+
142
+ sc_image_setup_default
143
+
144
+ sc_image_heatmap "Routing Congestion" \
145
+ "Routing" \
146
+ "routing_congestion.png" \
147
+ "routing congestion" \
148
+ 0
149
+ }
150
+
151
+ proc sc_image_estimated_routing_congestion { } {
152
+ if { ![sc_has_placed_instances] } {
153
+ return
154
+ }
155
+
156
+ sc_image_setup_default
157
+
158
+ suppress_message GRT 10
159
+ catch {
160
+ sc_image_heatmap "Estimated Congestion (RUDY)" \
161
+ "RUDY" \
162
+ "estimated_routing_congestion.png" \
163
+ "estimated routing congestion" \
164
+ 0
165
+ } err
166
+ unsuppress_message GRT 10
167
+ }
168
+
169
+ proc sc_image_power_density { } {
170
+ if { ![sc_has_placed_instances] } {
171
+ return
172
+ }
173
+
174
+ sc_image_setup_default
175
+
176
+ file mkdir reports/images/heatmap/power_density
177
+
178
+ foreach corner [sta::corners] {
179
+ set corner_name [$corner name]
180
+
181
+ gui::set_heatmap Power Corner $corner_name
182
+ gui::set_heatmap Power rebuild
183
+
184
+ sc_image_heatmap "Power Density" \
185
+ "Power" \
186
+ "power_density/${corner_name}.png" \
187
+ "power density for $corner_name"
188
+ }
189
+ }
190
+
191
+ proc sc_image_placement_density { } {
192
+ if { ![sc_has_placed_instances] } {
193
+ return
194
+ }
195
+
196
+ sc_image_setup_default
197
+
198
+ sc_image_heatmap "Placement Density" \
199
+ "Placement" \
200
+ "placement_density.png" \
201
+ "placement density"
202
+ }
203
+
204
+ proc sc_image_clocks { } {
205
+ if { ![sc_has_placed_instances] } {
206
+ return
207
+ }
208
+
209
+ global sc_design
210
+ sc_image_setup_default
211
+
212
+ # The clock view: all clock nets and buffers
213
+ gui::set_display_controls "Layers/*" visible true
214
+ gui::set_display_controls "Nets/*" visible false
215
+ gui::set_display_controls "Nets/Clock" visible true
216
+ gui::set_display_controls "Instances/*" visible false
217
+ gui::set_display_controls "Instances/StdCells/Clock tree/*" visible true
218
+ if { [select -name "clk*" -type Inst] == 0 } {
219
+ # Nothing selected
220
+ return
221
+ }
222
+
223
+ sc_save_image "clocks" reports/images/${sc_design}.clocks.png
224
+ }
225
+
226
+ proc sc_image_clocktree { } {
227
+ gui::show_widget "Clock Tree Viewer"
228
+ global sc_design
229
+ global sc_scenarios
230
+
231
+ sc_image_setup_default
232
+ gui::set_display_controls "Layers/*" visible true
233
+ gui::set_display_controls "Nets/*" visible false
234
+ gui::set_display_controls "Nets/Clock" visible true
235
+
236
+ set clock_state []
237
+ foreach clock [all_clocks] {
238
+ lappend clock_state $clock [$clock is_propagated]
239
+ }
240
+ set_propagated_clock [all_clocks]
241
+
242
+ file mkdir reports/images/clocks
243
+ foreach clock [get_clocks *] {
244
+ if { [llength [get_property $clock sources]] == 0 } {
245
+ # Skip virtual clocks
246
+ continue
247
+ }
248
+ file mkdir reports/images/clocktree
249
+
250
+ set clock_name [get_name $clock]
251
+ foreach corner $sc_scenarios {
252
+ set path reports/images/clocktree/${clock_name}.${corner}.png
253
+ utl::info FLW 1 "Saving \"$clock_name\" clock tree for $corner to $path"
254
+ save_clocktree_image $path \
255
+ -clock $clock_name \
256
+ -width 1024 \
257
+ -height 1024 \
258
+ -corner $corner
259
+ }
260
+
261
+ if { [info commands gui::select_clockviewer_clock] != "" } {
262
+ gui::select_clockviewer_clock ${clock_name}
263
+ sc_save_image \
264
+ "clock - ${clock_name}" \
265
+ reports/images/clocks/${sc_design}.${clock_name}.png
266
+ }
267
+ }
268
+
269
+ foreach {clock state} $clock_state {
270
+ if { $state } {
271
+ set_propagated_clock $clock
272
+ } else {
273
+ unset_propagated_clock $clock
274
+ }
275
+ }
276
+
277
+ gui::hide_widget "Clock Tree Viewer"
278
+ }
279
+
280
+ proc sc_image_optimizer { } {
281
+ global sc_design
282
+ sc_image_setup_default
283
+
284
+ # The resizer view: all instances created by the resizer grouped
285
+ gui::set_display_controls "Layers/*" visible false
286
+ gui::set_display_controls "Instances/*" visible true
287
+ gui::set_display_controls "Instances/Physical/*" visible false
288
+
289
+ set hold_count [select -name "hold*" -type Inst -highlight 0] ;# green
290
+ set input_count [select -name "input*" -type Inst -highlight 1] ;# yellow
291
+ set output_count [select -name "output*" -type Inst -highlight 1]
292
+ set repeater_count [select -name "repeater*" -type Inst -highlight 3] ;# magenta
293
+ set fanout_count [select -name "fanout*" -type Inst -highlight 3]
294
+ set load_slew_count [select -name "load_slew*" -type Inst -highlight 3]
295
+ set max_cap_count [select -name "max_cap*" -type Inst -highlight 3]
296
+ set max_length_count [select -name "max_length*" -type Inst -highlight 3]
297
+ set wire_count [select -name "wire*" -type Inst -highlight 3]
298
+ set rebuffer_count [select -name "rebuffer*" -type Inst -highlight 4] ;# red
299
+ set split_count [select -name "split*" -type Inst -highlight 5] ;# dark green
300
+
301
+ set select_count [expr {
302
+ $hold_count +
303
+ $input_count +
304
+ $output_count +
305
+ $repeater_count +
306
+ $fanout_count +
307
+ $load_slew_count +
308
+ $max_cap_count +
309
+ $max_length_count +
310
+ $wire_count +
311
+ $rebuffer_count +
312
+ $split_count
313
+ }]
314
+
315
+ if { $select_count == 0 } {
316
+ # Nothing selected
317
+ return
318
+ }
319
+
320
+ sc_save_image "optimizer" reports/images/${sc_design}.optimizer.png
321
+ }
322
+
323
+ proc sc_image_markers { } {
324
+ global sc_design
325
+ sc_image_setup_default
326
+
327
+ file mkdir reports/images/markers
328
+ foreach markerdb [[ord::get_db_block] getMarkerCategories] {
329
+ if { [$markerdb getMarkerCount] == 0 } {
330
+ continue
331
+ }
332
+
333
+ gui::select_marker_category $markerdb
334
+
335
+ sc_save_image \
336
+ "markers - [$markerdb getName]" \
337
+ reports/images/markers/${sc_design}.[$markerdb getName].png
338
+ }
339
+
340
+ gui::select_marker_category NULL
341
+ }
342
+
343
+ # Setup
344
+ file mkdir reports/images
345
+ gui::save_display_controls
346
+ sc_image_setup_default
347
+
348
+ # General images
349
+ sc_image_everything
350
+ sc_image_placement
351
+ sc_image_routing
352
+
353
+ # Markers
354
+ sc_image_markers
355
+
356
+ # Heatmaps
357
+ if { [sc_cfg_tool_task_check_in_list placement_density var reports] } {
358
+ sc_image_placement_density
359
+ }
360
+
361
+ if { [sc_cfg_tool_task_check_in_list routing_congestion var reports] } {
362
+ sc_image_estimated_routing_congestion
363
+ sc_image_routing_congestion
364
+ }
365
+
366
+ if { [sc_cfg_tool_task_check_in_list power var reports] } {
367
+ if { [sc_cfg_tool_task_check_in_list power_density var reports] } {
368
+ sc_image_power_density
369
+ }
370
+
371
+ if { [sc_cfg_tool_task_check_in_list ir_drop var reports] } {
372
+ foreach net [sc_psm_check_nets] {
373
+ foreach corner $sc_scenarios {
374
+ sc_image_irdrop $net $corner
375
+ }
376
+ }
377
+ }
378
+ }
379
+
380
+ # Clocks
381
+ if { [sc_cfg_tool_task_check_in_list clock_placement var reports] } {
382
+ sc_image_clocks
383
+ }
384
+ if { [sc_cfg_tool_task_check_in_list clock_trees var reports] } {
385
+ sc_image_clocktree
386
+ }
387
+
388
+ # Optimizations
389
+ if { [sc_cfg_tool_task_check_in_list optimization_placement var reports] } {
390
+ sc_image_optimizer
391
+ }
392
+
393
+ # Restore
394
+ sc_image_clear_selection
395
+ gui::restore_display_controls