https://www.cnblogs.com/yeungchie/

常见的集成电路版图数据库文件格式有 GDSII 和 OASIS,virtuoso 提供了下面两个工具用来在 Shell 中导出版图数据。

  • strmout (导出为 GDSII 格式)

    strmout -help
    Usage: Usage: strmout
    -library <Input Library>
    -strmFile <Output Stream File>
    [-strmVersion] <Stream Version Number>
    [-runDir] <Run Directory>
    [-topCell] <Toplevel Cells to Translate>
    [-view] <Toplevel Cell View Name>
    [-logFile] <Output Log File Name>
    [-summaryFile] <Output Summary File>
    [-techLib] <Technology Library>
    [-hierDepth] <Hierarchical Depth to Translate to>
    [-layerMap] <Quoted List of Layer Map Files>
    [-translateUnmappedLPP] <Allow undefined LPP to be translated by incrementally mapping LPP using layerMap file, SKILL hook poLayerMap, and automatic layer mapping>
    [-labelMap] <Input Label Map File>
    [-labelDepth] <Hierarchical Depth to Add Labels to>
    [-replaceBusBitChar] <Replace "<>" With "[]">
    [-cellMap] <Input Cell Map File>
    [-fontMap] <Input Font Map File>
    [-propMap] <Input Property Map File>
    [-objectMap] <Quoted List of Object Mapping Files>
    [-viaMap] <Via Mapping File>
    [-viaCutArefThreshold] <Threshold Value For Creating AREF For Cut Geometries For Via>
    [-userSkillFile] <User Skill File>
    [-refLibList] <Name of The File Containing Refliblist >
    [-arrayInstToScalar]
    [-cellNamePrefix] <Cell Name Prefix>
    [-cellNameSuffix] <Cell Name Suffix>
    [-ignoreTopCellPrefixSuffix] <Ignores cellName Prefix and Suffix for topCell>
    [-case] <upper | lower | preserve >
    [-labelCase] <upper | lower | preserve >
    [-ignoreLines]
    [-noOutputTextDisplays]
    [-noOutputUnplacedInst] <Do not Output Unplaced Instances>
    [-convertDot] <node | polygon | ignore >
    [-convertPin] <geometry | text | geometryAndText | ignore >
    [-pinAttNum] <Stream Attribute Num (1-127) For Preserving Pins>
    [-pathToPolygon] <Convert Paths to Polygons>
    [-diagonalPathToPolygon] <Convert Paths with non-orthogonal segments to polygons>
    [-propValueOnly] <Output Property Values Only>
    [-rectToBox]
    [-respectGDSIINameLimit]
    [-gdsCellNameLength] <Truncate GDS Cell/STRUCT name length to specified value (>=10)>
    [-flattenPcells]
    [-flattenVias]
    [-outputViaShapesToViaPurp] <Output Shapes of Via to Via Purpose>
    [-doNotPreservePcellPins]
    [-snapToGrid]
    [-dbuPerUU] <DB Units per user units>
    [-reportPrecisionLoss] <Report Precision Loss Because of dbuPerUU Value>
    [-noObjectProp]
    [-ignorePcellEvalFail]
    [-mergePathSegsToPath] <Merging pathSegs into a single PATH>
    [-noConvertHalfWidthPath] <Do not Convert The Half Width Path to Boundary>
    [-checkPolygon] <Report Bad Polygons And Paths>
    [-backupGdsLogFiles] <Backup GDSII and LOG files, if they already exist>
    [-maxVertices] <Maximum Limit of Vertices (5-4000) Allowed in Stream File>
    [-strmTextNS] <NameSpace of The TEXT Records in The Stream File>
    [-templateFile] <Name of The File Containing Option Names And Values>
    [-cellListFile] <Name of the file containing cellList>
    [-outputDir] <output directory>
    [-noInfo] <Quoted List of Info Message Ids>
    [-noWarn] <Quoted List of Warning Message Ids>
    [-warnToErr] <Quoted List of warning Message Ids>
    [-infoToWarn] <Quoted List of Info Message Ids>
    [-donutNumSides] <Number of sides (4-131072) for the BOUNDARY of donut>
    [-ellipseNumSides] <Number of sides (4-131072) for the BOUNDAR of ellipse>
    [-wildCardInCellMap] <Wild Card in cell map file>
    [-ignoreMissingCells] <Ignores Missing cellViews During Translation and Continue Translation>
    [-ignoreMissingVias] <Ignores Missing standard/custom vias During Translation and Continue Translation>
    [-subMasterSeparator] <Separator to used for sub-master naming (default: "_CDNS_")>
    [-convertPcellPin] <geometry | text | geometryAndText | ignore (default: convertPin value)>
    [-guiHistory] <Use options of last successful translation from the XStream Out GUI>
    [-ignoreZeroWidthPathSeg] <Ignores zero width PathSeg during translation>
    [-ignoreObjectMapFromTech] <Ignores object map file from technology>
    [-ignoreCurrentTimestamp] <Ignores current timestamp>
    [-verbose] <Generate detailed information in the log and summary files>ose] <Generate detailed information in the log and summary files>
  • oasisout (导出为 OASIS 格式)

    oasisout -help
    Usage: oasisout
    -library <Input Library>
    -oasisFile <Output OASIS File>
    [-arrayInstToScalar] <Convert Arrays to Scalar Instances>
    [-backupOasisLogFiles] <Backup OASIS and LOG files, if they already exist>
    [-case] <upper | lower | preserve>
    [-cellMap] <Input cell map file>
    [-cellListFile] <Name of the file containing cellList>
    [-cellNamePrefix] <Cell name prefix>
    [-cellNameSuffix] <Cell name suffix>
    [-checkPolygon] <Report bad polygons and paths>
    [-circleToPolygon] <Convert Cricle/Ellipse object to Polygon>
    [-compress] <Enable CBLOCK compression>
    [-compressLevel] <Set the compression level for CBLOCK compression>
    [-convertDot] <polygon | circle | ignore>
    [-convertPcellPin] <geometry | text | geometryAndText | ignore (default: convertPin value)>
    [-convertPin] <geometry | text | geometryAndText | ignore>
    [-dbuPerUU] <DB Units per user units>
    [-diagonalPathToPolygon] <Convert Paths with non-orthogonal segments to Polygons>
    [-doNotPreservePcellPins] <Do not preserve the PCell Pins>
    [-donutNumSides] <Number of sides (4-131072) for the BOUNDARY of Donut>
    [-ellipseNumSides] <Number of sides (4-131072) for the BOUNDAR of Circle/Ellipse>
    [-flattenPcells] <Flatten the PCell Instances>
    [-flattenViaShapesToViaPurp] <Flatten Vias' Shapes to Via Purpose>
    [-flattenVias] <Flatten the Vias>
    [-GDSIICompatible] <Generate the OASIS file with GDSII specific limits>
    [-guiHistory] <Use options of last successful translation from the XOasis Out GUI>
    [-hierDepth] <Hierarchical depth to translate to>
    [-ignoreLines] <Ignore Line objects>
    [-ignoreMissingCells] <Ignore missing cellViews during translation and continue translation>
    [-ignoreMissingVias] <Ignore missing standard/custom vias during translation and continue translation>
    [-ignoreObjectMapFromTech] <Ignore object map file from technology>
    [-ignorePcellEvalFail] <Ignore the PCell evaluation failure>
    [-ignoreRoutes] <Ignore Route objects>
    [-ignoreZeroWidthPathSeg] <Ignore zero width PathSeg during translation>
    [-infoToWarn] <Quoted list of Info message Ids>
    [-labelMap] <Input label map file>
    [-labelDepth] <Hierarchical depth to add labels to>
    [-layerMap] <Quoted list of layer map files>
    [-logFile] <Output log file name>
    [-mergePathSegsToPath] <Merge pathSegs into a single PATH>
    [-noConvertHalfWidthPath] <Do not convert the half width Path to Boundary>
    [-noInfo] <Quoted list of info message Ids>
    [-noObjectProp] <Do not write the special object properties>
    [-noOutputTextDisplays] <Do not output Text Displays>
    [-noOutputUnplacedInst] <Do not output Unplaced Instances>
    [-noWarn] <Quoted list of warning message Ids>
    [-objectMap] <Quoted list of object mapping files>
    [-outputDir] <output directory>
    [-pathToPolygon] <Convert Path object to Polygon>
    [-preservePinAtt] <Preserve Pin connectivity information>
    [-preserveTextAtt] <Preserve Text attributes as properties>
    [-propMap] <Input property map file>
    [-refLibList] <Name of the file containing reference libraries list>
    [-replaceBusBitChar] <Replace "<>" with "[]">
    [-runDir] <Run directory>
    [-snapToGrid] <Snap to grid>
    [-subMasterSeparator] <Separator to used for sub-master naming (default: "_CDNS_")>
    [-summaryFile] <Output summary file>
    [-techLib] <Technology library>
    [-templateFile] <Name of the file containing option names And values>
    [-textCase] <upper | lower | preserve>
    [-topCell] <Toplevel cells to translate>
    [-translateUnmappedLPP] <Allow undefined LPP to be translated by incrementally mapping LPP using layerMap file, SKILL hook poLayerMap, and automatic layer mapping>
    [-userSkillFile] <User skill file>
    [-verbose] <Generate detailed information in the log and summary files>
    [-viaMap] <Via mapping file>
    [-view] <Toplevel cell view name>
    [-warnToErr] <Quoted list of warning message Ids>
    [-wildCardInCellMap] <Wild card in cell map file>

