换cell

上一篇 / 下一篇  2017-11-17 17:32:21

#command
fix_drc_H240 -cal_db rpts/CbTileDRC/drc.db -rule H240.xx.xx.x -size_cell

#code
proc fix_drc_H240 {args} {
    set options(-cal_db) ""
    set options(-output) "fix_base_drc.tcl"
    set options(-size_cell) false
    parse_proc_arguments -args $args options
    set drc_loc [get_cal_drc $options(-rule) $options(-cal_db)]
    set num_drc [sizeof_collection $drc_loc]
    set output_file [open $options(-output) "w"]
    set all_nets {}
    foreach_in_collection loc $drc_loc {
        set bound [get_attribute $loc bbox]
        puts "working on violation at $bound"
        set target_cell [get_cells -filter "ref_name =~ HDB??T*"  -intersect $bound]
        set target_cell_geo [create_geo_mask -objects [get_cells $target_cell ] ]
        set target_cell [get_attribute [get_objects_by_location -filter "ref_name =~ HDB??T*" -classes cell -intersect $bound ] ref_name]
        set target_cell_full_name [get_attribute [get_objects_by_location -filter "ref_name =~ HDB??T*" -classes cell -intersect $bound ] full_name]
        set left_cell_box [resize_polygons -size {0.02 0 0 0} -objects $target_cell_geo]
        set left_cell_box [ compute_polygon -objects1 $left_cell_box -objects2 $target_cell_geo -operation NOT ]
        set left_cell_box [ resize_polygons -size -0.005 -objects $left_cell_box ]
        set left_cell [get_cells -intersect $left_cell_box]
        if {[sizeof_collection $left_cell]==1} {
            set ref_cell [get_attribute $left_cell ref_name]
        } elseif {[sizeof_collection $left_cell]>1} {
            puts "more than one cell on left size, need to reduce project: ${options(-project)} "
            set names [get_object_name $left_cell]
            continue
        } else {
            puts "no left-side cell found; skip this one"
            continue
        }
        set left_cell_name [get_object_name $left_cell]
regexp {HDB([A-Z]+)[0-9]+.*} $ref_cell ref ref1 
set fixed_cell [string replace $target_cell 3 5 $ref1]
size_cell [get_cells $target_cell_full_name] $fixed_cell
}
}
define_proc_attributes fix_drc_H240 \
   -hide_body \
   -info "Fix Cablire Base DRC due to cell VT" \
   -define_args \
   {
      {-rule         "Violation rule name" "GRBP.S.1" string required}
      {-cal_db       "Calibre database, must set for the first time" "drc.db" string optional}
      {-output       "output ECO file" "fix_base_drc.tcl" string optional}
      {-size_cell   "size the right cell same vt of left cell instead of swap" "" boolean optional}
      {-help         "show this messege" "" boolean optional}
   }


# proc get_cal_drc
proc get_cal_drc {rule database} {
    if { ![string equal $database ""] } {
        if { [sizeof_collection [get_drc_error_data -quiet CalDB.err]] >= 1 } {
            remove_drc_error_data -force CalDB.err
        }
        read_drc_error_file -file $database -error_data CalDB
    } elseif { [sizeof_collection [get_drc_error_data -quiet CalDB.err]] < 1 } {
        error [puts "Error: No calibre database!"]
    }
    set error_rule [get_drc_error_types -quiet -error_data CalDB.err $rule]
    if { [sizeof_collection $error_rule] < 1 } {
        error [puts "Error: No rule match!"]
    }
    return [get_drc_errors -quiet -error_data CalDB.err -of $error_rule]
    }

TAG: H240 tcl Tcl TCL

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2017-12-13  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 239
  • 日志数: 3
  • 建立时间: 2017-09-11
  • 更新时间: 2017-12-13

RSS订阅

Open Toolbar