在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2608|回复: 4

[求助] IC61版本SKILL图形界面加入菜单栏并关联tf应该如何实现?

[复制链接]
发表于 2020-9-10 16:55:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
RT
刚开始学习SKILL,借鉴一个脚本想实现去掉交叉金属线多余部分并自动打孔(该脚本为IC51版本,想通过修改相关函数来达到目的)
目前卡在了两个地方
1:在图形界面实现菜单,查阅Cadence Help发现可以在hicreateAPPForm/hiCreateStringField后接入hiContextMenu实现,但是没有接触过脚本语言,对语法嵌套比较陌生,不知道怎么写
2:脚本中的 Via 关联到tf文件;通过填入过孔名称的方式来打孔,CIW报错提示:*Error* dbCreateVia: argument #2 should be a database object (type template = "ddltg") at line 222 of file "~/test.il" - "M1_M2"

请问各位前辈,应该如何解决

备注:相对于51,61的函数有些变化,取消了leCreateContact,我查询Cadence help后用dbCreateVia代替
Cadence版本:6.1.6
参考贴1:http://bbs.eetop.cn/thread-765518-2-1.html
参考资料:Cadence help
 楼主| 发表于 2020-9-10 16:58:01 | 显示全部楼层
改动后脚本如下:
hiSetBindKey("Layout" "Ctrl<Key>C" "xiubian()")

procedure(xiubian2()
        object_List=geGetSelSet()
        objectA=car(object_List)
        pointsA=objectA~>points
        widthA=objectA~>width
        objectB=cadr(object_List)
                pointsB=objectB~>points
        widthB=objectB~>width
        
        if(car(car(pointsA))==car(cadr(pointsA)) then
                pointsShu=pointsA
                widthShu=widthA
                object_Shu=objectA
                pointsHeng=pointsB
                widthHeng=widthB
                object_Heng=objectB        
                shoubian()
        else
                pointsShu=pointsB
                widthShu=widthB
                object_Shu=objectB
                pointsHeng=pointsA
                widthHeng=widthA
                object_Heng=objectA
                shoubian()
        )
)

procedure(shoubian()
        y1Shu=cadr(car(pointsShu))
        y2Shu=cadr(cadr(pointsShu))
        yMaxShu=max(y1Shu y2Shu)
        yMinShu=min(y1Shu y2Shu)
        x1Heng=car(car(pointsHeng))
        x2Heng=car(cadr(pointsHeng))
        xMaxHeng=max(x1Heng x2Heng)
        xMinHeng=min(x1Heng x2Heng)
        xShu=car(car(pointsShu))
        yHeng=cadr(car(pointsHeng))
        
        when((xMaxHeng-xShu)<(xShu-xMinHeng)&&x1Heng<x2Heng
                xHeng_new=xShu+widthShu/2
                object_Heng~>points=list(car(pointsHeng) rplaca(cadr(pointsHeng) xHeng_new))
        )
        when((xMaxHeng-xShu)<(xShu-xMinHeng)&&x1Heng>x2Heng
                xHeng_new=xShu+widthShu/2
                object_Heng~>points=list(rplaca(car(pointsHeng) xHeng_new) cadr(pointsHeng))
        )        

        when((xMaxHeng-xShu)>(xShu-xMinHeng)&&x1Heng<x2Heng
                xHeng_new=xShu-widthShu/2
                object_Heng~>points=list(rplaca(car(pointsHeng) xHeng_new) cadr(pointsHeng))
        )
        when((xMaxHeng-xShu)>(xShu-xMinHeng)&&x1Heng>x2Heng
                xHeng_new=xShu-widthShu/2
                object_Heng~>points=list(car(pointsHeng) rplaca(cadr(pointsHeng) xHeng_new))
        )        


        when((yMaxShu-yHeng)>(yHeng-yMinShu)&&y1Shu<y2Shu
                yShu_new=yHeng-widthHeng/2
                remove_cell=cadr(car(pointsShu))
                object_Shu~>points=list(remove(remove_cell append1(car(pointsShu) yShu_new)) cadr(pointsShu))
        )
        when((yMaxShu-yHeng)>(yHeng-yMinShu)&&y1Shu>y2Shu
                yShu_new=yHeng-widthHeng/2
                remove_cell=cadr(cadr(pointsShu))
                object_Shu~>points=list(car(pointsShu) remove(remove_cell append1(cadr(pointsShu) yShu_new)))
        )
        
        when((yMaxShu-yHeng)<(yHeng-yMinShu)&&y1Shu<y2Shu
                yShu_new=yHeng+widthHeng/2
                remove_cell=cadr(cadr(pointsShu))
                object_Shu~>points=list(car(pointsShu) remove(remove_cell append1(cadr(pointsShu) yShu_new)))
        )
        when((yMaxShu-yHeng)<(yHeng-yMinShu)&&y1Shu>y2Shu
                yShu_new=yHeng+widthHeng/2
                remove_cell=cadr(car(pointsShu))
                object_Shu~>points=list(remove(remove_cell append1(car(pointsShu) yShu_new)) cadr(pointsShu))
        )                        


hiDisplayForm(CreatContactGUIForm)

)     

M1M2ContactTypeGUI=hiCreateStringField(

?name   'M1M2ContactTypeGUI
?prompt "M1_M2 Contact Type"
?defValue "M1_M2" ;contact cype must be same as PDK name
?callback  "hiGetCurrentForm()"
?editable  t

)

M2MTTContactTypeGUI=hiCreateStringField(

?name   'M2MTTContactTypeGUI
?prompt "M2_MTT Contact Type"
?defValue "M2_MTT" ;contact type must be same as PDK name
?callback  "hiGetCurrentForm()"
?editable  t

)

WidthViaGUI=hiCreateFloatField(

?name 'WidthViaGUI
?prompt "Width of Via"
?defValue 0.1 ;default
?callback "hiGetCurrentForm()"
?editable t

)

LengthViaGUI=hiCreateFloatField(

?name 'LengthViaGUI
?prompt "Length of Via"
?defValue 0.1 ;default
?callback "hiGetCurrentForm()"
?editable t

)

XViaSpaceGUI=hiCreateFloatField(

?name  'XViaSpaceGUI
?prompt "X Via Space"
?defValue 0.13 ;default
?callback "hiGetCurrentForm()"
?editable t

)

YViaSpaceGUI=hiCreateFloatField(

?name  'YViaSpaceGUI
?prompt "Y Via Space"
?defValue 0.13 ;default
?callback "hiGetCurrentForm()"
?editable t

)

ViaEnclosureGUI=hiCreateFloatField(  

?name 'ViaEnclosureGUI
?prompt "Via Enclosure"
?defValue 0.03 ;default
?callback "hiGetCurrentForm()"
?editable t

)

CreatContactGUIForm=hiCreateAppForm(

?name 'CreatContactGUIForm
?formTitle "Creat Contact"
?callback "CreatContact(
                       M1M2ContactTypeGUI->value
                       M2MTTContactTypeGUI->value
                       WidthViaGUI->value
                       LengthViaGUI->value
                       XViaSpaceGUI->value
                       YViaSpaceGUI->value
                       ViaEnclosureGUI->value  
                       )"

?fields list(
            M1M2ContactTypeGUI
            M2MTTContactTypeGUI
            WidthViaGUI
            LengthViaGUI
            XViaSpaceGUI  
            YViaSpaceGUI
            ViaEnclosureGUI
            )
?help ""
)

               