OASIS 的文件体积声称可以比 GDSII 小 10~50 倍,实际在我的使用中这个数字达到 20+ 倍(以项目情况而定),某些情况文件小了确实可以加快运行速度、节省时间(估计是硬盘读写环节拖累了整体运行时间)。

oasisoutstrmout 几个常用的参数都是相同的,下面讲下如何使用。

另外,命令的运行路径必须在 virtuoso 启动路径(能在当前路径下找得到 cds.lib 文件)。

参数解释

必要的

首先有几个必要的运行条件和参数。

  • -library

    这个参数用来指定导出的单元库 (library) 名。

  • -strmFile

    当使用 strmout 时,这个参数用来指定导出的 GDSII 文件名称。

  • -oasisFile

    当使用 oasisout 时,这个参数用来指定导出的 OASIS 文件名称。

推荐的

其次还有几个是可选的参数,但是建议也指定一下。

  • -topCell

    指定导出单元的顶层 Cell 名称,指定了顶层 Cell 就不会导出该顶层没有调用的单元,否则会导出当前库下的所有 Cell 。

  • -view

    指定导出单元的顶层 View 名称,默认为 layout

  • -runDir

    指定运行路径。

    注意这里的 运行路径 不同于前面提到的命令的运行路径。

    当定义了 -runDir-strmFile-oasisFile-logFile-summaryFile 等参数如果定义的是相对路径,则会以 -runDir 为参考。

  • -logFile

    生成 log 文件,默认生成文件名为 strmOut.logoasisOut.log

  • -summaryFile

    生成 summary 文件,默认不生成。

  • -layerMap

    指定 layermap 文件,默认情况是调用 attach tech 中的 layermap,当对层次转换有特殊要求时可以通过这个参数来指定自定义的 layermap 。

