马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 希凌阿狸 于 2019-4-1 09:07 编辑
用脚本文件已经实现PAD坐标的自动获取,设置按F9选择对应PAD层就可以了,成功了几次,但是很不稳定。后面再导就老是失败。版图layout目录下还自动生成了一个相同的layout_padloc,icfb提示报错为*error*fprintf:argument#1 should be an I/O port(type template=“ptg”) - nil
同时每次打开library,文件目录下都会自动生成liManager.log.cdslck文件。
求助,有没有遇到类似问题的?是怎么回事?应该怎么处理呢?
脚本如下:
hiSetBindKey("layout" "F9" "createPadForm()")
procedure(genTmpRuleFile(padLayer padPurpose padSize) let((outPort flag flag1) outPort = outfile("/tmp/divaTmp.drc") if(numberp(padSize) == t && padSize > 0.0 then flag = float(padSize/2)-0.001 else flag = 0.001 ) fprintf(outPort "drcExtractRules(\n") ;fprintf(outPort " ivIf(\n") ;fprintf(outPort " switch(\"number\")\n" ) ;fprintf(outPort " then \n") fprintf(outPort " tempLayer0 = geomSize(geomSize(\"%s\" -%f) %f)\n" padLayer flag flag) fprintf(outPort " tempLayer1 = geomHoles(\"%s\")\n" padLayer) fprintf(outPort " tempLayer2 = geomButtOnly(\"%s\" tempLayer1)\n" padLayer) fprintf(outPort " tempLayer = geomAndNot(tempLayer0 tempLayer2)\n") fprintf(outPort " saveDerived( geomOr(tempLayer) (\"%s\" \"%s\") )\n" padLayer padPurpose) ;fprintf(outPort " else\n") ;fprintf(outPort " saveDerived( geomOr(\"%s\") (\"%s\" \"%s\") )\n" padLayer padLayer padPurpose) ;fprintf(outPort " )\n") fprintf(outPort ")\n") close(outPort) ) ) procedure(runDivaDRC(cvId) prog((RuleFile) RuleFile = "/tmp/divaTmp.drc" ivDRC( ?cell cvId ;?echo t ?inc 100000 ?rulesFromUnix t ?rulesFilePath RuleFile ) );end prog );end procedure procedure(genSortCmd(flagx flagy rotation) let((outPort) outPort = outfile("/tmp/genSortFile.il") fprintf(outPort "procedure(trLineSort(pt1 pt2)\n") fprintf(outPort " let((pt1x pt2x pt1y pt2y d1x d1y d1s d2x d2y d2s)\n") fprintf(outPort " pt1x = car(centerBox(pt1))\n") fprintf(outPort " pt1y = cadr(centerBox(pt1))\n") fprintf(outPort " pt2x = car(centerBox(pt2))\n") fprintf(outPort " pt2y = cadr(centerBox(pt2))\n") fprintf(outPort " d1y = pt1y - %f\n" float(flagy)) fprintf(outPort " d1x = pt1x - %f\n" float(flagx)) fprintf(outPort " d1s = sqrt(d1x**2 + d1y**2)\n") fprintf(outPort " d2y = pt2y - %f\n" float(flagy)) fprintf(outPort " d2x = pt2x - %f\n" float(flagx)) fprintf(outPort " d2s = sqrt(d2x**2 + d2y**2)\n") fprintf(outPort " cond(\n") if(rotation == "Clockwise" then fprintf(outPort " (d1y/d1x > d2y/d2x t)\n") fprintf(outPort " (d1y/d1x == d2y/d2x d1s > d2s)\n") else fprintf(outPort " (d1y/d1x < d2y/d2x t)\n") fprintf(outPort " (d1y/d1x == d2y/d2x d1s < d2s)\n") ) fprintf(outPort " (t nil)\n") fprintf(outPort " )\n") fprintf(outPort " ) ;let\n") fprintf(outPort " ) ;proce\n") close(outPort) ) ;let ) ;proce procedure(extractPadLoc(filePath rotation padSize) let((libName cellName newCellView layerName layerPurpose padList no1 no2 no3 lenList flagx flagy padListSort padLayerList flag outPort i pad name x y xL yL xU yU tx ty label unixCmd) outPort = outfile(filePath) leYankFigs( geGetEditCellView() list(xCoord(car(geGetEditCellView()~>bBox)):yCoord(car(geGetEditCellView()~>bBox)) xCoord(cadr(geGetEditCellView()~>bBox)):yCoord(car(geGetEditCellView()~>bBox)) xCoord(cadr(geGetEditCellView()~>bBox)):yCoord(cadr(geGetEditCellView()~>bBox)) xCoord(car(geGetEditCellView()~>bBox)):yCoord(cadr(geGetEditCellView()~>bBox))) 32 0:0) libName = geGetEditCellView()~>libName cellName = geGetEditCellView()~>cellName newCellView = dbOpenCellViewByType(libName cellName "layout_padloc" "maskLayout" "w") lePasteFigs(newCellView 0:0) dbSave(newCellView libName cellName "layout_padloc") layerName = hiGetLayerCyclicValue(leiGetLSWCurrentTech() padForm)~>name layerPurpose = hiGetLayerCyclicValue(leiGetLSWCurrentTech() padForm)~>purpose genTmpRuleFile(layerName layerPurpose padSize) ;drcCreateLogFile(newCellView ?name "/tmp/diva.log") runDivaDRC(newCellView) ;if( numberp(padSize) && padSize > 0.0 then ;unixCmd = sprintf(nil "ivVerify drc %s %s -lib %s -set \"number\" -ru \"/tmp/divaTmp.drc\" > /dev/null 2>&1" cellName newCellView~>viewName libName) ;else ;unixCmd = sprintf(nil "ivVerify drc %s %s -lib %s -ru \"/tmp/divaTmp.drc\" > /dev/null 2>&1" cellName newCellView~>viewName libName) ;) ;dbClose(newCellView) ;if(isFile("/tmp/divdrc.log") then ;deleteFile("/tmp/divdrc.log") ;) ;sh(unixCmd) ;newCellView = dbOpenCellViewByType(libName cellName "layout_padloc" "maskLayout" "a") leMergeShapes(newCellView~>shapes) padLayerList = list() foreach(no3 newCellView~>shapes if((car(no3~>lpp) == layerName && cadr(no3~>lpp) == layerPurpose && no3~>objType != "label") then padLayerList = append1(padLayerList no3) ) ) ;padLayerList = leSearchHierarchy( ; newCellView ; newCellView~>bBox ; 0 ; "rectangle" ; list(list("layer" "==" list(layerName layerPurpose))) ; ) padList = list() padNoList = list() foreach(flag padLayerList padList = append1(padList flag~>bBox) padNoList = append1(padNoList centerBox(flag~>bBox)) ) ;lenList = length(padList) no1 = caar(padNoList) no2 = car(cdr(car(padNoList))) foreach(flag padNoList no1 = min(no1 car(flag)) no2 = max(no2 cadr(flag)) ) flagx = no1 + 0.001 flagy = no2 ;no1 = random(lenList-1) ;no2 = random(lenList-1) ;no3 = random(lenList-1) ;flagx = (car(centerBox(nth(no1 padList))) + car(centerBox(nth(no2 padList))) + car(centerBox(nth(no3 padList))))/3 ;flagy = (cadr(centerBox(nth(no1 padList))) + cadr(centerBox(nth(no2 padList))) + cadr(centerBox(nth(no3 padList))))/3 genSortCmd(flagx flagy rotation) load("/tmp/genSortFile.il") padListSort = sort(padList 'trLineSort) print(padListSort) i = 1 ;fprintf(outPort "====================== CopyRight By Andy An ======================\n") ;fprintf(outPort "= Please indicate the source when you transshipment it! =\n") ;fprintf(outPort "==================================================================\n") ;fprintf(outPort "Number X axis Y axis Text\n") ;fprintf(outPort "--------------------------------------------------------------\n") fprintf(outPort "************************************************\n") fprintf(outPort "* PAD LOCATION *\n") fprintf(outPort "* *\n") fprintf(outPort "* Project Name:%s *\n" geGetEditRep()~>cellName) fprintf(outPort "* PAD Package Type :_____ *\n") fprintf(outPort "* Passivation Size : __*__ (Unit:um) *\n") fprintf(outPort "* Probe PAD Size : __*__ (Unit:um) *\n") fprintf(outPort "* Chip Windows Size :____*____ (Unit:um) *\n") fprintf(outPort "* *\n") fprintf(outPort "* PAD #\t\tNAME\tLocation *\n") fprintf(outPort "************************************************\n") foreach( pad padListSort xL=car(car(pad)) yL=car(cdr(car(pad))) xU=car(car(cdr(pad))) yU=car(cdr(car(cdr(pad)))) x=car(centerBox(pad)) y=cadr(centerBox(pad)) foreach(name newCellView~>shapes if(name~>objType == "label" then ;&& name~>layerName == textLayer then tx = car(name~>xy) ty = car(cdr(name~>xy)) if(xL<tx && yL<ty && xU>tx && yU>ty then label=name~>theLabel fprintf(outPort "%d.\t\t%s\t(%0.3f,%0.3f)\n" i label x y) i = i + 1 ;else ; label="No Text" ; fprintf(outPort "%d %s \t\t(%0.2f,%0.2f)\n" i label x y) ; i = i + 1 );if );if );for );end foreach close(outPort) view(filePath) deleteFile("/tmp/genSortFile.il") deleteFile("/tmp/divaTmp.drc") ;if(isFile("/tmp/divdrc.log") then ;deleteFile("/tmp/divdrc.log") ;) ddDeleteDeep(ddGetObj(libName cellName "layout_padloc" "")) ) ) file:///C:/Users/eng613/AppData/Local/Temp/ksohtml/wpsE3E8.tmp.png procedure(createPadForm() padLayerInfo = hiCreateLayerCyclicField( leiGetLSWCurrentTech() "Pad Layer" "" leGetValidLayerList(leiGetLSWCurrentTech()) ) ;textLayerInfo = hiCreateLayerCyclicField( ; leiGetLSWCurrentTech() ; "Text Layer" ; "" ; cons(list("PAD" "drawing") leGetValidLayerList(leiGetLSWCurrentTech())) ;) rotation = hiCreateCyclicField( ?name 'rotation ?choices list("Clockwise" "AntiClockwise") ?prompt "Sort Direction" ) sepField1 = hiCreateFrameField( ?name 'sepField1 ) padSize = hiCreateFloatField( ?name 'padSize ?prompt "Pad Dimension" ) filePath = hiCreateStringField( ?name 'filePath ?prompt "File Name" ?defValue "pad_location.txt" ) filePathBrowser = hiCreateButton( ?name 'codeFileBrowserB ?buttonText "Browse..." ?callback "_pipoFileBrowse( hiGetCurrentForm() 'filePath)" ) hiCreateAppForm( ?name 'padForm ?formTitle "Pad Location Generator" ?fields list( list(sepField1 5:100 600:1 600) list(padLayerInfo 5:0 280:40 70) list(rotation 220:10 120:24 95) list(padSize 440:5 150:24 95) list(filePath 5:45 510:25 70) list(filePathBrowser 520:45 75:30) ) ?callback "extractPadLoc(filePath~>value rotation~>value padSize~>value)" ) status = hiDisplayForm( padForm ) ) ;end procedure procedure(createAboutForm() hiDisplayAppDBox( ?name 'CopyRight ?dboxBanner "CopyRight By Andy An" ?dboxText "All CopyRights Reserved. Please contact Andy An if have any problem!\nI will add more functions in future! Expect your attention!" ?buttonLayout 'Close ) ) procedure(printInfo() prog((pointList area i perimeter PI objType side1 side2 r1 r2 length) if(length(geGetSelSet()) > 1 || geGetSelSet() == nil then hiDisplayAppDBox( ?name 'infoWarning ?dboxBanner "Information Warning" ?dboxText "You must select one object! And only can select one object!" ?dialogType hicWarningDialog ?buttonLayout 'Close ) else area = 0.0 i = 0 perimeter = 0.0 PI = 3.1416 length = 0.0 objType = car(geGetSelSet()~>objType) case(objType ("polygon" pointList = append1(car(geGetSelSet()~>points) caar(geGetSelSet()~>points)) while(i < length(pointList)-1 area = area + (car(nth(i+1 pointList)) - car(nth(i pointList)))*(cadr(nth(i pointList))+cadr(nth(i+1 pointList)))/2.0 perimeter = perimeter + sqrt((car(nth(i pointList))-car(nth(i+1 pointList)))**2.0 + (cadr(nth(i pointList)) - cadr(nth(i+1 pointList)))**2.0) i = i + 1 ) ;while hiDisplayAppDBox( ?name 'polygonInfo ?dboxBanner "Polygon Information" ?dboxText sprintf(nil "The polygon Area is: %0.3f\nThe polygon Perimeter is: %0.3f" abs(area) perimeter) ?dialogType hicInformationDialog ?buttonLayout 'Close ) ) ;case polygon ("rect" pointList = car(geGetSelSet()~>bBox) side1 = xCoord(cadr(pointList)) - xCoord(car(pointList)) side2 = yCoord(cadr(pointList)) - yCoord(car(pointList)) area = side1 * side2 perimeter = 2 * side1 + 2 * side2 hiDisplayAppDBox( ?name 'rectInfo ?dboxBanner "Rectangle Information" ?dboxText sprintf(nil "The rectangle Area is: %0.3f\nThe rectangle Perimeter is: %0.3f" abs(area) perimeter) ?dialogType hicInformationDialog ?buttonLayout 'Close ) ) ;case rect ("path" pointList = car(geGetSelSet()~>points) while(i < length(pointList)-1 area = area + sqrt((car(nth(i pointList))-car(nth(i+1 pointList)))**2.0 + (cadr(nth(i pointList)) - cadr(nth(i+1 pointList)))**2.0) * car(geGetSelSet()~>width) length = length + sqrt((car(nth(i pointList))-car(nth(i+1 pointList)))**2.0 + (cadr(nth(i pointList)) - cadr(nth(i+1 pointList)))**2.0) i = i + 1 ) perimeter = 2 * length + 2 * car(geGetSelSet()~>width) hiDisplayAppDBox( ?name 'pathInfo ?dboxBanner "Path Information" ?dboxText sprintf(nil "The path Length is: %0.3f\nThe path Area is: %0.3f\nThe path Perimeter is: %0.3f" length abs(area) perimeter) ?dialogType hicInformationDialog ?buttonLayout 'Close ) ) ;case path ("inst" || "label" || "mosaic" hiDisplayAppDBox( ?name 'noInfo ?dboxBanner "No Information" ?dboxText "You have selected one Instance or Label!\nPlease select a shape and get the information!" ?dialogType hicInformationDialog ?buttonLayout 'Close ) ) ;case inst ("donut" area = PI * car(geGetSelSet()~>outerRadius)**2 - PI * car(geGetSelSet()~>innerRadius)**2 perimeter = 2 * PI * (car(geGetSelSet()~>outerRadius) + car(geGetSelSet()~>innerRadius)) hiDisplayAppDBox( ?name 'donutInfo ?dboxBanner "Donut Information" ?dboxText sprintf(nil "The donut Area is: %0.3f\nThe donut Perimeter is: %0.3f" area perimeter) ?dialogType hicInformationDialog ?buttonLayout 'Close ) ) ;case donut ("ellipse" pointList = car(geGetSelSet()~>bBox) r1 = xCoord(cadr(pointList)) - xCoord(car(pointList)) r2 = yCoord(cadr(pointList)) - yCoord(car(pointList)) if( r1 == r2 then area = PI * r1**2 perimeter = 2 * PI * r1 hiDisplayAppDBox( ?name 'circleInfo ?dboxBanner "Circle Information" ?dboxText sprintf(nil "The circle Area is: %0.3f\nThe circle Perimeter is: %0.3f" area perimeter) ?dialogType hicInformationDialog ?buttonLayout 'Close ) else area = PI * r1 * r2 perimeter = 2 * PI * min(r1 r2) + 4 * (max(r1 r2) - min(r1 r2)) hiDisplayAppDBox( ?name 'ellipseInfo ?dboxBanner "Ellipse Information" ?dboxText sprintf(nil "The ellipse Area is: %0.3f\nThe ellipse Perimeter is: %0.3f" area perimeter) ?dialogType hicInformationDialog ?buttonLayout 'Close ) ) ;if ) ;case ellipse ) ; case eof ) ;if ) ;prog ) ;proce
|