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.
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/sc_remote.py +15 -14
- siliconcompiler/apps/sc_show.py +5 -5
- siliconcompiler/apps/utils/replay.py +136 -0
- siliconcompiler/core.py +14 -12
- siliconcompiler/flows/_common.py +11 -13
- siliconcompiler/flows/asicflow.py +83 -42
- siliconcompiler/remote/__init__.py +11 -0
- siliconcompiler/remote/client.py +753 -815
- siliconcompiler/report/report.py +2 -0
- siliconcompiler/report/summary_table.py +1 -1
- siliconcompiler/scheduler/__init__.py +51 -9
- siliconcompiler/scheduler/send_messages.py +37 -33
- siliconcompiler/scheduler/validation/email_credentials.json +7 -0
- siliconcompiler/schema/schema_cfg.py +15 -3
- siliconcompiler/schema/schema_obj.py +16 -0
- siliconcompiler/sphinx_ext/dynamicgen.py +4 -3
- siliconcompiler/targets/fpgaflow_demo.py +6 -7
- siliconcompiler/targets/gf180_demo.py +3 -3
- siliconcompiler/templates/replay/requirements.txt +6 -0
- siliconcompiler/templates/replay/run.py.j2 +22 -0
- siliconcompiler/templates/replay/setup.sh +17 -0
- siliconcompiler/tools/_common/__init__.py +17 -3
- siliconcompiler/tools/_common/asic.py +10 -3
- siliconcompiler/tools/builtin/concatenate.py +1 -1
- siliconcompiler/tools/openroad/__init__.py +103 -0
- siliconcompiler/tools/openroad/{openroad.py → _apr.py} +413 -422
- siliconcompiler/tools/openroad/antenna_repair.py +78 -0
- siliconcompiler/tools/openroad/clock_tree_synthesis.py +64 -0
- siliconcompiler/tools/openroad/detailed_placement.py +59 -0
- siliconcompiler/tools/openroad/detailed_route.py +62 -0
- siliconcompiler/tools/openroad/endcap_tapcell_insertion.py +52 -0
- siliconcompiler/tools/openroad/fillercell_insertion.py +58 -0
- siliconcompiler/tools/openroad/{dfm.py → fillmetal_insertion.py} +35 -19
- siliconcompiler/tools/openroad/global_placement.py +58 -0
- siliconcompiler/tools/openroad/global_route.py +63 -0
- siliconcompiler/tools/openroad/init_floorplan.py +103 -0
- siliconcompiler/tools/openroad/macro_placement.py +65 -0
- siliconcompiler/tools/openroad/metrics.py +23 -8
- siliconcompiler/tools/openroad/pin_placement.py +56 -0
- siliconcompiler/tools/openroad/power_grid.py +65 -0
- siliconcompiler/tools/openroad/rcx_bench.py +7 -4
- siliconcompiler/tools/openroad/rcx_extract.py +2 -1
- siliconcompiler/tools/openroad/rdlroute.py +4 -4
- siliconcompiler/tools/openroad/repair_design.py +59 -0
- siliconcompiler/tools/openroad/repair_timing.py +63 -0
- siliconcompiler/tools/openroad/screenshot.py +9 -20
- siliconcompiler/tools/openroad/scripts/apr/postamble.tcl +44 -0
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +95 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_antenna_repair.tcl +51 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +62 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_placement.tcl +41 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +71 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_endcap_tapcell_insertion.tcl +55 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_fillercell_insertion.tcl +27 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_fillmetal_insertion.tcl +36 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_global_placement.tcl +26 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +61 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +333 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +123 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_metrics.tcl +22 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_pin_placement.tcl +41 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +60 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +68 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +83 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +125 -0
- siliconcompiler/tools/openroad/scripts/common/debugging.tcl +28 -0
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +675 -0
- siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +59 -0
- siliconcompiler/tools/openroad/scripts/common/read_liberty.tcl +20 -0
- siliconcompiler/tools/openroad/scripts/common/read_timing_constraints.tcl +16 -0
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +180 -0
- siliconcompiler/tools/openroad/scripts/common/screenshot.tcl +18 -0
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +395 -0
- siliconcompiler/tools/openroad/scripts/{sc_rcx_bench.tcl → rcx/sc_rcx_bench.tcl} +5 -5
- siliconcompiler/tools/openroad/scripts/{sc_rcx_extract.tcl → rcx/sc_rcx_extract.tcl} +0 -0
- siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +5 -16
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +51 -51
- siliconcompiler/tools/openroad/scripts/sc_show.tcl +105 -0
- siliconcompiler/tools/openroad/show.py +28 -23
- siliconcompiler/tools/openroad/{export.py → write_data.py} +31 -26
- siliconcompiler/tools/opensta/__init__.py +1 -1
- siliconcompiler/tools/vivado/bitstream.py +8 -2
- siliconcompiler/tools/vivado/place.py +6 -2
- siliconcompiler/tools/vivado/route.py +6 -2
- siliconcompiler/tools/vivado/scripts/sc_bitstream.tcl +1 -1
- siliconcompiler/tools/vivado/scripts/sc_place.tcl +1 -1
- siliconcompiler/tools/vivado/scripts/sc_route.tcl +1 -1
- siliconcompiler/tools/vivado/scripts/sc_run.tcl +4 -2
- siliconcompiler/tools/vivado/syn_fpga.py +5 -1
- siliconcompiler/tools/vivado/vivado.py +26 -10
- siliconcompiler/tools/vpr/vpr.py +5 -0
- siliconcompiler/tools/yosys/syn_asic.py +7 -0
- siliconcompiler/tools/yosys/syn_asic.tcl +27 -6
- siliconcompiler/tools/yosys/syn_fpga.tcl +26 -18
- siliconcompiler/toolscripts/_tools.json +5 -5
- {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/METADATA +50 -48
- {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/RECORD +103 -76
- {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/WHEEL +1 -1
- siliconcompiler/tools/openroad/cts.py +0 -45
- siliconcompiler/tools/openroad/floorplan.py +0 -75
- siliconcompiler/tools/openroad/physyn.py +0 -27
- siliconcompiler/tools/openroad/place.py +0 -41
- siliconcompiler/tools/openroad/route.py +0 -45
- siliconcompiler/tools/openroad/scripts/__init__.py +0 -0
- siliconcompiler/tools/openroad/scripts/sc_apr.tcl +0 -514
- siliconcompiler/tools/openroad/scripts/sc_cts.tcl +0 -68
- siliconcompiler/tools/openroad/scripts/sc_dfm.tcl +0 -22
- siliconcompiler/tools/openroad/scripts/sc_export.tcl +0 -100
- siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +0 -456
- siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +0 -1
- siliconcompiler/tools/openroad/scripts/sc_physyn.tcl +0 -6
- siliconcompiler/tools/openroad/scripts/sc_place.tcl +0 -84
- siliconcompiler/tools/openroad/scripts/sc_procs.tcl +0 -494
- siliconcompiler/tools/openroad/scripts/sc_report.tcl +0 -189
- siliconcompiler/tools/openroad/scripts/sc_route.tcl +0 -143
- siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +0 -18
- siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +0 -393
- /siliconcompiler/tools/openroad/scripts/{sc_write.tcl → common/write_data.tcl} +0 -0
- {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.28.8.dist-info → siliconcompiler-0.29.0.dist-info}/top_level.txt +0 -0
|
@@ -1,494 +0,0 @@
|
|
|
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 {
|
|
23
|
-
$or_uniform_density + ((1.0 - $or_uniform_density) *
|
|
24
|
-
$openroad_gpl_uniform_placement_adjustment) + $or_adjust_density_adder
|
|
25
|
-
}]
|
|
26
|
-
if { $or_uniform_adjusted_density > 1.00 } {
|
|
27
|
-
utl::warn FLW 1 "Adjusted density exceeds 1.00 ([format %0.3f $or_uniform_adjusted_density]),\
|
|
28
|
-
reverting to use ($openroad_gpl_place_density) for global placement"
|
|
29
|
-
set selected_density $openroad_gpl_place_density
|
|
30
|
-
} else {
|
|
31
|
-
utl::info FLW 1 "Using computed density of ([format %0.3f $or_uniform_adjusted_density])\
|
|
32
|
-
for global placement"
|
|
33
|
-
set selected_density $or_uniform_adjusted_density
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
# Final selection
|
|
38
|
-
set or_uniform_zero_adjusted_density \
|
|
39
|
-
[expr { min($or_uniform_density + $or_adjust_density_adder, 1.0) }]
|
|
40
|
-
|
|
41
|
-
if { $selected_density < $or_uniform_density } {
|
|
42
|
-
utl::warn FLW 1 "Using computed density of ([format %0.3f $or_uniform_zero_adjusted_density])\
|
|
43
|
-
for global placement as [format %0.3f $selected_density] < [format %0.3f $or_uniform_density]"
|
|
44
|
-
set selected_density $or_uniform_zero_adjusted_density
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return $selected_density
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
proc sc_global_placement { args } {
|
|
51
|
-
sta::parse_key_args "sc_global_placement" args \
|
|
52
|
-
keys {} \
|
|
53
|
-
flags {-skip_io -disable_routability_driven}
|
|
54
|
-
sta::check_argc_eq0 "sc_global_placement" $args
|
|
55
|
-
|
|
56
|
-
global openroad_gpl_routability_driven
|
|
57
|
-
global openroad_gpl_timing_driven
|
|
58
|
-
global openroad_gpl_padding
|
|
59
|
-
|
|
60
|
-
set openroad_gpl_args []
|
|
61
|
-
if {
|
|
62
|
-
$openroad_gpl_routability_driven == "true" &&
|
|
63
|
-
![info exists flags(-disable_routability_driven)]
|
|
64
|
-
} {
|
|
65
|
-
lappend openroad_gpl_args "-routability_driven"
|
|
66
|
-
}
|
|
67
|
-
if { $openroad_gpl_timing_driven == "true" } {
|
|
68
|
-
lappend openroad_gpl_args "-timing_driven"
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if { [info exists flags(-skip_io)] } {
|
|
72
|
-
lappend openroad_gpl_args "-skip_io"
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
set density [sc_global_placement_density]
|
|
76
|
-
|
|
77
|
-
global_placement {*}$openroad_gpl_args \
|
|
78
|
-
-density $density \
|
|
79
|
-
-pad_left $openroad_gpl_padding \
|
|
80
|
-
-pad_right $openroad_gpl_padding
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
###########################
|
|
84
|
-
# Detailed Placement
|
|
85
|
-
###########################
|
|
86
|
-
|
|
87
|
-
proc sc_detailed_placement { } {
|
|
88
|
-
global openroad_dpl_padding
|
|
89
|
-
global openroad_dpl_padding
|
|
90
|
-
global openroad_dpl_disallow_one_site
|
|
91
|
-
global openroad_dpl_max_displacement
|
|
92
|
-
|
|
93
|
-
set_placement_padding -global \
|
|
94
|
-
-left $openroad_dpl_padding \
|
|
95
|
-
-right $openroad_dpl_padding
|
|
96
|
-
|
|
97
|
-
set dpl_args []
|
|
98
|
-
if { $openroad_dpl_disallow_one_site == "true" } {
|
|
99
|
-
lappend dpl_args "-disallow_one_site_gaps"
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
detailed_placement -max_displacement $openroad_dpl_max_displacement \
|
|
103
|
-
{*}$dpl_args
|
|
104
|
-
check_placement -verbose
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
###########################
|
|
108
|
-
# Pin Placement
|
|
109
|
-
###########################
|
|
110
|
-
|
|
111
|
-
proc sc_pin_placement { args } {
|
|
112
|
-
sta::parse_key_args "sc_pin_placement" args \
|
|
113
|
-
keys {} \
|
|
114
|
-
flags {-random}
|
|
115
|
-
sta::check_argc_eq0 "sc_pin_placement" $args
|
|
116
|
-
|
|
117
|
-
global sc_cfg
|
|
118
|
-
global sc_tool
|
|
119
|
-
global sc_task
|
|
120
|
-
global sc_hpinmetal
|
|
121
|
-
global sc_vpinmetal
|
|
122
|
-
global openroad_ppl_arguments
|
|
123
|
-
|
|
124
|
-
if { [sc_cfg_tool_task_exists var pin_thickness_h] } {
|
|
125
|
-
set h_mult [lindex [sc_cfg_tool_task_get var pin_thickness_h] 0]
|
|
126
|
-
set_pin_thick_multiplier -hor_multiplier $h_mult
|
|
127
|
-
}
|
|
128
|
-
if { [sc_cfg_tool_task_exists var pin_thickness_v] } {
|
|
129
|
-
set v_mult [lindex [sc_cfg_tool_task_get var pin_thickness_v] 0]
|
|
130
|
-
set_pin_thick_multiplier -ver_multiplier $v_mult
|
|
131
|
-
}
|
|
132
|
-
if { [sc_cfg_tool_task_exists {file} ppl_constraints] } {
|
|
133
|
-
foreach pin_constraint [sc_cfg_tool_task_get {file} ppl_constraints] {
|
|
134
|
-
puts "Sourcing pin constraints: ${pin_constraint}"
|
|
135
|
-
source $pin_constraint
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
set ppl_args []
|
|
140
|
-
if { [info exists flags(-random)] } {
|
|
141
|
-
lappend ppl_args "-random"
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
place_pins -hor_layers $sc_hpinmetal \
|
|
145
|
-
-ver_layers $sc_vpinmetal \
|
|
146
|
-
{*}$openroad_ppl_arguments \
|
|
147
|
-
{*}$ppl_args
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
###########################
|
|
151
|
-
# Check if OR has a GUI
|
|
152
|
-
###########################
|
|
153
|
-
|
|
154
|
-
proc sc_has_gui { } {
|
|
155
|
-
return [gui::supported]
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
###########################
|
|
159
|
-
# Check if design has placed instances
|
|
160
|
-
###########################
|
|
161
|
-
|
|
162
|
-
proc sc_has_placed_instances { } {
|
|
163
|
-
foreach inst [[ord::get_db_block] getInsts] {
|
|
164
|
-
if { [$inst isPlaced] } {
|
|
165
|
-
return true
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return false
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
###########################
|
|
172
|
-
# Check if design has unplaced instances
|
|
173
|
-
###########################
|
|
174
|
-
|
|
175
|
-
proc sc_has_unplaced_instances { } {
|
|
176
|
-
foreach inst [[ord::get_db_block] getInsts] {
|
|
177
|
-
if { ![$inst isPlaced] } {
|
|
178
|
-
return true
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return false
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
###########################
|
|
185
|
-
# Check if design has routing
|
|
186
|
-
###########################
|
|
187
|
-
|
|
188
|
-
proc sc_has_routing { } {
|
|
189
|
-
foreach net [[ord::get_db_block] getNets] {
|
|
190
|
-
if { [$net getWire] != "NULL" } {
|
|
191
|
-
return true
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return false
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
###########################
|
|
198
|
-
# Check if design has global routing
|
|
199
|
-
###########################
|
|
200
|
-
|
|
201
|
-
proc sc_has_global_routing { } {
|
|
202
|
-
foreach net [[ord::get_db_block] getNets] {
|
|
203
|
-
if { [llength [$net getGuides]] != 0 } {
|
|
204
|
-
return true
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return false
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
###########################
|
|
211
|
-
# Design has unplaced macros
|
|
212
|
-
###########################
|
|
213
|
-
|
|
214
|
-
# Function adapted from OpenROAD:
|
|
215
|
-
# https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/ca3004b85e0d4fbee3470115e63b83c498cfed85/flow/scripts/macro_place.tcl#L26
|
|
216
|
-
proc sc_design_has_unplaced_macros { } {
|
|
217
|
-
foreach inst [[ord::get_db_block] getInsts] {
|
|
218
|
-
if { [$inst isBlock] && ![$inst isFixed] } {
|
|
219
|
-
return true
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return false
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
###########################
|
|
226
|
-
# Print macros placement
|
|
227
|
-
###########################
|
|
228
|
-
|
|
229
|
-
proc sc_print_macro_information { } {
|
|
230
|
-
set print_header "true"
|
|
231
|
-
foreach inst [[ord::get_db_block] getInsts] {
|
|
232
|
-
if { [$inst isBlock] } {
|
|
233
|
-
set master [$inst getMaster]
|
|
234
|
-
set status [$inst getPlacementStatus]
|
|
235
|
-
|
|
236
|
-
if { $print_header == "true" } {
|
|
237
|
-
puts "Macro placement information"
|
|
238
|
-
set print_header "false"
|
|
239
|
-
}
|
|
240
|
-
if { [$inst isPlaced] } {
|
|
241
|
-
set location [$inst getLocation]
|
|
242
|
-
set orient [$inst getOrient]
|
|
243
|
-
set xloc [ord::dbu_to_microns [lindex $location 0]]
|
|
244
|
-
set yloc [ord::dbu_to_microns [lindex $location 1]]
|
|
245
|
-
puts "[$inst getName] ([$master getName]): $status at ($xloc um, $yloc um) $orient"
|
|
246
|
-
} else {
|
|
247
|
-
utl::warn FLW 1 "[$inst getName] ([$master getName]): UNPLACED"
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
###########################
|
|
254
|
-
# Design has unplaced pads
|
|
255
|
-
###########################
|
|
256
|
-
|
|
257
|
-
proc sc_design_has_unplaced_pads { } {
|
|
258
|
-
foreach inst [[ord::get_db_block] getInsts] {
|
|
259
|
-
if { [$inst isPad] && ![$inst isFixed] } {
|
|
260
|
-
return true
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return false
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
###########################
|
|
267
|
-
# Design has placable IOs
|
|
268
|
-
###########################
|
|
269
|
-
|
|
270
|
-
proc sc_design_has_placeable_ios { } {
|
|
271
|
-
foreach bterm [[ord::get_db_block] getBTerms] {
|
|
272
|
-
if {
|
|
273
|
-
[$bterm getFirstPinPlacementStatus] != "FIXED" &&
|
|
274
|
-
[$bterm getFirstPinPlacementStatus] != "LOCKED"
|
|
275
|
-
} {
|
|
276
|
-
return true
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return false
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
###########################
|
|
283
|
-
# Check if net has placed bpins
|
|
284
|
-
###########################
|
|
285
|
-
|
|
286
|
-
proc sc_bterm_has_placed_io { net } {
|
|
287
|
-
set net [[ord::get_db_block] findNet $net]
|
|
288
|
-
|
|
289
|
-
foreach bterm [$net getBTerms] {
|
|
290
|
-
if { [$bterm getFirstPinPlacementStatus] != "UNPLACED" } {
|
|
291
|
-
return true
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return false
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
###########################
|
|
298
|
-
# Find nets regex
|
|
299
|
-
###########################
|
|
300
|
-
|
|
301
|
-
proc sc_find_net_regex { net_name } {
|
|
302
|
-
set nets []
|
|
303
|
-
|
|
304
|
-
foreach net [[ord::get_db_block] getNets] {
|
|
305
|
-
if { [string match $net_name [$net getName]] } {
|
|
306
|
-
lappend nets [$net getName]
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
return $nets
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
###########################
|
|
314
|
-
# Get supply nets in design
|
|
315
|
-
###########################
|
|
316
|
-
|
|
317
|
-
proc sc_supply_nets { } {
|
|
318
|
-
set nets []
|
|
319
|
-
|
|
320
|
-
foreach net [[ord::get_db_block] getNets] {
|
|
321
|
-
set type [$net getSigType]
|
|
322
|
-
if { $type == "POWER" || $type == "GROUND" } {
|
|
323
|
-
lappend nets [$net getName]
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
return $nets
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
###########################
|
|
331
|
-
# Get nets for PSM to check
|
|
332
|
-
###########################
|
|
333
|
-
|
|
334
|
-
proc sc_psm_check_nets { } {
|
|
335
|
-
global openroad_psm_enable
|
|
336
|
-
global openroad_psm_skip_nets
|
|
337
|
-
|
|
338
|
-
if { $openroad_psm_enable == "true" } {
|
|
339
|
-
set psm_nets []
|
|
340
|
-
|
|
341
|
-
foreach net [sc_supply_nets] {
|
|
342
|
-
set skipped false
|
|
343
|
-
foreach skip_pattern $openroad_psm_skip_nets {
|
|
344
|
-
if { [string match $skip_pattern $net] } {
|
|
345
|
-
set skipped true
|
|
346
|
-
break
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if { !$skipped } {
|
|
350
|
-
lappend psm_nets $net
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return $psm_nets
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
return []
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
###########################
|
|
361
|
-
# Save an image
|
|
362
|
-
###########################
|
|
363
|
-
|
|
364
|
-
proc sc_save_image { title path { pixels 1000 } } {
|
|
365
|
-
utl::info FLW 1 "Saving \"$title\" to $path"
|
|
366
|
-
|
|
367
|
-
save_image -resolution [sc_image_resolution $pixels] \
|
|
368
|
-
-area [sc_image_area] \
|
|
369
|
-
$path
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
###########################
|
|
373
|
-
# Get the image bounding box
|
|
374
|
-
###########################
|
|
375
|
-
|
|
376
|
-
proc sc_image_area { } {
|
|
377
|
-
set box [[ord::get_db_block] getDieArea]
|
|
378
|
-
set width [$box dx]
|
|
379
|
-
set height [$box dy]
|
|
380
|
-
|
|
381
|
-
# apply 5% margin
|
|
382
|
-
set xmargin [expr { int(0.05 * $width) }]
|
|
383
|
-
set ymargin [expr { int(0.05 * $height) }]
|
|
384
|
-
|
|
385
|
-
set area []
|
|
386
|
-
lappend area [ord::dbu_to_microns [expr { [$box xMin] - $xmargin }]]
|
|
387
|
-
lappend area [ord::dbu_to_microns [expr { [$box yMin] - $ymargin }]]
|
|
388
|
-
lappend area [ord::dbu_to_microns [expr { [$box xMax] + $xmargin }]]
|
|
389
|
-
lappend area [ord::dbu_to_microns [expr { [$box yMax] + $ymargin }]]
|
|
390
|
-
return $area
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
###########################
|
|
394
|
-
# Get the image resolution (um / pixel)
|
|
395
|
-
###########################
|
|
396
|
-
|
|
397
|
-
proc sc_image_resolution { pixels } {
|
|
398
|
-
set box [[ord::get_db_block] getDieArea]
|
|
399
|
-
return [expr { [ord::dbu_to_microns [$box maxDXDY]] / $pixels }]
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
###########################
|
|
403
|
-
# Clear gui selections
|
|
404
|
-
###########################
|
|
405
|
-
|
|
406
|
-
proc sc_image_clear_selection { } {
|
|
407
|
-
gui::clear_highlights -1
|
|
408
|
-
gui::clear_selections
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
###########################
|
|
412
|
-
# Setup default GUI setting for images
|
|
413
|
-
###########################
|
|
414
|
-
|
|
415
|
-
proc sc_image_setup_default { } {
|
|
416
|
-
gui::restore_display_controls
|
|
417
|
-
|
|
418
|
-
sc_image_clear_selection
|
|
419
|
-
|
|
420
|
-
gui::fit
|
|
421
|
-
|
|
422
|
-
# Setup initial visibility to avoid any previous settings
|
|
423
|
-
gui::set_display_controls "*" visible false
|
|
424
|
-
gui::set_display_controls "Layers/*" visible true
|
|
425
|
-
gui::set_display_controls "Nets/*" visible true
|
|
426
|
-
gui::set_display_controls "Instances/*" visible true
|
|
427
|
-
gui::set_display_controls "Shape Types/*" visible true
|
|
428
|
-
gui::set_display_controls "Misc/Instances/*" visible true
|
|
429
|
-
gui::set_display_controls "Misc/Instances/Pin Names" visible false
|
|
430
|
-
gui::set_display_controls "Misc/Scale bar" visible true
|
|
431
|
-
gui::set_display_controls "Misc/Highlight selected" visible true
|
|
432
|
-
gui::set_display_controls "Misc/Detailed view" visible true
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
###########################
|
|
436
|
-
# Count the logic depth of the critical path
|
|
437
|
-
###########################
|
|
438
|
-
|
|
439
|
-
proc count_logic_depth { } {
|
|
440
|
-
set count 0
|
|
441
|
-
set paths [find_timing_paths -sort_by_slack]
|
|
442
|
-
if { [llength $paths] == 0 } {
|
|
443
|
-
return 0
|
|
444
|
-
}
|
|
445
|
-
set path_ref [[lindex $paths 0] path]
|
|
446
|
-
set pins [$path_ref pins]
|
|
447
|
-
foreach pin $pins {
|
|
448
|
-
if { [$pin is_driver] } {
|
|
449
|
-
incr count
|
|
450
|
-
}
|
|
451
|
-
set vertex [lindex [$pin vertices] 0]
|
|
452
|
-
# Stop at clock vertex
|
|
453
|
-
if { [$vertex is_clock] } {
|
|
454
|
-
break
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
# Subtract 1 to account for initial launch
|
|
458
|
-
return [expr { $count - 1 }]
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
###########################
|
|
462
|
-
# Translate schema rotation
|
|
463
|
-
###########################
|
|
464
|
-
|
|
465
|
-
proc sc_convert_rotation { rot } {
|
|
466
|
-
if { [string match "MZ*" $rot] } {
|
|
467
|
-
utl::error FLW 1 "Z mirroring is not supported in OpenROAD"
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
switch $rot {
|
|
471
|
-
"R0" { return "R0" }
|
|
472
|
-
"R90" { return "R90" }
|
|
473
|
-
"R180" { return "R180" }
|
|
474
|
-
"R270" { return "R270" }
|
|
475
|
-
"MX" { return "MX" }
|
|
476
|
-
"MX_R90" { return "MXR90" }
|
|
477
|
-
"MX_R180" { return "MY" }
|
|
478
|
-
"MX_R270" { return "MYR90" }
|
|
479
|
-
"MY" { return "MY" }
|
|
480
|
-
"MY_R90" { return "MYR90" }
|
|
481
|
-
"MY_R180" { return "MX" }
|
|
482
|
-
"MY_R270" { return "MXR90" }
|
|
483
|
-
default { utl::error FLW 1 "$rot not recognized" }
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
proc sc_check_version { min_required } {
|
|
488
|
-
set version [split [ord::openroad_version] "-"]
|
|
489
|
-
if { [lindex $version 0] != "v2.0" } {
|
|
490
|
-
return false
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
return [expr { [lindex $version 1] >= $min_required }]
|
|
494
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
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 {
|
|
63
|
-
[sc_cfg_tool_task_check_in_list clock_skew var reports] &&
|
|
64
|
-
[llength [all_clocks]] > 0
|
|
65
|
-
} {
|
|
66
|
-
puts "$PREFIX clock_skew"
|
|
67
|
-
report_clock_skew -setup -digits 4 > reports/timing/skew.setup.rpt
|
|
68
|
-
sc_display_report reports/timing/skew.setup.rpt
|
|
69
|
-
report_clock_skew_metric -setup
|
|
70
|
-
report_clock_skew -hold -digits 4 > reports/timing/skew.hold.rpt
|
|
71
|
-
sc_display_report reports/timing/skew.hold.rpt
|
|
72
|
-
report_clock_skew_metric -hold
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if { [sc_cfg_tool_task_check_in_list drv_violations var reports] } {
|
|
76
|
-
puts "$PREFIX DRV violators"
|
|
77
|
-
report_check_types -max_slew -max_capacitance -max_fanout -violators \
|
|
78
|
-
> reports/timing/drv_violators.rpt
|
|
79
|
-
sc_display_report reports/timing/drv_violators.rpt
|
|
80
|
-
report_erc_metrics
|
|
81
|
-
|
|
82
|
-
puts "$PREFIX floating nets"
|
|
83
|
-
report_floating_nets -verbose > reports/floating_nets.rpt
|
|
84
|
-
sc_display_report reports/floating_nets.rpt
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
utl::metric_int "timing__clocks" [llength [all_clocks]]
|
|
88
|
-
|
|
89
|
-
if { [sc_cfg_tool_task_check_in_list fmax var reports] } {
|
|
90
|
-
puts "$PREFIX fmax"
|
|
91
|
-
# Model on: https://github.com/The-OpenROAD-Project/OpenSTA/blob/f913c3ddbb3e7b4364ed4437c65ac78c4da9174b/tcl/Search.tcl#L1078
|
|
92
|
-
set fmax_metric 0
|
|
93
|
-
foreach clk [sta::sort_by_name [all_clocks]] {
|
|
94
|
-
set clk_name [get_name $clk]
|
|
95
|
-
set min_period [sta::find_clk_min_period $clk 1]
|
|
96
|
-
if { $min_period == 0.0 } {
|
|
97
|
-
continue
|
|
98
|
-
}
|
|
99
|
-
set fmax [expr { 1.0 / $min_period }]
|
|
100
|
-
utl::metric_float "timing__fmax__clock:${clk_name}" $fmax
|
|
101
|
-
puts "$clk_name fmax = [format %.2f [expr { $fmax / 1e6 }]] MHz"
|
|
102
|
-
set fmax_metric [expr { max($fmax_metric, $fmax) }]
|
|
103
|
-
}
|
|
104
|
-
if { $fmax_metric > 0 } {
|
|
105
|
-
utl::metric_float "timing__fmax" $fmax_metric
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
# get logic depth of design
|
|
110
|
-
utl::metric_int "design__logic__depth" [count_logic_depth]
|
|
111
|
-
|
|
112
|
-
if { [sc_cfg_tool_task_check_in_list power var reports] } {
|
|
113
|
-
puts "$PREFIX power"
|
|
114
|
-
foreach corner [sta::corners] {
|
|
115
|
-
set corner_name [$corner name]
|
|
116
|
-
puts "Power for corner: $corner_name"
|
|
117
|
-
report_power -corner $corner_name > reports/power/${corner_name}.rpt
|
|
118
|
-
sc_display_report reports/power/${corner_name}.rpt
|
|
119
|
-
}
|
|
120
|
-
report_power_metric -corner $sc_power_corner
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
puts "$PREFIX cellarea"
|
|
124
|
-
report_design_area
|
|
125
|
-
report_design_area_metrics
|
|
126
|
-
|
|
127
|
-
# get number of nets in design
|
|
128
|
-
utl::metric_int "design__nets" [llength [[ord::get_db_block] getNets]]
|
|
129
|
-
|
|
130
|
-
# get number of registers
|
|
131
|
-
utl::metric_int "design__registers" [llength [all_registers]]
|
|
132
|
-
|
|
133
|
-
# get number of buffers
|
|
134
|
-
set bufs 0
|
|
135
|
-
set invs 0
|
|
136
|
-
foreach inst [get_cells -hierarchical *] {
|
|
137
|
-
set cell [$inst cell]
|
|
138
|
-
if { $cell == "NULL" } {
|
|
139
|
-
continue
|
|
140
|
-
}
|
|
141
|
-
set liberty_cell [$cell liberty_cell]
|
|
142
|
-
if { $liberty_cell == "NULL" } {
|
|
143
|
-
continue
|
|
144
|
-
}
|
|
145
|
-
if { [$liberty_cell is_buffer] } {
|
|
146
|
-
incr bufs
|
|
147
|
-
} elseif { [$liberty_cell is_inverter] } {
|
|
148
|
-
incr invs
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
utl::metric_int "design__buffers" $bufs
|
|
152
|
-
utl::metric_int "design__inverters" $invs
|
|
153
|
-
|
|
154
|
-
# get number of unconstrained endpoints
|
|
155
|
-
with_output_to_variable endpoints {check_setup -unconstrained_endpoints}
|
|
156
|
-
set unconstrained_endpoints [regexp -all -inline {[0-9]+} $endpoints]
|
|
157
|
-
if { $unconstrained_endpoints == "" } {
|
|
158
|
-
set unconstrained_endpoints 0
|
|
159
|
-
}
|
|
160
|
-
utl::metric_int "timing__unconstrained" $unconstrained_endpoints
|
|
161
|
-
|
|
162
|
-
# Write markers
|
|
163
|
-
foreach markerdb [[ord::get_db_block] getMarkerCategories] {
|
|
164
|
-
if { [$markerdb getMarkerCount] == 0 } {
|
|
165
|
-
continue
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
$markerdb writeTR "reports/markers/${sc_design}.[$markerdb getName].rpt"
|
|
169
|
-
$markerdb writeJSON "reports/markers/${sc_design}.[$markerdb getName].json"
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if { [sc_check_version 17038] } {
|
|
173
|
-
utl::push_metrics_stage "sc__cellarea__{}"
|
|
174
|
-
tee -file reports/cell_usage.rpt {report_cell_usage -verbose}
|
|
175
|
-
|
|
176
|
-
foreach modinst [[ord::get_db_block] getModInsts] {
|
|
177
|
-
tee -quiet -append -file reports/cell_usage.rpt { puts "" }
|
|
178
|
-
tee -quiet -append -file reports/cell_usage.rpt {
|
|
179
|
-
puts "########################################################"
|
|
180
|
-
}
|
|
181
|
-
tee -quiet -append -file reports/cell_usage.rpt { puts "" }
|
|
182
|
-
|
|
183
|
-
utl::metric "design__instance__name__in_module:[[$modinst getMaster] getName]" \
|
|
184
|
-
[$modinst getHierarchicalName]
|
|
185
|
-
tee -quiet -append -file reports/cell_usage.rpt \
|
|
186
|
-
"report_cell_usage -verbose [$modinst getHierarchicalName]"
|
|
187
|
-
}
|
|
188
|
-
utl::pop_metrics_stage
|
|
189
|
-
}
|