

[ Shell ] 通过 Shell 脚本导出 GDSII/OASIS 文件 - YEUNGCHIE
source link: https://www.cnblogs.com/yeungchie/p/16101378.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

[ Shell ] 通过 Shell 脚本导出 GDSII/OASIS 文件
https://www.cnblogs.com/yeungchie/
常见的集成电路版图数据库文件格式有 GDSII 和 OASIS,virtuoso 提供了下面两个工具,可以用来通过命令行导出版图数据。
-
strmout (导出为 GDSII 格式)
strmout -helpUsage: 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 -helpUsage: 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+(以项目情况而定),当项目数据较大的情况下,文件小了确实可以加快运行速度、节省时间(估计是硬盘读写环节拖累了整体运行时间)。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
下面写个脚本优化一下这个运行方式。
点击查看完整代码
(){
<<
}
viewName=
logFile=
[[ -n ]];
[[ -n ]];
lib_opt) libName= ;;
cell_opt) cellName= ;;
view_opt) viewName= ;;
file_opt) file= ;;
path_opt) path= ;;
log_opt) logFile= ;;
map_opt)
mapCmd=
;;
sum_opt)
sumCmd=
;;
opt
-lib) opt= ;;
-cell) opt= ;;
-view) opt= ;;
-file) opt= ;;
-path) opt= ;;
-) opt= ;;
-) opt= ;;
-layermap) opt= ;;
-oasis) OASIS=1 ;;
-h|-)
HelpDoc >&2
1
;;
*)
>&2
>&2
1
;;
runDir=$( -P)
[[ ! ( && && ) ]];
HelpInfo >&2
1
[[ -d ]];
>&2
>&2
1
[[ ]];
[[ ! ]]; file= ;
=
[[ ! ]]; file= ;
=
=
优化后的脚本有三个必要的参数需要指定
- -path
指定 cds.lib 文件所在的文件夹路径 - -lib
指定导出单元的顶层 Library 名称 - -cell
指定导出单元的顶层 Cell 名称
通过 -path 参数来定义 virtuoso 启动路径,实现在任意路径下可运行,生成的文件都在当前路径下。
例:cdslib 文件所在路径为 ../project
-
导出版图
verify/ad01d0/layout
单元为 GDSII 文件。export_layout -path ../project -lib verify -cell ad01d0
-
导出版图
verify/inv0d0/layout
单元为 OASIS 文件,指定输出文件名inv.oasis
,指定 log 文件为inv.log
。export_layout -path ../project -lib verify -cell inv0d0 -file inv.oasis -oasis -log inv.log
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK