| |
;move pin to all metal procedure(MovePinToMetal() prog( () cv=geGetEditRep() objs=geGetSelSet() pin=car(setof(one objs one~>pin~>objType=="pin")) pin_center_point=centerBox(pin~>bBox) pin_orgx=car(centerBox(pin~>bBox)) pin_orgy=nth(1 centerBox(pin~>bBox)) org_metal=car(setof(one objs one~>objType=="path"||one~>objType=="pathSeg")) if(cv~>mode=="r" then MakeEditWaring() return(nil) );if metal_center_point=centerBox(org_metal~>bBox) metal_orgx=car(centerBox(org_metal~>bBox)) metal_orgy=nth(1 centerBox(org_metal~>bBox)) x1=metal_orgx-pin_orgx y1=metal_orgy-pin_orgy new1_pin=dbMoveFig(pin nil list(x1:y1 "R0")) if(pin_orgy=metal_orgy then x2=abs(xCoord(car(org_metal~>bBox))-xCoord(car(new1_pin~>bBox))) new2_pin=leSizeShape(new1_pin list(x2 x2 0 0)) new2_pin~>children~>justify="centerCenter" );end if if(pin_orgx=metal_orgx then y2=abs(yCoord(nth(1 org_metal~>bBox))-yCoord(nth(1 new1_pin~>bBox))) new2_pin=leSizeShape(new1_pin list(0 0 y2 y2)) new2_pin~>children~>justify="centerCenter" new2_pin~>children~>orient="R90" );end if );end prog );end proc
;app form waring or app form MakeEditWaring() cv = geGetEditCellView() str_field=hiCreateOutputStringField(?name 'ReadOnly ?value "Read Only") end_field=hiCreateOutputStringField(?name 'MakeEdit ?value "Please Make Editable") MyLabelForm=hiCreateAppForm( ?name 'MakeEditWaring ?fields list(str_field end_field) ?formTitle "Waring" ?buttonlayout 'Close ) hiDisplayForm(MyLabelForm) AppMessage(title buttontxt buttxt message);自定义弹窗窗口警告⚠️信息 hiDisplayAppDBox( ?name 'AppDBox ?dboxBanner title ?buttonLayout buttontxt ;"’OKCancel (default) ’YesNo ’YesNoCancel ’CloseHelp ’Close ’UserDefined ?buttons buttxt ?dboxText message )
;two groups bus connect by via objs=setof(x objs x~>objType=="pathSeg"||x~>objType=="path"||x~>objType=="rect") objs_ps=() foreach(obj objs ori=geGetSelSetFigPoint(obj) case(obj~>objType ("rect" temp0=car(leConvertShapeToPathSeg(obj)) geSelectFigPoint(temp0 ori)) ("path" temp0=car(leConvertShapeToPathSeg(obj)) geSelectFigPoint(temp0 ori)) ("pathSeg" temp0 = obj) );case objs_ps=append1(objs_ps temp0) );end foreach ----将select转换成pathseg ;create h/v bus list h_bus=() v_bus=() foreach(obj objs_ps begin_point=obj~>beginPt end_point=obj~>endPt if(yCoord(begin_point)==yCoord(end_point) then h_bus=append1(h_bus obj));end if if(xCoord(begin_point)==xCoord(end_point) then v_bus=append1(v_bus obj));end if );end for h_bus=sort(h_bus lambda((x y) greaterp(nth(1 car(x~>bBox)) nth(1 car(y~>bBox))))) v_bus=sort(v_bus lambda((x y) lessp(nth(0 car(x~>bBox)) nth(0 car(y~>bBox))))) ;将选择的net通过sort分类排序 if(xCoord(caar(h_bus~>bBox))<xCoord(caar(v_bus~>bBox))&&yCoord(caar(h_bus~>bBox))>yCoord(caar(v_bus~>bBox)) then h_bus=reverse(h_bus)) if(xCoord(nth(1 car(h_bus~>bBox)))>xCoord(nth(1 car(v_bus~>bBox)))&&yCoord(nth(1 car(reverse(h_bus)~>bBox)))<yCoord(nth(1 car(v_bus~>bBox))) then h_bus=reverse(h_bus)) ;判断排序方向,确保一个模式下,都是一个方式打孔 ;judge connected type if(mode==1 then h_bus=h_bus else h_bus=reverse(h_bus)) ;find interpoint x:y len_h_bus=length(h_bus) len_v_bus=length(v_bus) interpts=() interpt_xs=() interpt_ys=() for(i 0 len_h_bus-1 interpt_y=yCoord(nth(i h_bus)~>endPt) interpt_ys=append1(interpt_ys interpt_y) interpt_x=xCoord(nth(i v_bus)~>endPt) interpt_xs=append1(interpt_xs interpt_x) interpts=append1(interpts interpt_x:interpt_y) );end for ;judge select pathSeg beginPt or endPt ;h_bus viaBoxs=() for(i 0 len_h_bus-1 sel_hobj=nth(i h_bus) w_v=nth(i v_bus)~>width sel_h_part=geGetSelSetFigPoint(sel_hobj) if(!car(sel_h_part)&&nth(1 sel_h_part) then ;select endpt if(xCoord(sel_hobj~>endPt)>xCoord(sel_hobj~>beginPt) then sel_hobj~>endPt=rplaca(sel_hobj~>endPt nth(i interpt_xs)+w_v/2) ; viaBox=list(list(car(nth(1 sel_hobj~>bBox))-w_h nth(1 nth(1 sel_hobj~>bBox))-w_h) nth(1 sel_hobj~>bBox)) else sel_hobj~>endPt=rplaca(sel_hobj~>endPt nth(i interpt_xs)-w_v/2) ; viaBox=list(car(sel_hobj~>bBox) list(caar(sel_hobj~>bBox)+w_h nth(1 car(sel_hobj~>bBox)))) );end if );end if if(car(sel_h_part)&&!nth(1 sel_h_part) then ;select beginpt if(xCoord(sel_hobj~>beginPt)>xCoord(sel_hobj~>endPt) then sel_hobj~>beginPt=rplaca(sel_hobj~>beginPt nth(i interpt_xs)+w_v/2) ; viaBox=list(list(car(nth(1 sel_hobj~>bBox))-w_h nth(1 nth(1 sel_hobj~>bBox))-w_h) nth(1 sel_hobj~>bBox)) else sel_hobj~>beginPt=rplaca(sel_hobj~>beginPt nth(i interpt_xs)-w_v/2) ; viaBox=list(car(sel_hobj~>bBox) list(caar(sel_hobj~>bBox)+w_h nth(1 car(sel_hobj~>bBox)))) );end if );end if ; viaBoxs=append1(viaBoxs viaBox) ) ;判断选择net那一端,以及起始结束点的大小,来判断net往那边延伸 ;judge select pathSeg beginPt or endPt ;h_bus for(i 0 len_h_bus-1 sel_hobj=nth(i h_bus) sel_h_part=geGetSelSetFigPoint(sel_hobj) reverse_hbus=nil if(!car(sel_h_part)&&nth(1 sel_h_part) then ;select endpt if(car(sel_hobj~>beginPt)<caaar(v_bus~>bBox) then sel_hobj~>endPt=rplaca(sel_hobj~>endPt car(nth(1 car(reverse(v_bus~>bBox))))) ) if(car(sel_hobj~>beginPt)>car(nth(1 car(reverse(v_bus~>bBox)))) then sel_hobj~>endPt=rplaca(sel_hobj~>endPt caaar(v_bus~>bBox)) reverse_hbus=t ) );end if if(car(sel_h_part)&&!nth(1 sel_h_part) then ;select beginpt if(car(sel_hobj~>endPt)<caaar(v_bus~>bBox) then sel_hobj~>beginPt=rplaca(sel_hobj~>beginPt car(nth(1 car(reverse(v_bus~>bBox))))) ) if(car(sel_hobj~>endPt)>car(nth(1 car(reverse(v_bus~>bBox)))) then sel_hobj~>beginPt=rplaca(sel_hobj~>beginPt caaar(v_bus~>bBox)) reverse_hbus=t;给出一个变量,方便判断是否需要反向bus list println("5555") ) );end if );end for ;判断选择net那一端,以及起始或结束点与竖直bus之间的关系,来判断net往那边延伸 ;for(i 0 len_h_bus-1 ; sel_hobj=nth(i h_bus) ; w_v=nth(i v_bus)~>width ; if(nth(i interpt_xs)>max(xCoord(sel_hobj~>endPt) xCoord(sel_hobj~>beginPt)) then ;select endpt ; if(xCoord(sel_hobj~>endPt)>xCoord(sel_hobj~>beginPt) then ; sel_hobj~>endPt=rplaca(sel_hobj~>endPt nth(i interpt_xs)+w_v/2) ; else ; sel_hobj~>beginPt=rplaca(sel_hobj~>beginPt nth(i interpt_xs)+w_v/2) ; );end if ; );end if ; if(nth(i interpt_xs)<min(xCoord(sel_hobj~>endPt) xCoord(sel_hobj~>beginPt)) then ;select beginpt ; if(xCoord(sel_hobj~>endPt)<xCoord(sel_hobj~>beginPt) then ; sel_hobj~>endPt=rplaca(sel_hobj~>endPt nth(i interpt_xs)-w_v/2) ; else ; sel_hobj~>beginPt=rplaca(sel_hobj~>beginPt nth(i interpt_xs)-w_v/2) ; );end if ; );end if ; ) ;判断交叉点与水平方向bus x坐标的位置,以及起始结束点的大小,来判断net往那边延伸 ;v_bus for(i 0 len_v_bus-1 sel_vobj=nth(i v_bus) w_h=nth(i h_bus)~>width sel_v_part=geGetSelSetFigPoint(sel_vobj) if(!car(sel_v_part)&&nth(1 sel_v_part) then if(yCoord(sel_vobj~>endPt)>yCoord(sel_vobj~>beginPt) then sel_vobj~>endPt=reverse(rplaca(reverse(sel_vobj~>endPt) nth(i interpt_ys)+w_h/2)) else sel_vobj~>endPt=reverse(rplaca(reverse(sel_vobj~>endPt) nth(i interpt_ys)-w_h/2)) );end if );end if if(car(sel_v_part)&& !nth(1 sel_v_part) then if(yCoord(sel_vobj~>beginPt)>yCoord(sel_vobj~>endPt) then sel_vobj~>beginPt=reverse(rplaca(reverse(sel_vobj~>beginPt) nth(i interpt_ys)+w_h/2)) else sel_vobj~>beginPt=reverse(rplaca(reverse(sel_vobj~>beginPt) nth(i interpt_ys)-w_h/2)) );end if );end if ) ; for(i 0 len_v_bus-1 ; sel_vobj=nth(i v_bus) ; w_h=nth(i h_bus)~>width ; if(nth(i interpt_ys)>max(yCoord(sel_vobj~>endPt) yCoord(sel_vobj~>beginPt)) then ; if(yCoord(sel_vobj~>endPt)>yCoord(sel_vobj~>beginPt) then ; sel_vobj~>endPt=reverse(rplaca(reverse(sel_vobj~>endPt) nth(i interpt_ys)+w_h/2)) ; else ; sel_vobj~>beginPt=reverse(rplaca(reverse(sel_vobj~>beginPt) nth(i interpt_ys)+w_h/2)) ; );end if ; );end if ; if(nth(i interpt_ys)<min(yCoord(sel_vobj~>endPt) yCoord(sel_vobj~>beginPt)) then ; if(yCoord(sel_vobj~>endPt)<yCoord(sel_vobj~>beginPt) then ; sel_vobj~>endPt=reverse(rplaca(reverse(sel_vobj~>endPt) nth(i interpt_ys)-w_h/2)) ; else ; sel_vobj~>beginPt=reverse(rplaca(reverse(sel_vobj~>beginPt) nth(i interpt_ys)-w_h/2)) ; );end if ; );end if ; );end for ;create via in metal overlap techFile = techGetTechFile(cv) constraintGroupId = cstFindConstraintGroupIn(techFile "(virtuosoDefaultSetup)") myViaOptions = viaGetViaOptions(constraintGroupId) foreach(interpoint interpts vias=viaGenerateViasAtPoint(cv interpoint myViaOptions) );end for ; AlignNetsToVias() );end prog );end proc
procedure(ddyChangeCurrentLPPLayer() prog((cv sel_layer obj_layer) cv = geGetEditCellView() if(cv~>mode=="r" then MakeEditWaring() return(nil) sel_layer = geGetSelSet() obj_layer = leGetEntryLayer();获得lsw选中的层次 sel_layer~>lpp = obj_layer ));end change
procedure(ddyCopyCurrentLPPLayer() prog((cv sel_layer obj_layer copy_layer_list) cv = geGetEditCellView() if(cv~>mode=="r" then MakeEditWaring() return(nil)) sel_layer = geGetSelSet() obj_layer = leGetEntryLayer() foreach(sel sel_layer copy_layer = dbCopyFig(sel nil) copy_layer~>lpp = obj_layer copy_layer_list=append(copy_layer_list list(copy_layer)) );end foreach when(car(sel_layer~>figGroup) sel_group=car(sel_layer~>figGroup) copy_layers_group=append(copy_layer_list list(sel_group)) leReturn() geSelectFigs(copy_layers_group) leHiAddToGroup() );end when geSelectFigs(sel_layer~>figGroup) leHiEditInPlace() geSelectFigs(copy_layer_list) ));end