7

[ Shell ] 通过 Shell 脚本导出 CDL 网表 - YEUNGCHIE

 2 years ago
source link: https://www.cnblogs.com/yeungchie/p/16101093.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.
neoserver,ios ssh client

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

通过 si 导出电路网表,实际上在 Virtuoso 中通过菜单 File - Export - CDL 和 Calibre LVS 中 Export from schematic viewer 也是通过 si 来导出电路网表的,下面讲下如何使用。

如何运行 si

下面是 si 的运行命令, $cdslibFile 为 cds.lib 文件。

si -batch -command netlist -cdslib $cdslibFile

si.env 文件

在 si 的运行路径下需要提前准备好一个 si.env 文件,si 通过读取这个文件的内容来配置导出 cdl 所需要的信息。

文件的如何编写可以参考 help 文档:

  • Virtuoso Shared Tools
    • Design Data Translators Reference
      • Design Translation Using CDL Out
        • Using CDL Out
          • Preparing the si.env File

简单看看就行,我一般是直接通过 GUI 界面尝试导出一份 cdl,然后在运行路径下会有一份 si.env 文件,下面是一个例子:

simLibName = "stdcel"
simCellName = "TOP"
simViewName = "schematic"
simSimulator = "auCdl"
simNotIncremental = 't
simReNetlistAll = nil
simViewList = '("auCdl" "cdl" "schematic" "cmos_sch" "gate_sch" "cmos.sch" "gate.sch" "symbol")
simStopList = '("auCdl" "cdl")
hnlNetlistFileName = "TOP.cdl"
resistorModel = ""
shortRES = 2000.0
preserveRES = 't
checkRESVAL = 't
checkRESSIZE = 'nil
preserveCAP = 't
checkCAPVAL = 't
checkCAPAREA = 'nil
preserveDIO = 't
checkDIOAREA = 't
checkDIOPERI = 't
checkCAPPERI = 'nil
simPrintInhConnAttributes = 'nil
checkScale = "meter"
checkLDD = 'nil
pinMAP = 'nil
preserveBangInNetlist = 'nil
shrinkFACTOR = 0.0
globalPowerSig = ""
globalGndSig = ""
displayPININFO = 't
preserveALL = 't
setEQUIV = ""
incFILE = "./Subcircuit/3t_device.cdl"
auCdlDefNetlistProc = "ansCdlHnlPrintInst"

这个例子中导出的顶层电路单元是 stdcel/TOP/schematic,我们只关心其中几个常用的变量:

  • simLibName ( Library Name ) stdcel
  • simCellName ( Top Cell Name ) TOP
  • simViewName ( View Name ) schematic
  • hnlNetlistFileName ( Output CDL Netlist File )
  • incFILE ( Include File )
  • auCdlDefNetlistProc ( Analog Netlisting Type ) 这个变量决定 pin 的连接方式
    • ansCdlSubcktCall ( Connection By Order ) 顺序连接
    • ansCdlHnlPrintInst ( Connection By Name ) 命名端口连接,一般选择这个来保证 IP/Digital 网表的连接

Run Directory 直接由 si 的运行路径来决定。

编写脚本 export_cdl

明白了 si 的使用方法,现在可以写一个 shell 脚本,在 Terminal 操作,实现便捷地导出指定电路单元的 cdl 文件。

点击查看完整代码








(){
     <<
}

viewName=
connType=


 [[ -n  ]]; 
     [[ -n  ]]; 
          
            lib_opt)        libName=      ;;
            cell_opt)       cellName=     ;;
            view_opt)       viewName=     ;;
            file_opt)       netlistFile=  ;;
            cdslib_opt)     cdslibFile=   ;;
            include_opt)    includeFile=  ;;
        
         opt
    
          
            -lib)       opt=       ;;
            -cell)      opt=      ;;
            -view)      opt=      ;;
            -file)      opt=      ;;
            -cdslib)    opt=    ;;
            -include)   opt=   ;;
            -order)
                connType=
            ;;
            -h|--)
                HelpDoc >&2
                 1
            ;;
            *)
                  >&2
                  >&2
                 1
            ;;
        
    
    



 [[ ! (  &&  &&  ) ]]; 
    
    HelpInfo >&2
     1
 [[ -f  ]]; 
    
    cdslibDir=$( $( );  -P)
    fileName=$( )
    cdslibFile=

    
      >&2
      >&2
     1



 [[ !  ]];  netlistFile= ; 


 > si.env <<


si -batch - netlist -cdslib 

status=$?


 [[ -f .stimulusFile.auCdl ]];   -rf .stimulusFile.auCdl ; 
 [[ -f si.env              ]];   -rf si.env              ; 
 [[ -f netlist             ]];   -rf netlist             ; 
 [[ -d ihnl                ]];   -rf ihnl                ; 
 [[ -d map                 ]];   -rf map                 ; 

 

例:cdslib 文件为 ./cds.lib

  1. 导出 verify 库中的 ad01d0 单元的电路网表。

    export_cdl -cdslib cds.lib -lib verify -cell ad01d0
    

    导出的 cdl 文件名为 ad01d0.cdl

  2. 导出 verify 库中的 inv0d0 单元的电路网表,同时包含 subckt 网表文件 ./netlist,并指定 cdl 文件名为 inv.cdl

    export_cdl -cdslib ./cds.lib -lib verify -cell inv0d0 -include ./netlist
    

    导出的 cdl 文件名为 inv.cdl

[ Calibre ] 脚本批量运行 LVS DRC 的一套流程 - YEUNGCHIE - 博客园


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK