-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathrun_invs_AutoDMP.tcl
242 lines (196 loc) · 7.96 KB
/
run_invs_AutoDMP.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------------
# Setup
# ------------------------------------------------------------------------------
setMultiCpuUsage -localCpu 16
# design settings
source lib_setup.tcl
source design_setup.tcl
set handoff_dir "./syn_handoff"
set netlist ${handoff_dir}/${DESIGN}.v
set sdc ${handoff_dir}/${DESIGN}.sdc
# utilities
source ../../../../util/extract_report.tcl
source AutoDMP_utils.tcl
# report settings
set encDir enc
set dpDir dpCollaterals
if {![file exists $encDir/]} {
exec mkdir $encDir/
}
if {![file exists $dpDir/]} {
exec mkdir $dpDir/
}
# flow settings
set var(AutoDMP,prePlace) 0; # run pre- or post-AutoDMP flow
set var(AutoDMP,unoptNetlist) 0; # use unoptimized or optimized netlist
set var(AutoDMP,macrosOnly) 0; # use macros only vs. +std cells AutoDMP placement
set technology "NanGate45"
set designName "${DESIGN}_${technology}"
# ------------------------------------------------------------------------------
# Pre-AutoDMP flow
# ------------------------------------------------------------------------------
if { ${var(AutoDMP,prePlace)} == 1 } {
puts "###### INFO: Running Pre-AutoDMP flow ######"
puts "###### Configuration: "
parray var
# create corners
source mmmc_setup.tcl
# default settings
set init_pwr_net VDD
set init_gnd_net VSS
# default settings
set init_verilog "$netlist"
set init_design_netlisttype "Verilog"
set init_design_settop 1
set init_top_cell "$DESIGN"
set init_lef_file "$lefs"
# MCMM setup
init_design -setup {WC_VIEW} -hold {BC_VIEW}
set_power_analysis_mode -leakage_power_view WC_VIEW -dynamic_power_view WC_VIEW
set_interactive_constraint_modes {CON}
setAnalysisMode -reset
setAnalysisMode -analysisType onChipVariation -cppr both
clearGlobalNets
globalNetConnect VDD -type pgpin -pin VDD -inst * -override
globalNetConnect VSS -type pgpin -pin VSS -inst * -override
globalNetConnect VDD -type tiehi -inst * -override
globalNetConnect VSS -type tielo -inst * -override
setOptMode -powerEffort low -leakageToDynamicRatio 0.5
setGenerateViaMode -auto true
generateVias
# basic path groups
createBasicPathGroups -expanded
# initialize report
echo "PD Stage, Core Area (um^2), Std Cell Area (um^2), Macro Area (um^2), Total Power (mW), Wirelength (um), WS (ns), TNS (ns), Congestion (H), Congestion (V)" > ${designName}_DETAILS.rpt
set rpt_post_synth [extract_report postSynth]
echo "$rpt_post_synth" >> ${designName}_DETAILS.rpt
# setup floorplan
defIn ${floorplan_def}
if {[dbget top.terms.pStatus -v -e fixed] != "" } {
source ../../../../util/place_pin.tcl
}
addHaloToBlock -allMacro $HALO_WIDTH $HALO_WIDTH $HALO_WIDTH $HALO_WIDTH
# setup P&R options
setPlaceMode -place_detail_legalization_inst_gap 1
setFillerMode -fitGap true
setDesignMode -topRoutingLayer $TOP_ROUTING_LAYER
setDesignMode -bottomRoutingLayer 2
if { ${var(AutoDMP,unoptNetlist)} == 1 } {
# extract AutoDMP files
source generate_bookshelf.tcl
saveDesign -tcon -verilog -def ${encDir}/${designName}_preDP.enc
} else {
# concurrent macro placement
place_design -concurrent_macros
refine_macro_place
dbset [dbget top.insts.cell.subClass block -p2].pStatus fixed
# standard cell placement
setPlaceMode -place_opt_run_global_place full
place_opt_design
# extract AutoDMP files
source generate_bookshelf.tcl
saveDesign -tcon -verilog -def ${encDir}/${designName}_preDP.enc
}
exit
}
# ------------------------------------------------------------------------------
# Post-AutoDMP Flow
# ------------------------------------------------------------------------------
if { ${var(AutoDMP,prePlace)} == 0 } {
puts "###### INFO: Running Post-AutoDMP flow ######"
puts "###### Configuration: "
parray var
# load DB
source ${encDir}/${designName}_preDP.enc
# update constraint mode
update_constraint_mode -name CON -sdc_files ${sdc}
# load AutoDMP placement
set best_candidate [evaluate_paretos]
defIn -components ${best_candidate}
refine_macro_place
dbset [dbget top.insts.cell.baseClass block -p2].pStatus fixed
# refinePlace -eco true
if { ${var(AutoDMP,macrosOnly)} == 1 } {
dbset [dbget top.insts.cell.subClass core -p2].pStatus unplaced; # unplace std cells
}
# PDN
source ../../../../../Enablements/${technology}/util/pdn_config.tcl
source pdn_flow.tcl
# place-opt
if { ${var(AutoDMP,macrosOnly)} == 1 } {
setPlaceMode -place_opt_run_global_place full
place_opt_design
} else {
# some cells might be unplaced due to P/G grid
dbset [dbget top.insts.pStatus unplaced -p].pStatus placed
if { ${var(AutoDMP,unoptNetlist)} == 1 } {
# setDesignMode -flowEffort extreme
place_opt_design -incremental
# place_opt_design -incremental; # -incremental_timing
# setDesignMode -flowEffort standard
} else {
place_opt_design -incremental
}
}
saveDesign -tcon -verilog -def ${encDir}/${designName}_preCTS.enc
set rpt_pre_cts [extract_report preCTS]
echo "Post-AutoDMP $rpt_pre_cts" >> ${designName}_DETAILS.rpt
# CTS
set_ccopt_property post_conditioning_enable_routing_eco 1
set_ccopt_property -cts_def_lock_clock_sinks_after_routing true
setOptMode -unfixClkInstForOpt false
create_ccopt_clock_tree_spec
ccopt_design
set_interactive_constraint_modes [all_constraint_modes -active]
set_propagated_clock [all_clocks]
set_clock_propagation propagated
saveDesign -tcon -verilog -def $encDir/${designName}_cts.enc
set rpt_post_cts [extract_report postCTS]
echo "$rpt_post_cts" >> ${designName}_DETAILS.rpt
# routing
setNanoRouteMode -drouteVerboseViolationSummary 1
setNanoRouteMode -routeWithSiDriven true
setNanoRouteMode -routeWithTimingDriven true
setNanoRouteMode -routeUseAutoVia true
##Recommended by lib owners
# Prevent router modifying M1 pins shapes
setNanoRouteMode -routeWithViaInPin "1:1"
setNanoRouteMode -routeWithViaOnlyForStandardCellPin "1:1"
## limit VIAs to ongrid only for VIA1 (S1)
setNanoRouteMode -drouteOnGridOnly "via 1:1"
setNanoRouteMode -drouteAutoStop false
setNanoRouteMode -drouteExpAdvancedMarFix true
setNanoRouteMode -routeExpAdvancedTechnology true
#SM suggestion for solving long extraction runtime during GR
setNanoRouteMode -grouteExpWithTimingDriven false
routeDesign
saveDesign -tcon -verilog -def ${encDir}/${designName}_route.enc
defOut -netlist -floorplan -routing ${designName}_route.def
set rpt_post_route [extract_report postRoute]
echo "$rpt_post_route" >> ${designName}_DETAILS.rpt
### Post-route Opt ###
optDesign -postRoute
set rpt_post_route [extract_report postRouteOpt]
echo "$rpt_post_route" >> ${designName}_DETAILS.rpt
### Run DRC and LVS ###
verify_connectivity -error 0 -geom_connect -no_antenna
verify_drc -limit 0
summaryReport -noHtml -outfile summaryReport/post_route.sum
saveDesign -tcon -verilog -def ${encDir}/${designName}.enc
defOut -netlist -floorplan -routing ${designName}.def
exit
}