net
Wednesday, November 16, 2022 4:25 PM
Foreach
• proc net {nets} {
redirect nets.tcl { foreach a $cell_driver {
puts "pin_name : $a"
set net_name [get_object_name [get_nets -of_objects [get_pins $a]]]
puts "net_name: $net_name"
set cell_name [get_object_name [get_cells -of_objects [get_pins $a]]]
puts "cell_name : $cell_name"
set lib_cell_name [get_object_name [get_lib_cells -of_objects [get_cells $cell_name]]]
puts "lib_cell_name : $lib_cell_name"
set dr_length [get_attribute [get_nets $net_name] dr_length]
puts "dr_length: $dr_length"
set route_length [get_attribute [get_nets $net_name] route_length]
puts "route_length: $route_length"
set flat_loads [get_attribute [get_nets $net_name] number_of_flat_loads]
puts "flat_loads: $flat_loads"
puts "///////////////////////////////////////////////////////////////////////"
}
}
}
• redirect nets.tcl { foreach a $cell {
puts "pin: $a"
set b [get_attribute [get_timing_paths -to $a] slack]
puts "slack: $b"
puts "/////////////////////////////////////////////////////////////////////////// /////"
}
}
• foreach a $sp { ; set slk [get_attribute [get_timing_paths -pba_mode ex -from $a -slack_lesser_than 0 -max_paths 10000 -nworst 100 ] slack ]
puts $fp " $a [get_attribute [get_cells -of_objects $a ] ref_name ] [lindex $slk 0 ] [llength $slk ] "
• while {1} {
puts "This loop will run forever."
}
• set fp [open eco.tcl w ]
set fp1 [open "ABC" r]
set file_data [read $fp1]
puts $file_data
set bbox $file_data
puts $bbox
foreach a $bbox {
set shape [ get_object_name [ get_shapes -intersect $a -filter "layer_name==M1" ] ]
set via [get_object_name [ get_vias -within $a -filter "cut_layer_names==VIA0" ] ]
puts $shape
puts $via
if {[get_attribute [get_shapes $shape] mask_constraint ] == "mask_two" } {
puts $fp "set_attribute \[get_shapes $shape \] -name mask_constraint -value mask_one "
puts $fp "set_attribute \[get_vias $via \] -name mask_constraint -value mask_one "
} else {
puts $fp "set_attribute \[get_shapes $shape \] -name mask_constraint -value mask_two "
puts $fp "set_attribute \[get_vias $via \] -name mask_constraint -value mask_two "
}
}
close $fp
close $fp1
set_edit_setting -update_color_mask true
derive_pg_mask_constraint -nets vss -derive_cut_mask
#derive_mask_constraint [get_shapes -of_object [get_net ABC]] -> this is for signal nets
SCRIPTS Page 1
timing
Wednesday, November 16, 2022 4:34 PM
set RTL_MODEL "SD1P0"
# Mske sure to place all the required min/max corners in the below file
set max_corner_file [open /nfs/site/disks/home_user/schinchx/max_corners r ] ; # contains max corner names
#set min_corner_file [open /nfs/site/disks/mtl_128_l3inf_par_03/bdixit/gtl3bankm/FSO_MAN_ECO_RUNS/min r]
set min_corner_file [open /nfs/site/disks/home_user/schinchx/min_corners r ] ; # contains min corner names
set path $argv
##puts $argv
set file4 "/10_eco/700_pv_caliber/rpts"
puts "$file4"
puts "max_corner,wns,tns,nvp"
########## max_corner ################################
while {[gets $max_corner_file word] >= 0} {
## puts "$path$file1"
#
set filepath3 "$path$file4\/$word.metrics.summary.rpt"
#puts $filepath3
#puts $filepath
if {[file exists $filepath3 ]== 1} {
set filehandle_main3 [open $filepath3 r]
while {[gets $filehandle_main3 main] >= 0} {
##### getting wns ####
if {[string match "*internal|*WNS*" $main]} {
set a [split $main |]
set req_wns3 [lindex $a end]
#puts $req_wns2
}
##### getting tns ####
if {[string match "*internal|*TNS*" $main]} {
set a [split $main |]
set req_tns3 [lindex $a end]
#puts $req_tns2
}
##### getting nvp ####
if {[string match "*internal|*Viols*" $main]} {
set a [split $main |]
set req_nvp3 [lindex $a end]
#puts $req_nvp2
}
}
} else {
set req_wns3 NA
set req_tns3 NA
set req_nvp3 NA
SCRIPTS Page 2
set req_nvp3 NA
}
#puts "$word, $req_wns3, $req_tns3, $req_nvp3"
#puts "$word,$req_wns,$req_tns,$req_nvp,$req_wns2,$req_tns2,$req_nvp2, $req_wns3, $req_tns3, $req_nvp3"
puts "$word\t,$req_wns3 $req_tns3 $req_nvp3"
}
puts "\n"
puts " ,$file4"
puts "min_corner,wns,tns,nvp"
################################ min_corner ##################################
########################## for 40 route #####################
while {[gets $min_corner_file word] >= 0} {
#set filepath "$path$file1\/$word.metrics.summary.rpt"
set filepath3 "$path$file4\/$word.metrics.summary.rpt"
#puts $filepath3
if {[file exists $filepath3 ]== 1} {
set filehandle_main3 [open $filepath3 r]
while {[gets $filehandle_main3 main] >= 0} {
##### getting wns ####
if {[string match "*internal|*WNS*" $main]} {
set a [split $main |]
set req_wns3 [lindex $a end]
#puts $req_wns2
}
##### getting tns ####
if {[string match "*internal|*TNS*" $main]} {
set a [split $main |]
set req_tns3 [lindex $a end]
#puts $req_tns2
}
##### getting nvp ####
if {[string match "*internal|*Viols*" $main]} {
set a [split $main |]
set req_nvp3 [lindex $a end]
#puts $req_nvp2
}
}
} else {
set req_wns3 NA
set req_tns3 NA
set req_nvp3 NA
}
puts "$word, $req_wns3, $req_tns3, $req_nvp3"
SCRIPTS Page 3
floating_Route_fix
Wednesday, November 16, 2022 4:23 PM
# script to remove all layer power shapes to solve shorts with signal
# PVCB SoC
# sachinns (11831915)
proc bbox_parser {lay} {
set errors [get_drc_errors -quiet -error_data gtcc_lvs.err -filter {type_name == "Floating Route"}]
set errorlist [list ]
foreach_in_collection err $errors {
set err_object [get_object_name [get_attr $err objects]]
set bb [get_attribute $err bbox]
set layer [get_attr [get_attribute $err layers] name]
if {$lay eq $layer} {
lappend errorlist $bb
if {[llength $errorlist]} {
return $errorlist
} else {
return 0
}
set ete(m0) 0.020
set ete(m1) 0.034
set ete(m2) 0.040
set ete(m3) 0.066
set ete(m4) 0.066
set ete(m5) 0.120
set ete(m6) 0.120
set ete(m7) 0.120
set ete(m8) 0.100
set ete(m9) 0.100
set ete(m10) 0.120
set ete(m11) 0.120
set ete(m12) 0.120
set ete(m13) 0.120
set ete(m14) 0.240
open_drc_error_data gtcc_lvs.err
set_snap_setting -enabled {false}
for {set i 0} {$i<=14} {incr i} {
puts "-I- working on Layer m$i..\n"
set bboxes [bbox_parser "m$i"]
SCRIPTS Page 4
set bboxes [bbox_parser "m$i"]
set total [llength $bboxes]
if {$bboxes != "0"} {
puts "\t-I- Found $total violation on layer m$i...\n"
set nc 0
foreach bbox $bboxes {
scan $bbox "{%f %f} {%f %f}" lx ly ux uy
#puts $bbox
#gui_add_annotation $bbox -color red -width 3
incr nc
puts "\t-i- checking $nc/$total locations...\n"
set shape ""
append_to_collection shape [get_shapes -quiet -intersect $bbox -filter "layer.name==m$i"]
append_to_collection shape [get_shapes -quiet -within $bbox -filter "layer.name==m$i"]
if {[sizeof_collection $shape]} {
catch {set_fixed_objects $shape -unfix}
catch {remove_shapes $shape }
}
} else {
puts "\t-Info- No Violations found for layer m$i ..\n"
}
}
#close_drc_error_data gtcc_lvs.err
SCRIPTS Page 5
m1_dens_mtl_64
Wednesday, November 16, 2022 4:31 PM
################################################################################
# Usage: ::power::m1_densification -pitch 0.204 -rp_x_left_extension 0.24
# -rp_x_right_extension 0 -rp_y_top_extension -0.1 -rp_y_bot_extension -0.1 -m2_extension 0.03
#
# Description: The following proc is used for M1 power densification in ELX. and extension of m2 and add vias
#
# Author(s): N S, Sachin/ Bugga, Yadu Vamsi Krishna
#################################################################################
namespace eval power {
proc m1_densification { args } {
parse_proc_arguments -args $args opts
set m1wid [get_attribute [get_layers M1] default_width]
set td $opts(-pitch)
if {[get_defined_attributes -class shape double_shape] == ""} {
define_user_attribute -quiet -classes shape -name double_shape -type {string}
}
set rp_box1 [get_attribute [get_rp_groups -quiet] bbox]
set rp_box2 [list ]
foreach r $rp_box1 {
if {![regexp {.*INVALID.*} $r m] } {
lappend rp_box2 $r
}
}
if {![llength $rp_box2]} {
set rp_box ""
} else {
catch {set rp_box [resize_polygon -size [list $opts(-rp_x_left_extension) $opts(-rp_y_top_extension) $opts(-rp_x_right_extension) $opts(-rp_y_bot_extension)] $rp_box2] }
}
if {[info exist opts(-bbox)] } {
if {[regexp {^\{\{[+-]?([0-9]*[.])?[0-9]+\s+[+-]?([0-9]*[.])?[0-9]+\}\s+\{[+-]?([0-9]*[.])?[0-9]+\s+[+-]?([0-9]*[.])?[0-9]+\}\}} $opts(-bbox) m]} {
set block $opts(-bbox)
set block_box $opts(-bbox)
#puts "INSIDE info"
} else {
puts "BBOX is not proper, exiting...\n"
return
}
} else {
set block [get_attribute [get_core_area] boundary]
set block_box [get_attribute [get_core_area] bbox]
#puts "No BBox given"
}
if {$rp_box == ""} {
#power::_msg INFO "No RP Group Objects found in this partition."
set ww [compute_polygons -objects1 $block -objects2 $block -operation AND]
} else {
set ww [compute_polygons -objects1 $block -objects2 $rp_box -operation NOT]
}
if {[get_attribute $ww is_empty]} {
#power::_msg ERROR "Unable to do M1 Power dnsification. Please contact RLS Team"
return
} else {
set bbs [get_attr [split_polygon -split vertical $ww -output poly_rect] bbox]
if {[llength [lindex [lindex $bbs 0] 0]] == 1 } {
set bbs [list $bbs]
}
}
set m1s ""
foreach bb $bbs {
#power::_msg INFO "Checking $bb \n"
append_to_collection m1s [get_shapes -quiet -filter "layer.name==M1&&(net_type==power||net_type==ground)" -within $bb] -unique
#append_to_collection m1s [get_shapes -quiet -filter "layer.name==M1&&(net_type==power)" -intersect $bb] -unique
SCRIPTS Page 6
}
foreach_in_collection m1 $m1s {
set m1b [get_attribute $m1 bbox]
set m1own [get_attribute $m1 owner.name]
scan $m1b "{%f %f} {%f %f}" mlx mly mux muy
#power::_msg INFO "Checking $m1b \n"
set mpx [expr ($mlx+$mux)/2]
set nmpx [expr $mpx+$td]
set nb [list [list [expr $mpx+$td-($m1wid/2)] $mly] [list [expr $mpx+$td+($m1wid/2)] $muy]]
set ex_m1 [get_shapes -quiet -filter "layer.name==M1&&(net_type==power||net_type==ground)" -intersect $nb -within $nb]
set ex_pin [get_pins -quiet -filter "layer.name==M1&&net_name!=$m1own" -intersect $nb -within $nb]
# RF ebb check
#set RF [get_cells -quiet -filter "(ref_name=~*rf*||ref_name=~*ssa*)&&design_type==macro" -hier -intersect $nb]
if {![sizeof_collection $ex_m1] && ![sizeof_collection $ex_pin]} {
set sh [create_shape -layer M1 -net $m1own -shape_type path -shape_use stripe -width $m1wid -path [list [list $nmpx $mly] [list $nmpx $muy]]]
set_attribute $sh double_shape true
#check for M2
#set m2cb [list [list [expr $mpx+$td-($m1wid/2)] $mly] [list [expr $mpx+($td/2)+($m1wid/2)] $muy]]
set m2cb $m1b
set ex_m2 [get_shapes -quiet -filter "layer.name==M2&&owner.name==$m1own" -intersect $m2cb]
append_to_collection ex_m2 [get_shapes -quiet -filter "layer.name==M2&&owner.name==$m1own" -within $m2cb] -unique
if {[sizeof_collection $ex_m2]} {
set urx [lindex [lsort -unique -real [get_attribute $ex_m2 bbox_urx]] 0]
if {!($urx >= [expr $mpx+$td+($m1wid/2)+$opts(-m2_extension)])} {
set nurx [expr $mpx+$td+($m1wid/2)+$opts(-m2_extension)]
# create m2 here
foreach_in_collection m2 $ex_m2 {
set m2b [get_attribute $m2 bbox]
scan $m2b "{%f %f} {%f %f}" m2lx m2ly m2ux m2uy
set m2wid [expr $m2uy-$m2ly]
set nm2b [list [list [expr $urx-0.001] $m2ly] [list $nurx $m2uy]]
#gui_add_annotation $nm2b -color red -width 3
set m2py [expr ($m2ly+$m2uy)/2]
set sh [create_shape -layer M2 -net $m1own -shape_type path -shape_use stripe -width $m2wid -path [list [list [expr $urx-0.001] $m2py] [list $nurx $m2py]]]
set_attribute $sh double_shape true
}
}
} else {
#no m2 found skipping
}
} else {
#power::_msg INFO "M1 shape exists @ $nb, Skipping"
gui_add_annotation $nb -color red -width 4
}
}
set pgnets [lsort -unique [get_attribute [get_nets -all -filter "(net_type==power||net_type==ground)"] name]]
create_pg_vias -within_bbox $block_box -from_layers M0 -to_layers M1 -nets $pgnets -tag double_shape
create_pg_vias -within_bbox $block_box -from_layers M1 -to_layers M2 -nets $pgnets -tag double_shape
#power::_msg INFO "M1 VCC* shapes doubled. Please use attribute double_shape==true to select them"
}
define_proc_attributes m1_densification \
-info "The following proc does M1 power densification for ELX.\n" \
-define_args {
{-bbox "rectangular area" "" string optional}
{-pitch "M1 power pitch" "" string optional}
{-rp_x_left_extension "RP bbox x left increase value" "" float required}
{-rp_x_right_extension "RP bbox x right increase value" "" float required}
{-rp_y_top_extension "RP bbox y top increase value" "" float required}
{-rp_y_bot_extension "RP bbox y bot increase value" "" float required}
{-m2_extension "m2 extension required from M1 edge" "" float required}
}
}
SCRIPTS Page 7
m5_area_mtl_64
Wednesday, November 16, 2022 4:31 PM
set bbox {
{{{12.3435 415.7500} {12.3815 415.9180}}}
{{{221.1155 192.8420} {221.1535 193.0100}}}
{{{65.6955 628.7020} {65.7335 628.8700}}}
{{{96.5515 622.1660} {96.5895 622.3340}}}
{{{96.9315 620.7220} {96.9695 620.8900}}}
{{{98.6035 620.2660} {98.6415 620.4340}}}
set DELTA ""
foreach b $bbox {
set shape1 [get_shapes -intersect "$b" -filter "layer.name == M5 "]
foreach_in_collection shape $shape1 {
set_attribute -objects $shape -name physical_status -value unrestricted
set_fixed_objects $shape -unfix
echo Original Length: [get_attribute $shape name] \t [get_attribute $shape length]
set DELTA [expr [expr 0.61 - [get_attribute $shape length ]] / 2.0]
if [get_attribute [get_shapes $shape] is_vertical] {
SCRIPTS Page 8
if [get_attribute [get_shapes $shape] is_vertical] {
set llx [get_attribute $shape bbox_llx]
set lly [get_attribute $shape bbox_lly]
set urx [get_attribute $shape bbox_urx]
set ury [get_attribute $shape bbox_ury]
set LLY [expr $lly - $DELTA]
set URY [expr $ury + $DELTA]
set coordV [list [list $llx $LLY] [list $urx $URY]]
resize_objects $shape -bbox $coordV
echo New Length: \t [get_attribute $shape name] \t [get_attribute $shape length]
set_attribute -objects $shape -name physical_status -value fixed
set_fixed_objects $shape
echo "Number of extended shapes: " [sizeof_collection $shape1]
SCRIPTS Page 9
mtl_64_RV_hookup
Wednesday, November 16, 2022 4:31 PM
# script places RV vias on M15 and AP (inclined)
# sachinns (11831915)
# MTL-64
if {[get_defined_attributes -class via hookup_sac] == ""} {
define_user_attribute -quiet -persistent -classes via -name hookup_sac -type {string}
}
set AP [get_shapes -filter "layer.name==AP&&shape_use==rdl&&(net_type==power||net_type==ground||net_type==signal)"]
set M15 [get_shapes -filter "layer.name==M15&&shape_use==user_route&&(net_type==power||net_type==ground||net_type==signal)"]
set rv_def "VIA15AP"
gui_remove_all_annotations
set nets [lsort -uniq [get_attribute $AP owner.name]]
foreach net $nets {
puts "-I- Working on Net $net ..\n"
set AP [get_shapes -filter "layer.name==AP&&shape_use==rdl&&owner.name==$net"]
set M15 [get_shapes -filter "layer.name==M15&&shape_use==user_route&&owner.name==$net"]
set ww [compute_polygons -objects1 $AP -objects2 $M15 -operation AND]
if {![get_attribute $ww is_empty]} {
set wwb [get_attribute [split_polygons $ww] bbox]
#puts "WWB [llength $wwb]"
foreach b $wwb {
set exv [get_vias -quiet -filter "lower_layer.name==M15" -within $b]
append_to_collection exv [get_vias -quiet -filter "lower_layer.name==M15" -intersect $b] -unique
set RBS [get_routing_blockages -quiet -filter "layer.name==RV" -intersect $b]
if {![sizeof_collection $exv] && ![sizeof_collection $RBS]} {
#gui_add_annotation $b -color red -width 5
scan $b "{%f %f} {%f %f}" lx ly ux uy
set h [format %0.3f [expr $uy-$ly]]
set w [format %0.3f [expr $ux-$lx]]
if {$h > "7.100" && $h < "10.000" && $w >="3.600"} {
set mx [expr ($lx+$ux)/2]
set my [expr ($ly+$uy)/2]
set vs [create_via -net $net -via_def $rv_def -origin [list $mx $my] -orientation R0 -shape_use user_route]
set_attribute $vs hookup_sac true
if {($h =="9.113") && ($w=="8.100")} {
set v [gui_change_via_size -via [get_vias $vs] -rows 2 -columns 2]
set_attribute $v hookup_sac true
gui_add_annotation $b -color red -width 5
} elseif {($h < "9.113") && ($w=="8.100")} {
set v [gui_change_via_size -via [get_vias $vs] -rows 2 -columns 1]
set_attribute $v hookup_sac true
set_attribute -objects [get_vias $v] -name orientation -value R90
gui_add_annotation $b -color green -width 5
} else {
set v [gui_change_via_size -via [get_vias $vs] -rows 2 -columns 1]
set_attribute $v hookup_sac true
gui_add_annotation $b -color blue -width 5
SCRIPTS Page 10
gui_add_annotation $b -color blue -width 5
}
}
}
}
set vs [get_vias -filter "hookup_sac==true&&owner.name==$net"]
puts "\t-I- Added [sizeof_collection $vs] $net vias ..\n"
} else {
puts "No M15 found for $net ..\n"
}
}
puts "\n################### Vias added ######################\n"
puts "Use command change_selection \[get_vias -filter \"hookup_sac==true\"\] to select added vias\n"
puts "#######################################################\n"
SCRIPTS Page 11
rv
Wednesday, November 16, 2022 4:31 PM
##usage user SCHINCHX`
proc grid_densification {args} {
parse_proc_arguments -args $args opts
set mlayer $opts(-layer)
scan $opts(-bbox) "{%f %f} {%f %f}" x1 y1 x2 y2
set bbox $opts(-bbox)
set offset_copy_opts [expr [ info exists opts(-offset) ] && [ info exists opts(-copies) ]]
#set cont_opts [ info exists opts(-continuous) ]
set cont_opts 1
set mnet [get_object_name [get_nets -all $opts(-net) -quiet -filter "net_type == power || net_type == ground"]]
echo "[get_object_name $mnet] [ llength $mnet]"
set mnet_type [get_attribute [get_nets -all $mnet] net_type]
if {[sizeof_collection [get_layer -quiet $mlayer]] == 0} {
return "Specify a valid metal layer"
}
if { [ llength $mnet] != 1} {
return "Specify only 1 valid pg net at a time"
}
if { !($offset_copy_opts || $cont_opts) } {
return "Specify offset and copies or continous or all 3 together"
}
set tag "default_grid_densification_proc"
if {[info exists opts(-tag)]} {
set tag $opts(-tag)
}
###TODO : Think abt converting the spacing check bbox to offset+copies bbox
if {[info exists ::common::params(pwr_util_pwr_spacing_check)] && [llength [lsearch -index 0 -inline -all $::common::params(pwr_util_pwr_spacing_check) $mlayer]] == 1 } {
set spacing_check [lindex [lindex [lsearch -index 0 -inline -all $::common::params(pwr_util_pwr_spacing_check) $mlayer] 0] 1]
}
set offset $opts(-offset)
set copies $opts(-copies)
set dir [get_attribute [get_layer $mlayer] routing_direction]
set mshp_coll [get_shapes -within $bbox -filter "owner.name==$mnet && layer_name==$mlayer"]
echo "[sizeof_collection $mshp_coll]"
append_to_collection mshp_coll [get_shapes -intersect $bbox -filter "owner.name==$mnet && layer_name==$mlayer"]
if {[info exists opts(-shape)]} {
set mshp_coll [get_shapes $opts(-shape)]
}
set mshp_coll [filter_collection $mshp_coll "undefined(tag) || tag!~*${tag}*" ]
unset -nocomplain mshp_dict
set uniq_x {}
set uniq_y {}
set mwidth [lsort -uniq [get_attribute $mshp_coll width]]
echo "[sizeof_collection $mshp_coll]"
foreach_in_collection mshp $mshp_coll {
scan [get_attribute $mshp bbox] "{%f %f} {%f %f}" a1 b1 a2 b2
dict set mshp_dict [get_object_name $mshp] x1 $a1
dict set mshp_dict [get_object_name $mshp] y1 $b1
dict set mshp_dict [get_object_name $mshp] x2 $a2
dict set mshp_dict [get_object_name $mshp] y2 $b2
lappend uniq_x $a1
lappend uniq_y $b1
}
set uniq_x [lsort -uniq -real $uniq_x]
set uniq_y [lsort -uniq -real $uniq_y]
if {$cont_opts} {
echo "Working"
if {$dir == "vertical"} {
echo "X- $uniq_x"
foreach shp_x $uniq_x {
set low_y $y1
set high_y $y2
if {[info exists spacing_check]} {
if {[sizeof_collection [get_shapes -intersect [list [list $shp_x [expr $y1-$spacing_check]] [list [expr $shp_x+0.001] [expr $y1-0.001] ]] -filter "owner.name==$mnet && layer_name==$mlayer"] ] > 0} {
set low_y [expr $y1-$spacing_check]
} elseif {[sizeof_collection [get_shapes -intersect [list [list $shp_x [expr $y1-$spacing_check]] [list [expr $shp_x+0.001] [expr $y1-0.001] ]] -filter "owner.name!=$mnet && layer_name==$mlayer"] ] > 0} {
set low_y [expr $y1+$spacing_check]
}
if {[sizeof_collection [get_shapes -intersect [list [list $shp_x [expr $y2+0.001]] [list [expr $shp_x+0.001] [expr $y2+$spacing_check] ]] -filter "owner.name==$mnet && layer_name==$mlayer"] ] > 0} {
set high_y [expr $y2+$spacing_check]
} elseif {[sizeof_collection [get_shapes -intersect [list [list $shp_x [expr $y2+0.001]] [list [expr $shp_x+0.001] [expr $y2+$spacing_check] ]] -filter "owner.name~=$mnet && layer_name==$mlayer"] ] > 0} {
set high_y [expr $y2-$spacing_check]
}
}
if {[ info exists opts(-no_drc_check) ]} {
create_man_pattern [expr $shp_x+$mwidth/2] [expr $shp_x+($offset*$copies)+$mwidth/2] $offset $low_y $high_y $mwidth $mlayer $ mnet $tag
} else {
create_pg_strap -layer $mlayer -direction $dir -start [expr $shp_x+$mwidth/2] -stop [expr $shp_x+($offset*$copies)+$mwidth/2] -low_end $low_y -high_end $high_y -pitch $offset -width $mwidth -net $mnet -tag $tag -
via_rule {{{intersection:adjacent}{via_master:default}}}
}
}
} else {
echo "y - $uniq_y"
foreach shp_y $uniq_y {
set low_x $x1
set high_x $x2
if {[info exists spacing_check]} {
if {[sizeof_collection [get_shapes -intersect [list [list [expr $x1-$spacing_check] $shp_y] [list [expr $x1-0.001] [expr $shp_y+0.001] ]] -filter "owner.name==$mnet && layer_name==$mlayer"] ] > 0} {
set low_x [expr $x1-$spacing_check]
} elseif {[sizeof_collection [get_shapes -intersect [list [list [expr $x1-$spacing_check] $shp_y] [list [expr $x1-0.001] [expr $shp_y+0.001] ]] -filter "owner.name!=$mnet && layer_name==$mlayer"] ] > 0} {
SCRIPTS Page 12
} elseif {[sizeof_collection [get_shapes -intersect [list [list [expr $x1-$spacing_check] $shp_y] [list [expr $x1-0.001] [expr $shp_y+0.001] ]] -filter "owner.name!=$mnet && layer_name==$mlayer"] ] > 0} {
set low_x [expr $x1+$spacing_check]
}
if {[sizeof_collection [get_shapes -intersect [list [list [expr $x2+0.001] $shp_y] [list [expr $x2+$spacing_check] [expr $shp_y+0.001] ]] -filter "owner.name==$mnet && layer_name==$mlayer"] ] > 0} {
set high_x [expr $x2+$spacing_check]
} elseif {[sizeof_collection [get_shapes -intersect [list [list [expr $x2+0.001] $shp_y] [list [expr $x2+$spacing_check] [expr $shp_y+0.001] ]] -filter "owner.name!=$mnet && layer_name==$mlayer"] ] > 0} {
set high_x [expr $x2-$spacing_check]
}
}
set shp_stop [expr ($y2 < [expr $shp_y+($mwidth/2)+($offset*$copies)] )? $y2 : [expr $shp_y+($mwidth/2)+($offset*$copies)] ]
if {[ info exists opts(-no_drc_check) ]} {
create_man_pattern $low_x $high_x $offset [expr $shp_y+$mwidth/2] $shp_stop $mwidth $mlayer $mnet $tag
} else {
create_pg_strap -layer $mlayer -direction $dir -start [expr $shp_y+$mwidth/2] -stop $shp_stop -low_end $low_x -high_end $high_x -pitch $offset -width $mwidth -net $mnet -tag $tag -via_rule {{{intersection:adjacent}
{via_master:default}}}
}
}
}
}
}
#strap -layer M2 -direction horizontal -start [expr 40.9700+0.006] -stop [expr 40.9700+0.3] -low_end 6.6800 -high_end 8.0100 -pitch 0.286 -width 0. ^M012 -net VSS
define_proc_attributes grid_densification \
-info "Takes care of doing grid densification" \
-define_args {
{-bbox "{{x1 y1} {x2 y2}}" "" list required}
{-layer "Layer to densify" "" string required}
{-net "Net to densify" "" string required}
{-tag "Tag for the new shapes" "" string optional}
{-offset "Offset for the next shape wrt original shape" "" float optional}
{-copies "No. of times a layer in the bbox is copied on the offset val" "" int optional}
{-continuous "Make existing shapes continuous" "" boolean optional}
{-shape "Collection of shape" "" string optional}
{-no_drc_check "Create shapes without drc check and via" "" boolean optional}
}
SCRIPTS Page 13