This post provides a sample OCEAN script for MOS transistor characterization. The script is divided into Simulation setup and Run commands and Data access commands.
In general Simulation setup and Run commands are common for most of the scripts with minimal deviations, whereas are Data access commands are design or simulation specific and vary a lot from design to design. The skill functions outlined here using this example are very basic, and are frequently encountered in almost all scripts.
Command description
- select waveform tool ==> ocnWaveformTool(‘wavescan)
- set simulator ==> simulation(‘spectre)
- specify a design ==> design(“/path/to/netlist/file”)
Note: It is the netlist fie, not netlist directory.
If you want to move netlist file somewhere else, copy netlistHeader and netlistFooter files also. - specify a directory where results should be saved ==> resultsDir(“path/to/results/directory/”)
- specify model files for the elements in the design ==> modelFile( )
- specify an analysis ==> analysis(‘tran ?start xx ?stop yy)
- initialize variables that are used in design ==> desVar(“variable-name” value)
- save signals like power, current, ahdl variables etc., ==> saveOption(‘option “value”)
- specify the temperature of the circuit
- specify parametric analysis to do dc sweep
- plot data
addSubwindow() plot(getData("M0:ids"),getData("M0:gm") ?expr list("Ids","gm")) displayMode("strip")
- save data to file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ;;---------- SAMPLE OCEAN SCRIPT FOR MOS TRANSISTOR CHARACTERIZATION ----------- ;;***************** Simulation Set-up and Run Commands ***************** ocnWaveformTool( 'wavescan ) simulator( 'spectre ) design( "/home/username/simulation/MOSChar/spectre/schematic/netlist/netlist") resultsDir( "/home/username/simulation/MOSChar/spectre/schematic" ) modelFile( '("/cad/library/UMC90/Models/Spectre/L90_SP10_RF_V021.lib.scs" "tt") '("/home/username/cadence/oppoint.scs" "") ) analysis('dc ?saveOppoint t ?param "vds" ?start "0" ?stop "1.2" ?write "spectre.dc" ?oppoint "rawfile" ?maxiters "150" ?maxsteps "10000" ?annotate "status" ?threshold "0.0" ?detail "node" ?sort "name" ) ;; ---------- Some optional settings --------------- desVar( "vgs" 0.6 ) desVar( "vds" 0.6 ) envOption( 'firstRun nil 'autoDisplay t ) option( 'dochecklimit "yes" ) saveOption('save "all" ) saveOption( 'currents "selected" ) saveOption( 'useprobes "yes" ) saveOption( ?modelParamInfo t ) saveOption( ?elementInfo t ) saveOption( ?outputParamInfo t ) temp( 27 ) ;;---------- Sweep vgs --------------- paramAnalysis( "vgs" ?start 0 ?stop 0.9 ?step 0.3 ) paramRun() ;;********************** Data Access Commands ********************** ;;----------Plot the data--------------- addSubwindow() plot(getData("M0:ids"),getData("M0:gm") ?expr list("Ids","gm")) displayMode("strip") addSubwindow() plot(getData("M0:gds"),getData("M0:vdsat"),getData("M0:cgs") ?expr list("gds","vdsat","cgs")) displayMode("strip") ;; ------------Save the data------------- selectResult('dc) fileptr=outfile("./MOSChar/mosivdata.dat") ocnPrint( ?output fileptr ?numberNotation 'scientific getData("M0:ids" ?result "dc") ) close(fileptr) |
outputs() lists the variables or model parameters available after finishing simulation.
We can plot or save the data in the OCEAN environment after simulation is completed.