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)

)

)

)

)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 大宝马上要生日了,我买了牛听听作为礼物,但还没拿出来。昨天下载了牛听听app,先给他预热下。早上起床,放了首刷牙歌...
    怡然自得SH阅读 139评论 0 0
  • 文||胡思入梦菲 我哭过,很悲伤很绝望,我也笑过,很幸福很温暖。我已走过了很多的路,累过,想要放弃过,不知道自...
    丁渔阅读 311评论 0 1
  • 小时候我把你装进童年的口袋里,梦见你来到我身边带着糖果和礼物。 鞭炮声中,我推开一扇门,在喜悦中窥视你的身影...
    墨客人阅读 293评论 0 0
  • 在我还年少的时日, 给你写了许多情诗。 趁我臂弯仍旧宽广, 希望多放你进胸膛。 以后 当我老了 骨头硬了,身形消瘦...
    吴然后1992阅读 377评论 3 5