| |
procedure(paibu(box num)
let((dx dy insts inst instname x y xlist ylist instlb l h yymax libname lx ly mp mark numx numy instll spx spy cv tecName inst1)
cv=geGetEditCellView(hiGetCurrentWindow())
techName= techGetTechLibName(cv)
pts1=geWindowToEditPoint(hiGetCurrentWindow(),car(box))
pts2=geWindowToEditPoint(hiGetCurrentWindow(),cadr(box))
box=list(pts1 pts2)
dx=car(pts2)-car(pts1)
dy=cadr(pts2)-cadr(pts1)
l=0 h=0 yymax=list(0) ylist=list()
libname=ciUtilsMakeUnique(geGetSelSet()~>libName )
inst1=setof(x geGetSelSet() (x~>objType =="inst"||x~>objType == "mosaic")&&x~>libName!=techName)
;mp mn cap
for(i 0 length(libname)-1
insts=setof(x geGetSelSet() (x~>objType =="inst"||x~>objType == "mosaic")&&x~>libName==nth(i,libname))
xlist=sort(ciUtilsMakeUnique(insts~>cellName ) nil)
ylist=append(ylist xlist)
)
;
instname=ylist
;mp mn logic
insts=setof(x geGetSelSet() x~>objType =="inst"||x~>objType == "mosaic")
mp=setof(x geGetSelSet() x~>cellName=="mp"||x~>cellName=="mn"|| x~>cellName=="n50iso" ||x~>cellName=="nld40g5h_2")
for(i 1 length(mp)
cond(
(nth(i-1 mp)~>objType=="inst"
nth(i-1 mp)~>orient="R90")
))
foreach(x instname
instll=setof(z insts z~>cellName==x)
numx=0
numy=0
case(num
(1
instlb=sort(instll
(lambda (f1 f2)
if( equal((cadadr(f1~>bBox)-cadar(f1~>bBox) ) (cadadr(f2~>bBox)-cadar(f2~>bBox)) ) then
lessp((caadr(f1~>bBox)-caar(f1~>bBox) ) (caadr(f2~>bBox)-caar(f2~>bBox)))
else
lessp( (cadadr(f1~>bBox)-cadar(f1~>bBox)) (cadadr(f2~>bBox)-cadar(f2~>bBox)) )
)
)
)
)
(2
instlb=geGetSelSet()
)
)
case(x
(t lx=0 ly=0 spx=0 spy=0 mx=100 my=100)
);csae
foreach(u instlb
xx=caadr(u~>bBox)-caar(u~>bBox)
yy=cadadr(u~>bBox)-cadar(u~>bBox)
yymax=append1(yymax yy)
dbMoveFig(u geGetEditCellView() list(car(pts1)+l-caar(u~>bBox):cadr(pts1)+h-cadar(u~>bBox) "R0"))
;if(u~>objType =="inst" u~>orient car(u~>tileArray))
if(l+xx+lx<dx then
l=l+xx+lx
numx=numx+1
if(mod(numx mx)==0 l=l+spx )
else
l=0
yymax=sort(yymax 'greaterp)
h=h+car(yymax)+ly
yymax=list(0)
numy=numy+1
if(mod(numy my)==0 h=h+spy )
numx=0
);if
);foreach
if(exists(c ddGetObj(techName)~>cells~>name c==x) then
yymax=sort(yymax 'greaterp)
h=h+car(yymax)
l=0
yymax=list(0)
)
);foreach
);let
);procedure
hiSetBindKey("layout" "<Key>F6" "paibu(enterBox() 1)")