如何用calibredrv 来merge多个cell的gds

1. 两个cell合并到一个gds

calibredrv -shell

layout filemerge -in A.gds -in B.gds -out  AB.gds -createtop AB_TOP

也可以不加createtop,这样A,B就是平级的。

2. 很多cell

calibredrv -shell

layout filemerge -in A.gds  -indir gdsdir/ -out TOP.gds

 

 

calibredrv合并GDS需要的命令

layout filemerge -in input_file1 [layer_bump1]
[-in input_file2 [layer_bump2] …]
[-infile {
-name filename
[-layerbump layer_bump]
[[-exclude_layer {layer1 …}] |
[-include_layer {layer1 …}]]
} ] …
[-indir directory]
-out output_file
[-mode mode]
[-cblockmode [auto | 0 | 1]]
[-smartdiff [-ignoretext] [-ignoreproperty] [-convertpathtopoly]]
[-noemptycells 0 | 1]
[-createcache 0 | 1]
[-exclude_layer {layer1 …}] |
[-include_layer {layer1 …}]
[-createtop cellname]
[-topcell topcellname]
[-map_cell cellname mapcellname]
[-preserve filterfile]
[-tmp tmpdir]
[-verbose]

看起来很多option,其实通常用到-in和-out就够用

 

 

#Extracts a cell from an existing layout into a new GDS file:
# Load existing layout.
set Llayout [layout create mylayout.gds]
# Create an empty layout.
set Lnew [layout create]
# Create topcell for new layout.
$Lnew create cell TOP
# Copy MyGeom cell to new layout, calling it MyGeomNew. Copies all
# geometry, but not placements.
$Lnew create cell MyGeomNew $Llayout MyGeom
# Place MyGeomNew cell reference in new layout.
$Lnew create ref TOP MyGeomNew 0 0 0 0 1
# Export new layout.
$Lnew gdsout new.gds

这是创建了一个新的layout, 新的top为TOP, 并为这个TOP调用已有的mylayout.gds中的mygeomnew cell,最后保存为new.gds

但实际上我们要达到开头说的A和B的目的,还需修改一下这个例子

第一步,打开 A和B的gds, 用 layout create命令

# Load A.gds.
set layoutA [layout create A.gds]
# Load B.gds.
set layoutB [layout create B.gds]

第二步,这时打开的是两个不同cell,所以需要所b.gds中的BTOP copy到a.gds 中

# Copy BTOP from B.gds to A.gds
$layoutA create cell BTOP $layoutB BTOP

第三步,ATOP中调用BTOP, 用到create ref命令

#crate reference cell
$layoutA create ref ATOP BTOP 0 0 0 0 1

最后用 gdsout命令保存新的gds

# Export new layout.
$layoutA gdsout c.gds

完整的code如下

# Load A.gds.
set layoutA [layout create A.gds]
# Load B.gds.
set layoutB [layout create B.gds]
# Copy BTOP from B.gds to A.gds
$layoutA create cell BTOP $layoutB BTOP
#crate reference cell
$layoutA create ref ATOP BTOP 0 0 0 0 1
# Export new layout.
$layoutA gdsout c.gds

teriminal下输入

calibredrv xxx.txt

其实还有个layout import命令可以先把B的gds导入到A,再创建ref
或者将A.gds和B.gds 合并后再创建ref

 

用calibredrv打开一包a.gds,然后File->import,导入需要的b.gds 2、选择Object->Creat Reference,调用b.gds,注意原点设为(0,0) 3、然后save一下。之后b就变成了a的一个子cell。a的top_cell_name还是a。

posted @ 2021-05-24 09:15  yylei  阅读(2492)  评论(0编辑  收藏  举报