procedure(CreatContact(
                                M1M2ContactType
                                M2MTTContactType
                                WidthVia
                                LengthVia
                                XViaSpace
                                YViaSpace
                                ViaEnclosureGUI
                                )
x=xShu
y=yHeng
XDelta=LengthVia+XViaSpace
YDelta=WidthVia+YViaSpace
XData=(widthShu-ViaEnclosureGUI*2+XViaSpace)/XDelta
YData=(widthHeng-ViaEnclosureGUI*2+YViaSpace)/YDelta
rows=max(floor(YData) 1)
columns=max(floor(XData) 1)

if((objectA~>purpose=="drawing"&&objectB~>purpose=="drawing")!=t
then
JWMessage("Error!!!" 'Close "Incorrect Layer,Create Contact Failed!")
)
/*
if((widthA>=0.16&&widthB>=0.16)!=t
then
JWMessage("Warning!!!" 'Close "The metal width is too small")
)
*/

if(objectA~>layerName=="A1"&&objectB~>layerName=="A2"
then
dbCreateVia(geGetEditRep() M1M2ContactType list(x y) "R0" list(list(rows XData) list(columns YData)) )
)
if(objectA~>layerName=="A2"&&objectB~>layerName=="A1"
then
dbCreateVia(geGetEditRep() M1M2ContactType list(x y) "R0" list(list(rows XData) list(columns YData)) )
)

if(objectA~>layerName=="MTT"&&objectB~>layerName=="A2"
then
dbCreateVia(geGetEditRep() M2MTTContactTypeGUI list(x y) "R0" list(list(rows XData) list(columns YData)) )
)

if(objectA~>layerName=="A2"&&objectB~>layerName=="MTT"
then
dbCreateVia(geGetEditRep() M2MTTContactTypeGUI list(x y) "R0" list(list(rows XData) list(columns YData)) )
)
)
 楼主| 发表于 2020-9-10 16:59:05 | 显示全部楼层
修改后脚本如下:


hiSetBindKey("Layout" "Ctrl<Key>C" "xiubian()")

procedure(xiubian2()
        object_List=geGetSelSet()
        objectA=car(object_List)
        pointsA=objectA~>points
        widthA=objectA~>width
        objectB=cadr(object_List)
                pointsB=objectB~>points
        widthB=objectB~>width

        if(car(car(pointsA))==car(cadr(pointsA)) then
                pointsShu=pointsA
                widthShu=widthA
                object_Shu=objectA
                pointsHeng=pointsB
                widthHeng=widthB
                object_Heng=objectB        
                shoubian()
        else
                pointsShu=pointsB
                widthShu=widthB
                object_Shu=objectB
                pointsHeng=pointsA
                widthHeng=widthA
                object_Heng=objectA
                shoubian()
        )
)

procedure(shoubian()
        y1Shu=cadr(car(pointsShu))
        y2Shu=cadr(cadr(pointsShu))
        yMaxShu=max(y1Shu y2Shu)
        yMinShu=min(y1Shu y2Shu)
        x1Heng=car(car(pointsHeng))
        x2Heng=car(cadr(pointsHeng))
        xMaxHeng=max(x1Heng x2Heng)
        xMinHeng=min(x1Heng x2Heng)
        xShu=car(car(pointsShu))
        yHeng=cadr(car(pointsHeng))

        when((xMaxHeng-xShu)<(xShu-xMinHeng)&&x1Heng<x2Heng
                xHeng_new=xShu+widthShu/2
                object_Heng~>points=list(car(pointsHeng) rplaca(cadr(pointsHeng) xHeng_new))
        )
        when((xMaxHeng-xShu)<(xShu-xMinHeng)&&x1Heng>x2Heng
                xHeng_new=xShu+widthShu/2
                object_Heng~>points=list(rplaca(car(pointsHeng) xHeng_new) cadr(pointsHeng))
        )        

        when((xMaxHeng-xShu)>(xShu-xMinHeng)&&x1Heng<x2Heng
                xHeng_new=xShu-widthShu/2
                object_Heng~>points=list(rplaca(car(pointsHeng) xHeng_new) cadr(pointsHeng))
        )
        when((xMaxHeng-xShu)>(xShu-xMinHeng)&&x1Heng>x2Heng
                xHeng_new=xShu-widthShu/2
                object_Heng~>points=list(car(pointsHeng) rplaca(cadr(pointsHeng) xHeng_new))
        )        


        when((yMaxShu-yHeng)>(yHeng-yMinShu)&&y1Shu<y2Shu
                yShu_new=yHeng-widthHeng/2
                remove_cell=cadr(car(pointsShu))
                object_Shu~>points=list(remove(remove_cell append1(car(pointsShu) yShu_new)) cadr(pointsShu))
        )
        when((yMaxShu-yHeng)>(yHeng-yMinShu)&&y1Shu>y2Shu
                yShu_new=yHeng-widthHeng/2
                remove_cell=cadr(cadr(pointsShu))
                object_Shu~>points=list(car(pointsShu) remove(remove_cell append1(cadr(pointsShu) yShu_new)))
        )

        when((yMaxShu-yHeng)<(yHeng-yMinShu)&&y1Shu<y2Shu
                yShu_new=yHeng+widthHeng/2
                remove_cell=cadr(cadr(pointsShu))
                object_Shu~>points=list(car(pointsShu) remove(remove_cell append1(cadr(pointsShu) yShu_new)))
        )
        when((yMaxShu-yHeng)<(yHeng-yMinShu)&&y1Shu>y2Shu
                yShu_new=yHeng+widthHeng/2
                remove_cell=cadr(car(pointsShu))
                object_Shu~>points=list(remove(remove_cell append1(car(pointsShu) yShu_new)) cadr(pointsShu))
        )                        


hiDisplayForm(CreatContactGUIForm)

)     

M1M2ContactTypeGUI=hiCreateStringField(

?name   'M1M2ContactTypeGUI
?prompt "M1_M2 Contact Type"
?defValue "M1_M2" ;contact cype must be same as PDK name
?callback  "hiGetCurrentForm()"
?editable  t

)

M2MTTContactTypeGUI=hiCreateStringField(

?name   'M2MTTContactTypeGUI
?prompt "M2_MTT Contact Type"
?defValue "M2_MTT" ;contact type must be same as PDK name
?callback  "hiGetCurrentForm()"
?editable  t

)

WidthViaGUI=hiCreateFloatField(

?name 'WidthViaGUI
?prompt "Width of Via"
?defValue 0.1 ;default
?callback "hiGetCurrentForm()"
?editable t

)

LengthViaGUI=hiCreateFloatField(

?name 'LengthViaGUI
?prompt "Length of Via"
?defValue 0.1 ;default
?callback "hiGetCurrentForm()"
?editable t

)

XViaSpaceGUI=hiCreateFloatField(

?name  'XViaSpaceGUI
?prompt "X Via Space"
?defValue 0.13 ;default
?callback "hiGetCurrentForm()"
?editable t

)

YViaSpaceGUI=hiCreateFloatField(

?name  'YViaSpaceGUI
?prompt "Y Via Space"
?defValue 0.13 ;default
?callback "hiGetCurrentForm()"
?editable t

)

ViaEnclosureGUI=hiCreateFloatField(  

?name 'ViaEnclosureGUI
?prompt "Via Enclosure"
?defValue 0.03 ;default
?callback "hiGetCurrentForm()"
?editable t

)

CreatContactGUIForm=hiCreateAppForm(

?name 'CreatContactGUIForm
?formTitle "Creat Contact"
?callback "CreatContact(
                       M1M2ContactTypeGUI->value
                       M2MTTContactTypeGUI->value
                       WidthViaGUI->value
                       LengthViaGUI->value
                       XViaSpaceGUI->value
                       YViaSpaceGUI->value
                       ViaEnclosureGUI->value  
                       )"

?fields list(
            M1M2ContactTypeGUI
            M2MTTContactTypeGUI
            WidthViaGUI
            LengthViaGUI
            XViaSpaceGUI  
            YViaSpaceGUI
            ViaEnclosureGUI
            )
?help ""
)

               