编写脚本 export_layout

下面写个脚本优化一下这个运行方式。

点击查看完整代码
#!/bin/bash
#--------------------------
# Program : export_layout.sh
# Language : Bash
# Author : YEUNGCHIE
# Version : 2022.04.05
#--------------------------
HelpInfo(){
cat <<EOF
-------------------------------------------------
Export Layout ( GDSII or OASIS ) File
-------------------------------------------------
Usage: export_layout -path cdslibDir -lib libName -cell cellName [ OPTIONS ] -path Path where the cds.lib file is located
-lib Layout top cell libName
-cell Layout top cell cellName
-view Layout top cell viewName ( Default: layout )
-file Output file name ( Default: <cellName>.gds or <cellName>.oasis )
-log Log file ( Default: export_layout.log )
-sum Summary file
-layermap Specified the layermap file
-oasis Specified the file format is OASIS, and GDSII if not specified
-h, -help Display this help Examples: export_layout\\
-path \$project/work/
-lib Xeon
-cell X999
-oasis Output: OASIS file - X999.oasis
EOF
} viewName='layout'
logFile='export_layout.log' # 命令行参数分析
while [[ -n $1 ]]; do
if [[ -n $opt ]]; then
case $opt in
lib_opt) libName=$1 ;;
cell_opt) cellName=$1 ;;
view_opt) viewName=$1 ;;
file_opt) file=$1 ;;
path_opt) path=$1 ;;
log_opt) logFile=$1 ;;
map_opt)
mapCmd="-layerMap $1"
;;
sum_opt)
sumCmd="-summaryFile $1"
;;
esac
unset opt
else
case $1 in
-lib) opt='lib_opt' ;;
-cell) opt='cell_opt' ;;
-view) opt='view_opt' ;;
-file) opt='file_opt' ;;
-path) opt='path_opt' ;;
-log) opt='log_opt' ;;
-sum) opt='sum_opt' ;;
-layermap) opt='map_opt' ;;
-oasis) OASIS=1 ;;
-h|-help)
HelpDoc >&2
exit 1
;;
*)
echo "Invalid option - '$1'" >&2
echo "Try -h or -help for more infomation." >&2
exit 1
;;
esac
fi
shift
done # 记录当前路径
runDir=$(pwd -P) # 参数检查
if [[ ! ( $path && $libName && $cellName ) ]]; then
# 缺少必要参数时,打印 help 并退出
HelpInfo >&2
exit 1
elif [[ -d $path ]]; then
cd $path
else
# 找不到目标路径文件,打印报错
echo "No such directory - $path" >&2
echo "Try -h or -help for more infomation." >&2
exit 1
fi ## 不同的文件格式
if [[ $OASIS ]]; then
if [[ ! $file ]]; then file="${cellName}.oasis" ; fi
command="oasisout -oasisFile $file"
else
if [[ ! $file ]]; then file="${cellName}.gds" ; fi
command="strmout -strmFile $file"
fi command="$command -runDir $runDir -library $libName -topCell $cellName -view $viewName -logFile $logFile $sumCmd $mapCmd" # 运行
exec $command

