SKILL:从指定library中自动调取所有cell

说明:自动调取library中的layout cell到当前打开的cell中。

代码一、(此代码试用后某些cell无法全部调出来)

procedure(inst_all_cells(libname)

let((cv libid is_cell_there x width)

x=0.0

cv=getEditRep()

libid=ddGetObj(libname)

foreach(cell libid~>cells~>name

printf("instancing %L\n" list(libname cell))

is_cell_there = ddGetObj(libname  cell "layout")

if(is_cell_there then

xcv = dbOpenCellViewByType(libname cell "layout" "maskLayout" "r")

when(xcv

width=getPrbWidth(xcv)

dbCreateInst(cv xcv "" list(x 0) "R0")

x=x+width

)

dbClose(xcv)

)

)

)

)

procedure(getPrbWidth(xcv)

prog((prblayer prb width)

if(xcv then

prblayer=setof(x xcv~>shapes x~>lpp=='("prBoundary" "drawing"))

(注意prBoundary修改成STDcell中的prboundary层)

prb=car(prblayer)

width=rightEdge(prb)-leftEdge(prb)

return(width)

else

return(nil)

)

)

)

代码二、(此代码可全部调出指定lib中的所有cell)

procedure(inst_all_cells(libname)

let((cv libid is_cell_there x width)

x=0.0

cv=getEditRep()

libid=ddGetObj(libname)

foreach(cell libid~>cells~>name

printf("Working on %L\n" list(libname cell))

is_cell_there = ddGetObj(libname  cell "layout")

if(is_cell_there then

xcv = dbOpenCellViewByType(libname cell "layout" "maskLayout" "r")

when(xcv

width=rightEdge(xcv)-leftEdge(xcv)

dbCreateInst(cv xcv "" list(x 0) "R0")

x=x+width

)

dbClose(xcv)

)

)

)

)

你可能感兴趣的:(SKILL:从指定library中自动调取所有cell)