procedure(CreatContact(
                                M1M2ContactType
                                M2MTTContactType
                                WidthVia
                                LengthVia
                                XViaSpace
                                YViaSpace
                                ViaEnclosureGUI
                                )
x=xShu
y=yHeng
XDelta=LengthVia+XViaSpace
YDelta=WidthVia+YViaSpace
XData=(widthShu-ViaEnclosureGUI*2+XViaSpace)/XDelta
YData=(widthHeng-ViaEnclosureGUI*2+YViaSpace)/YDelta
rows=max(floor(YData) 1)
columns=max(floor(XData) 1)

if((objectA~>purpose=="drawing"&&objectB~>purpose=="drawing")!=t
then
JWMessage("Error!!!" 'Close "Incorrect Layer,Create Contact Failed!")
)
/*
if((widthA>=0.16&&widthB>=0.16)!=t
then
JWMessage("Warning!!!" 'Close "The metal width is too small")
)
*/

if(objectA~>layerName=="A1"&&objectB~>layerName=="A2"
then
dbCreateVia(geGetEditRep() M1M2ContactType list(x y) "R0" list(list(rows XData) list(columns YData)) )
)
if(objectA~>layerName=="A2"&&objectB~>layerName=="A1"
then
dbCreateVia(geGetEditRep() M1M2ContactType list(x y) "R0" list(list(rows XData) list(columns YData)) )
)

if(objectA~>layerName=="MTT"&&objectB~>layerName=="A2"
then
dbCreateVia(geGetEditRep() M2MTTContactTypeGUI list(x y) "R0" list(list(rows XData) list(columns YData)) )
)

if(objectA~>layerName=="A2"&&objectB~>layerName=="MTT"
then
dbCreateVia(geGetEditRep() M2MTTContactTypeGUI list(x y) "R0" list(list(rows XData) list(columns YData)) )
)
)

发表于 2020-9-17 14:54:02 | 显示全部楼层
为什么不用局部变量
发表于 2020-9-25 21:55:20 | 显示全部楼层
记得用let
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-4-27 01:38 , Processed in 0.020373 second(s), 6 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表