@@ -71,8 +71,12 @@ proc write_rc_csv { filename } {
7171 lassign $rc_var1($net_name) wire_res1 wire_cap1
7272 lassign $rc_var2($net_name) wire_res2 wire_cap2
7373 lassign $rc_var3($net_name) wire_res3 wire_cap3
74- puts -nonewline $stream " [ get_full_name $net ] ,[ expr { [string equal $type " CLOCK" ] ? " clock" : " signal" }],"
75- puts -nonewline $stream " [ format %.3e $wire_res1 ] ,[ format %.3e $wire_cap1 ] ,[ format %.3e $wire_res2 ] ,[ format %.3e $wire_cap2 ] ,[ format %.3e $wire_res3 ] ,[ format %.3e $wire_cap3 ] "
74+ set net_type [expr {[string equal $type " CLOCK" ] ? " clock" : " signal" }]
75+ puts -nonewline $stream " [ get_full_name $net ] ,$net_type ,"
76+ puts -nonewline $stream [concat \
77+ [format " %.3e" $wire_res1 ] " ," [format " %.3e" $wire_cap1 ] " ," \
78+ [format " %.3e" $wire_res2 ] " ," [format " %.3e" $wire_cap2 ] " ," \
79+ [format " %.3e" $wire_res3 ] " ," [format " %.3e" $wire_cap3 ]]
7680 set db_net [sta::sta_to_db_net $net ]
7781
7882 if { $use_drt_data } {
@@ -142,7 +146,8 @@ proc compare_wire_rc { count var_name ref_var_name } {
142146 # implicit arg to net_var_cap_less
143147 set var_cap_less_name $ref_var_name
144148 set nets [lsort -command net_var_cap_less [get_nets *]]
145- puts " net fanout [ format %5s $var_name ] [ format %5s $ref_var_name ] wire total [ format %5s $var_name ] [ format %5s $ref_var_name ] "
149+ puts " net fanout [ format %4s $var_name ] [ format %5s $ref_var_name ] \
150+ wire total [ format %5s $var_name ] [ format %5s $ref_var_name ] "
146151 puts " cap cap delta delta res res delta"
147152 set res_sum 0.0
148153 set res_count 0
@@ -163,16 +168,20 @@ proc compare_wire_rc { count var_name ref_var_name } {
163168 set res_avg [expr $res_sum / $count ]
164169 set cap_avg [expr $cap_sum / $count ]
165170 set total_cap_avg [expr $total_cap_sum / $count ]
166- puts " ----- ----- -----"
167- puts " [ format %+4.0f $cap_avg ] % [ format %+4.0f $total_cap_avg ] % [ format %+4.0f $res_avg ] %"
171+ puts " \
172+ ----- ----- -----"
173+ puts " \
174+ [ format %+4.0f $cap_avg ] % [ format %+4.0f $total_cap_avg ] %\
175+ [ format %+4.0f $res_avg ] %"
168176}
169177
170178proc compare_net_wire_rc { net_name var_name ref_var_name } {
171179 upvar 1 $var_name cap_var
172180 upvar 1 $ref_var_name ref_var
173181 global var_cap_less_name
174182
175- puts " net fanout [ format %5s $var_name ] [ format %5s $ref_var_name ] wire total"
183+ puts " net fanout [ format %5s $var_name ] [ format %5s $ref_var_name ] \
184+ wire total"
176185 puts " cap cap delta delta"
177186 compare_wire_rc1 [get_net $net_name ] $var_name $ref_var_name
178187}
@@ -210,9 +219,20 @@ proc compare_wire_rc1 { net var_name ref_var_name } {
210219
211220 set fanout [llength [get_pins -of $net -filter " direction == input" ]]
212221
213- puts -nonewline " [ format %-20s $net_name ] [ format %5d $fanout ] [ format %8s [sta::format_capacitance $wire_cap 3] ] [ format %8s [sta::format_capacitance $wire_cap_ref 3] ] [ format %4.0f $cap_delta ] % [ format %4.0f $total_delta ] %"
222+ puts -nonewline [concat \
223+ [format " %-20s" $net_name ] " " \
224+ [format " %5d" $fanout ] " " \
225+ [format " %8s" [sta::format_capacitance $wire_cap 3]] " " \
226+ [format " %8s" [sta::format_capacitance $wire_cap_ref 3]] " " \
227+ [format " %4.0f" $cap_delta ]% " " \
228+ [format " %4.0f" $total_delta ]% \
229+ ]
214230 if { $res > 0.0 } {
215- puts " [ format %8s [sta::format_resistance $res 3] ] [ format %8s [sta::format_resistance $res_ref 3] ] [ format %4.0f $res_delta ] %"
231+ puts [concat \
232+ [format " %8s" [sta::format_resistance $res 3]] " " \
233+ [format " %8s" [sta::format_resistance $res_ref 3]] " " \
234+ [format " %4.0f" $res_delta ]% \
235+ ]
216236 } else {
217237 puts " "
218238 }
@@ -231,8 +251,14 @@ proc write_layer_rc_cmds { adjustment } {
231251 set cap_edge [$layer getEdgeCapacitance]
232252 set cap_area [$layer getCapacitance]
233253 # Convert pF/um to F/um.
234- set cap [expr ($cap_edge * 2.0 + $wire_width * $cap_area ) * 1e-12 / (1.0 + $adjustment / 100.0)]
235- puts " set_layer_rc -layer [ $layer getConstName] -resistance [ format %.4e [sta::resistance_sta_ui $res ] ] -capacitance [ format %.4e [sta::capacitance_sta_ui $cap ] ]"
254+ set cap [expr \
255+ ($cap_edge * 2.0 + $wire_width * $cap_area ) * 1e-12 / (1.0 + $adjustment / 100.0) \
256+ ]
257+ puts [concat \
258+ " set_layer_rc -layer [ $layer getConstName] " \
259+ " -resistance [ format %.4e [sta::resistance_sta_ui $res ] ] " \
260+ " -capacitance [ format %.4e [sta::capacitance_sta_ui $cap ] ]" \
261+ ]
236262 }
237263 }
238264}
0 commit comments