常见的集成电路版图数据库文件格式有 GDSII 和 OASIS,virtuoso 提供了下面两个工具,可以用来通过命令行导出版图数据。
- strmout (导出为 GDSII 格式)strmout -help
Usage: Usage: strmout
-library
-strmFile
[-strmVersion]
[-runDir]
[-topCell]
[-view]
[-logFile]
[-summaryFile]
[-techLib]
[-hierDepth]
[-layerMap]
[-translateUnmappedLPP]
[-labelMap]
[-labelDepth]
[-replaceBusBitChar] " With "[]">
[-cellMap]
[-fontMap]
[-propMap]
[-objectMap]
[-viaMap]
[-viaCutArefThreshold]
[-userSkillFile]
[-refLibList]
[-arrayInstToScalar]
[-cellNamePrefix]
[-cellNameSuffix]
[-ignoreTopCellPrefixSuffix]
[-case]
[-labelCase]
[-ignoreLines]
[-noOutputTextDisplays]
[-noOutputUnplacedInst]
[-convertDot]
[-convertPin]
[-pinAttNum]
[-pathToPolygon]
[-diagonalPathToPolygon]
[-propValueOnly]
[-rectToBox]
[-respectGDSIINameLimit]
[-gdsCellNameLength] =10)>
[-flattenPcells]
[-flattenVias]
[-outputViaShapesToViaPurp]
[-doNotPreservePcellPins]
[-snapToGrid]
[-dbuPerUU]
[-reportPrecisionLoss]
[-noObjectProp]
[-ignorePcellEvalFail]
[-mergePathSegsToPath]
[-noConvertHalfWidthPath]
[-checkPolygon]
[-backupGdsLogFiles]
[-maxVertices]
[-strmTextNS]
[-templateFile]
[-cellListFile]
[-outputDir]
[-noInfo]
[-noWarn]
[-warnToErr]
[-infoToWarn]
[-donutNumSides]
[-ellipseNumSides]
[-wildCardInCellMap]
[-ignoreMissingCells]
[-ignoreMissingVias]
[-subMasterSeparator]
[-convertPcellPin]
[-guiHistory]
[-ignoreZeroWidthPathSeg]
[-ignoreObjectMapFromTech]
[-ignoreCurrentTimestamp]
[-verbose] ose]
- oasisout (导出为 OASIS 格式)oasisout -help
Usage: oasisout
-library
-oasisFile
[-arrayInstToScalar]
[-backupOasisLogFiles]
[-case]
[-cellMap]
[-cellListFile]
[-cellNamePrefix]
[-cellNameSuffix]
[-checkPolygon]
[-circleToPolygon]
[-compress]
[-compressLevel]
[-convertDot]
[-convertPcellPin]
[-convertPin]
[-dbuPerUU]
[-diagonalPathToPolygon]
[-doNotPreservePcellPins]
[-donutNumSides]
[-ellipseNumSides]
[-flattenPcells]
[-flattenViaShapesToViaPurp]
[-flattenVias]
[-GDSIICompatible]
[-guiHistory]
[-hierDepth]
[-ignoreLines]
[-ignoreMissingCells]
[-ignoreMissingVias]
[-ignoreObjectMapFromTech]
[-ignorePcellEvalFail]
[-ignoreRoutes]
[-ignoreZeroWidthPathSeg]
[-infoToWarn]
[-labelMap]
[-labelDepth]
[-layerMap]
[-logFile]
[-mergePathSegsToPath]
[-noConvertHalfWidthPath]
[-noInfo]
[-noObjectProp]
[-noOutputTextDisplays]
[-noOutputUnplacedInst]
[-noWarn]
[-objectMap]
[-outputDir]
[-pathToPolygon]
[-preservePinAtt]
[-preserveTextAtt]
[-propMap]
[-refLibList]
[-replaceBusBitChar] " with "[]">
[-runDir]
[-snapToGrid]
[-subMasterSeparator]
[-summaryFile]
[-techLib]
[-templateFile]
[-textCase]
[-topCell]
[-translateUnmappedLPP]
[-userSkillFile]
[-verbose]
[-viaMap]
[-view]
[-warnToErr]
[-wildCardInCellMap]
OASIS 的文件体积声称可以比 GDSII 小 10~50 倍,实际在我的使用中这个数字可以到 20+(以项目情况而定),当项目数据较大的情况下,文件小了确实可以加快运行速度、节省时间(估计是硬盘读写环节拖累了整体运行时间)。
oasisout
和 strmout
几个常用的参数都是相同的,下面讲下如何使用。
另外,命令的运行路径必须在 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.log
、oasisOut.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 <.gds or .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
相关拓展
Original: https://www.cnblogs.com/yeungchie/p/16101378.html
Author: YEUNGCHIE
Title: [ Shell ] 通过 Shell 脚本导出 GDSII/OASIS 文件
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/619463/
转载文章受原作者版权保护。转载请注明原作者出处!