优化后的脚本有三个必要的参数需要指定

  • -path

    指定 cds.lib 文件所在的文件夹路径
  • -lib

    指定导出单元的顶层 Library 名称
  • -cell

    指定导出单元的顶层 Cell 名称

通过 -path 参数来定义 virtuoso 启动路径,实现在任意路径下可运行,生成的文件都在当前路径下。

运行实例

例:cdslib 文件所在路径为 ../project

  1. 导出版图 verify/ad01d0/layout 单元为 GDSII 文件。

    export_layout -path ../project -lib verify -cell ad01d0
  2. 导出版图 verify/inv0d0/layout 单元为 OASIS 文件,指定输出文件名 inv.oasis,指定 log 文件为 inv.log

    export_layout -path ../project -lib verify -cell inv0d0 -file inv.oasis -oasis -log inv.log

相关拓展

[ Shell ] 通过 Shell 脚本导出 GDSII/OASIS 文件的更多相关文章

  1. shell(sed/gawk)脚本(计算目录文件/验证电话号码/解析电子邮件地址)

    1.计算目录文件 #!/bin/bash mypath=`echo $PATH | sed 's/:/ /g'`#注意` ` 和 ‘ ’ count= for directory in $mypath ...

  2. oracle-sql脚本导出EXCEL数据

    在数据库中,经常有业务人员提出需求导出数据库中的业务数据,而且是每天.每周或每月定时导出.为了方便,可将sql查询的脚本 通过下面脚本来导出EXCEL数据. 1.将查询sql脚本(AAA.sql)放到 ...

  3. 如何使用shell脚本快速排序和去重文件数据

    前面写过一篇通过shell脚本去重10G数据的文章,见<用几条shell命令快速去重10G数据>.然而今天又碰到另外一个业务,业务复杂度比上次的单纯去重要复杂很多.找了很久没有找到相应的办 ...

  4. Centos7下crontab+shell脚本定期自动删除文件

    问题描述: 最近有个需求,就是rsync每次同步的数据量很多,但是需要保留的数据库bak文件 保留7天就够了,所以需要自动清理文件夹内的bak文件 解决方案: 利用shell脚本来定期删除文件夹内的任 ...

  5. 【Mysql+shell】查询结果导出到文件,文件数据导入到数据库

    Shell: 执行Mysql查询,并将查询结果导出到文件 直接使用Mysql执行查询 mysql> use xxx_dbName; mysql> select * from log_06 ...

  6. Shell执行将脚本里的变量打印到指定日志文件

    首先需要定位获取任务的运行日志或者报错信息,才能定位问题. 通过shell调用有些脚本的话,日志信息会打印在shell里.不过也有用户在shell里调用正常,但是到crontab调用的时候就出错并且没 ...

  7. Shell脚本使用汇总整理——文件夹及子文件备份脚本

    Shell脚本使用汇总整理——文件夹及子文件备份脚本 Shell脚本使用的基本知识点汇总详情见连接: https://www.cnblogs.com/lsy-blogs/p/9223477.html ...

  8. shell脚本切割tomcat日志文件

    转自:http://www.cnblogs.com/lishun1005/p/6054816.html 鉴于在调试logback和log4j的文件切割一直无法成功,随性用shell写个脚本用来切割to ...

  9. shell脚本实现读取一个文件中的某一列,并进行循环处理

    shell脚本实现读取一个文件中的某一列,并进行循环处理 1) for循环 #!bin/bash if [ ! -f "userlist.txt" ]; then echo &qu ...

