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

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

日志

Tiny script to fast your ICC manual custom routing work ... continue

已有 1322 次阅读| 2015-4-4 21:44

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 T
##------------------------------------------------
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]
    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"
    }
}
## cross point is $v_w_x0 $h_w_y0 
set cross_x $v_w_x0
set cross_y $h_w_y0

set h_left2cross   [expr $cross_x - $h_w_x0]
set h_cross2right  [expr $h_w_x1  - $cross_x]
set v_up2cross     [expr $v_w_y1  - $cross_y]
set v_cross2down   [expr $cross_y - $v_w_y0]
puts  "h_left2cross  =$h_left2cross"
puts  "h_cross2right =$h_cross2right"
puts  "v_up2cross    = $v_up2cross "
puts  "v_cross2down  = $v_cross2down"

if { ($h_left2cross < $h_cross2right )  && ($h_left2cross < $v_up2cross ) &&  ($h_left2cross < $v_cross2down ) } {
     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 ]
     }
} elseif { ($h_cross2right < $h_left2cross )  && ($h_cross2right < $v_up2cross ) &&  ($h_cross2right < $v_cross2down ) } {
     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 ]     }
} elseif { ($v_up2cross < $h_left2cross )  && ($v_up2cross < $h_cross2right ) &&  ($v_up2cross < $v_cross2down ) } {     
    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]     
     }
} elseif { ($v_cross2down < $h_left2cross )  && ($v_cross2down < $h_cross2right ) &&  ($v_cross2down < $v_up2cross ) } {     
    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] ]"


点赞

评论 (0 个评论)

facelist

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

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

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 0

    获赞
  • 0

    评论
  • 1765

    访问数
关闭

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

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

GMT+8, 2024-4-28 19:34 , Processed in 0.023164 second(s), 13 queries , Gzip On, Redis On.

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