pdn_flow.tcl 5.77 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#################################################################
# minCh:    If channel width is less than minCh it will be filled 
#           with hard blockages.
# layers:   Name of the layers.
# width:    Width of the layer.
# pitch:    Distance b/w two vdd/vss set.
# spacing:  Spacing b/w the stripe of vdd and vss.
# ldir:     Layer direction. 0 is horizontal and 1 is vertical.
# isMacro:  If layer stripe is only above macro.
# isBM:     If layer is below the top layer of macro.
# isAM:     If layer is above the top layer of macro.
# isFP:     If layer is for follow pin.
# soffset:  Start offset of the stripe.
# addch:    Any requierment to add extra layer in the macro
#           channel.
#################################################################

set nets [list VDD VSS]
#### Un Place Global Placed cells and cut Row ####
20
dbset [dbget top.insts.cell.subClass core -p2 ].pStatus unplaced
21 22 23 24 25 26 27 28 29 30
finishFloorplan -fillPlaceBlockage hard $minCh
cutRow
finishFloorplan -fillPlaceBlockage hard $minCh 
###################################################

############### Global Net Creation ###############
clearGlobalNets
globalNetConnect VDD -type pgpin -pin VDD -inst *   -override
globalNetConnect VSS -type pgpin -pin VSS -inst *   -override

31 32 33 34
######################## For SKY130HD  #######################
globalNetConnect VDD -type pgpin -pin VPWR -inst *   -override
globalNetConnect VSS -type pgpin -pin VGND -inst *   -override

35 36 37 38 39 40 41 42 43 44 45
# globalNetConnect VDD -type pgpin -pin VDDCE -inst *   -override
# globalNetConnect VDD -type pgpin -pin VDDPE -inst *   -override
# globalNetConnect VSS -type pgpin -pin VSSE -inst *   -override
# 
# globalNetConnect VDD -type pgpin -pin VNW -inst *   -override
# globalNetConnect VSS -type pgpin -pin VPW -inst *   -override

globalNetConnect VDD -type tiehi -all  -override
globalNetConnect VSS -type tielo -all  -override
####################################################

46 47 48 49
deselectAll
select_obj [dbget top.fplan.pBlkgs.name finishfp_place_blkg_* -p1]
deleteSelectedFromFPlan
deselectAll
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73

setGenerateViaMode -auto true
generateVias
editDelete -type Special -net $nets 
setViaGenMode -ignore_DRC false
setViaGenMode -optimize_cross_via true
setViaGenMode -allow_wire_shape_change false
setViaGenMode -extend_out_wire_end false
setViaGenMode -viarule_preference generated

sroute

setAddStripeMode -orthogonal_only true -ignore_DRC false
setAddStripeMode -over_row_extension true

set prevLayer [lindex $layers 0]
set prevbl ""
set i 1
set lcount [llength $layers]
set flag1 0

while { $i < $lcount } {
    set lname [lindex $layers $i]
    set isfp [lindex $isFP $i]
74
    set wdth [lindex $width $i]
75 76 77 78 79 80 81 82
    set dir "vertical"
    
    if { [lindex $ldir $i] == 0 } {
        set dir "horizontal"
    }

    if { $isfp == 1 } {
        puts "Add follow pin creation script"
83 84 85 86 87 88 89
        deselectAll
        editSelect -layer [lindex $layers 0] -net $nets
        editDuplicate -layer_horizontal $lname
        deselectAll
        editSelect -layer $lname -net $nets
        editResize -to $wdth -side high -direction y -keep_center_line 1
        deselectAll
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
    } else {
        set isbm [lindex $isBM $i]
        set ism [lindex $isMacro $i]
        set isam [lindex $isAM $i]
        set spc [lindex $spacing $i]
        set ptch [lindex $pitch $i]
        set sofst [lindex $soffset $i]
        set isch [lindex $addch $i]

        setAddStripeMode -stacked_via_bottom_layer $prevLayer -stacked_via_top_layer $lname
        setAddStripeMode -inside_cell_only false
        setAddStripeMode -route_over_rows_only false
        setAddStripeMode -extend_to_closest_target area_boundary
        if { $isbm == 1 } {
            set prevbl $lname
            setAddStripeMode -route_over_rows_only true
            addStripe -layer $lname -direction $dir -nets $nets -width $wdth -spacing $spc \
                -start_offset $sofst -set_to_set_distance $ptch
            if { $isch == 1 } { 
                setAddStripeMode -extend_to_closest_target same_dir_stripe
                addStripe -layer $lname -direction $dir -nets $nets -width $wdth -spacing $spc \
                    -start_offset $sofst -set_to_set_distance $ptch -narrow_channel 1
            }
        } elseif { $ism == 1 } {
            setAddStripeMode -extend_to_closest_target none 
            setAddStripeMode -inside_cell_only true
116
            foreach mcell [dbget [dbget top.insts.cell.subClass block -p2 ].cell.name -u] {
117 118 119
                addStripe -layer $lname -direction $dir -nets $nets -width $wdth -spacing $spc \
                    -start_offset $sofst -set_to_set_distance $ptch -master $mcell
            }
120
            foreach inst [dbget [dbget top.insts.cell.subClass block -p2 ].name ] {
121 122 123 124 125 126 127 128 129
                createRouteBlk -inst $inst -cover -layer $prevLayer -name mcro_blk
            }
        } elseif { $isam == 1 } {
            if { $flag1 == 0 } {
                set flag1 1
                set prevLayer $prevbl
                setAddStripeMode -stacked_via_bottom_layer $prevLayer -stacked_via_top_layer $lname
            }
            addStripe -layer $lname -direction $dir -nets $nets -width $wdth -spacing $spc \
130
                -start_offset $sofst -set_to_set_distance $ptch -extend_to design_boundary
131 132 133 134 135 136 137 138 139
            if { $isch == 1 } {
                setAddStripeMode -extend_to_closest_target same_dir_stripe 
                addStripe -layer $lname -direction $dir -nets $nets -width $wdth -spacing $spc \
                    -start_offset $sofst -set_to_set_distance $ptch -narrow_channel 1
            }
        } else {
            puts "Layer:$lname is not routed"
        }
    }
140 141
    set prevLayer $lname
    set i [expr $i + 1]
142 143
}
deleteRouteBlk -name mcro_blk
144
# verify_connectivity -net $nets -geom_connect -no_antenna -error 0
145 146 147

# placeDesign -concurrent_macro changes the default placement 
# settings
148
setPlaceMode -place_opt_run_global_place full