snakkewang的个人空间 https://blog.eetop.cn/174222 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

Tiny script to fast your ICC manual custom routing work

已有 1272 次阅读| 2015-4-4 21:40

Auto adjust net shape as below
##------------------------------------------------
## Create   :Yanlong Wang
## Mail    :snakekwang@gmail.com
## Blog    :http://www.eetop.cn/blog/174222/spacelist-blog.html
## Tool    :IC compiler
##------------------------------------------------
##Description  : Adjust net shape 
##------------------------------------------------
set debug 0                                                                                                                                                                                                      
foreach_in_collection e [get_selection] {
    set points [get_attribute $e points]
    set x0  [lindex [lindex $points 0] 0 ]
    set y0  [lindex [lindex $points 0] 1 ]
    set x1  [lindex [lindex $points 1] 0 ]
    set y1  [lindex [lindex $points 1] 1 ]
    set wire [get_object_name $e]
    set width [get_attribute $e width]
    set endcap [get_attribute $e endcap]
    if { $y0 == $y1 } {
        set h_w_x0 $x0
        set h_w_y0 $y0
        set h_w_x1 $x1
        set h_w_y1 $y1
        set h_w    $wire
        set h_width $width
        set h_endcap $endcap
        set o_h_w_x0 $x0
        set o_h_w_y0 $y0
        set o_h_w_x1 $x1
        set o_h_w_y1 $y1
        set o_h_w    $wire
puts "$h_w $h_w_x0 $h_w_y0 $h_w_x1 $h_w_y1"
    }
    if { $x0 == $x1 } {
        set v_w_x0 $x0
        set v_w_y0 $y0
        set v_w_x1 $x1
        set v_w_y1 $y1
        set v_w    $wire
        set v_width $width
        set v_endcap $endcap
        set o_v_w_x0 $x0
        set o_v_w_y0 $y0
        set o_v_w_x1 $x1
        set o_v_w_y1 $y1
        set o_v_w    $wire
puts "$v_w $v_w_x0 $v_w_y0 $v_w_x1 $v_w_y1"
    }
}

if { [expr $h_w_x1 - $v_w_x0] < [expr $v_w_x0 - $h_w_x0] } {
     if { $h_endcap == "square_ends" } {
         set h_w_x1 [expr $v_w_x0 + $v_width/2 ]
     } else {
         set h_w_x1 [expr $v_w_x0 + $v_width/2 - $h_width/2 ]
     }
} else {
     if { $h_endcap == "square_ends" } {
         set h_w_x0 [expr $v_w_x0 - $v_width/2 ]
     } else {
         set h_w_x0 [expr $v_w_x0 - $v_width/2 + $h_width/2 ]
     }
}
if { [expr $v_w_y1 - $h_w_y0] < [expr $h_w_y0 -  $v_w_y0] } {
     if { $v_endcap == "square_ends" } {
         set v_w_y1 [expr $h_w_y0 + $h_width/2]
     } else {
         set v_w_y1 [expr $h_w_y0 + $h_width/2 - $v_width/2]
     }
} else {
     if { $v_endcap == "square_ends" } {
         set v_w_y0 [expr $h_w_y0 - $h_width/2]
     } else {
         set v_w_y0 [expr $h_w_y0 - $h_width/2 + $v_width/2]
     }
}
    puts "new :set_attribute $h_w points [list [list $h_w_x0 $h_w_y0] [list $h_w_x1 $h_w_y1] ]"
    puts "new :set_attribute $v_w points [list [list $v_w_x0 $v_w_y0] [list $v_w_x1 $v_w_y1] ]"
if { $debug != 1 } {
    set_attribute [get_net_shape $h_w ] points [list [list $h_w_x0 $h_w_y0] [list $h_w_x1 $h_w_y1] ]
    set_attribute [get_net_shape $v_w ] points [list [list $v_w_x0 $v_w_y0] [list $v_w_x1 $v_w_y1] ]
}

puts "old:set_attribute $o_h_w points [list [list $o_h_w_x0 $o_h_w_y0] [list $o_h_w_x1 $o_h_w_y1] ]"
puts "old:set_attribute $o_v_w points [list [list $o_v_w_x0 $o_v_w_y0] [list $o_v_w_x1 $o_v_w_y1] ]"
if { $debug != 1 } {
    #set_attribute [get_net_shape $o_h_w ] points [list [list $o_h_w_x0 $o_h_w_y0] [list $o_h_w_x1 $o_h_w_y1] ]
    #set_attribute [get_net_shape $o_v_w ] points [list [list $o_v_w_x0 $o_v_w_y0] [list $o_v_w_x1 $o_v_w_y1] ]
}             

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 0

    获赞
  • 0

    评论
  • 1763

    访问数
关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-20 13:10 , Processed in 0.028283 second(s), 14 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部