随机推荐

  1. linux下编译安装php5.6出现 configure: error: Cannot find MySQL header files under /usr/local/mysql.

    #yum install gcc gcc-c++ libxml2 libxml2-devel libjpeg-devel libpng-devel freetype-devel openssl-dev ...

  2. 前面顺序表的补充(复杂度,未实现的算法,空间扩展)(基于c语言)

    0.对于顺序表中的n个元素,如果在下标i的位置之前插入一个元素,则需要将后面n-i个元素向后移动一位:如果是删除下标为i处的元素,则是则需要将后面n-i-1个元素向前移动一位.如果说在i的位置插入和删 ...

  3. QT designer的安装与汉化(pycharm)

    QT designer的安装 1.安装好Python3的环境 添加环境变量,保证安装正确, 2.安装PyQt5 采用命令安装,Win+R,输入CMD,打开命令框,输入以下命令.后面是豆瓣的镜像地址,是 ...

  4. [Lua游戏AI开发指南] 笔记零 - 框架搭建

    一.图书详情 <Lua游戏AI开发指南>,原作名: Learning Game AI Programming with Lua. 豆瓣:https://book.douban.com/su ...

  5. 在centos7上安装iptables防火墙

    规则配置: iptables -P OUTPUT ACCEPT 1.关闭原先CentOS7自带的firewall防火墙: systemctl stop firewalld 2.安装或更新iptable ...

  6. Dubbo 可以对结果进行缓存吗?

    为了提高数据访问的速度.Dubbo 提供了声明式缓存,以减少用户加缓存的工作 量 <dubbo:reference cache="true" /> 其实比普通的配置文件 ...

  7. 什么是Spring Cloud Bus?

    spring cloud bus 将分布式的节点用轻量的消息代理连接起来,它可以用于广播配置文件的更改或者服务直接的通讯,也可用于监控. 如果修改了配置文件,发送一次请求,所有的客户端便会重新读取配置 ...

  8. kafka unclean 配置代表啥,会对 spark streaming 消费有什么影响?

    unclean.leader.election.enable 为true的话,意味着非ISR集合的broker 也可以参与选举,这样有可能就会丢数据,spark streaming在消费过程中拿到的 ...

  9. 什么是 DAO 模式?

    DAO(Data Access Object)顾名思义是一个为数据库或其他持久化机制提供了 抽象接口的对象,在不暴露底层持久化方案实现细节的前提下提供了各种数据访 问操作.在实际的开发中,应该将所有对 ...

  10. Thread 类的 sleep()方法和对象的 wait()方法都可以让线 程暂停执行,它们有什么区别?

    sleep()方法(休眠)是线程类(Thread)的静态方法,调用此方法会让当前线程 暂停执行指定的时间,将执行机会(CPU)让给其他线程,但是对象的锁依然保 持,因此休眠时间结束后会自动恢复(线程回 ...