Saturday, August 07, 2010

Ocean script: run parametric analysis (paramAnalysis)


This is the Ocean script tutorial to run multiple parametric analysis (paramAnalysis) and to plot output waveforms and equations / expressions in family group.

Before running ocean script, all the setup like equations/expressions and output waveforms are set in the analog Artist. Then click on --> session --> save ocean script.

This example shows the minimum changes are needed for multiple parametric analysis. The red color lines are the edited part for parametric analysis. The blue color lines are optional.

If you want to re-extract data (like different equations or plotting waveforms), you could disable the ;paramRun and execute the same script with different equations or output waveforms.

The example here is to extract Q factor and capacitance values for differential array cap for LC VCO. Ac analysis is used.


;------------------------------------------

ocnWaveformTool( 'awd )
simulator( 'spectre )
design( "/xxx/simulation/caparray_ac_tb/spectre/schematic/netlist/netlist")
resultsDir( "/xxx/simulation/caparray_ac_tb/spectre/schematic" )
modelFile(
'("/xxxx/spectre/yyyyy.scs" "typical")
)
analysis('ac ?start "1M" ?stop "100G" )
desVar( "vc" 1.3 )
desVar( "b3" 1 )
desVar( "b2" 0 )
desVar( "b1" 0 )
desVar( "b0" 0 )
desVar( "wsw" 0.8u )
desVar( "lsw" 0.4u )
desVar( "wpair" 5u )
desVar( "vcc" 2 )
desVar( "on" 1 )
desVar( "wnmos" 5u )
desVar( "lnmos" 0.18u )
desVar( "vcm" 1.3 )
save( 'v "/vcm1" "/vcm2" )
save( 'i "/R4/PLUS" "/R5/PLUS" )
temp( 27 )

;-------- RunSim setup-----------
;run() ;disable this from the default ocean script


paramAnalysis( "b3" ?start 0 ?stop 1 ?step 1
;cap array bits
paramAnalysis( "b2" ?start 0 ?stop 1 ?step 1

paramAnalysis( "b1" ?start 0 ?stop 1 ?step 1
paramAnalysis( "b0" ?start 0 ?stop 1 ?step 1

paramAnalysis( "vc" ?start 0 ?stop 2 ?step 0.2 )))))
;vc=tuning voltage
paramRun() ; disable this if only data extracting--------


;------------------------------Data Extracting ------------

selectResult( 'ac ) ;add this

pi=3.141592653589793 ;define pi since ocean does not know pi value


Q_diff2 = abs((imag(((VF("/vcm1") - VF("/vcm2")) / (IF("/R4/PLUS") - IF("/R5/PLUS")))) / real(((VF("/vcm1") - VF("/vcm2")) / (IF("/R4/PLUS") - IF("/R5/PLUS"))))))

plot( Q_diff2 ?expr '( "Q_diff2" ) )

addSubwindow() ;add sub window


Cap_diff = (value(imag((IF("/R4/PLUS") - IF("/R5/PLUS"))) 10000000 ?histoDisplay nil ?noOfHistoBins 1) / (2 * pi * 10000000))

plot( Cap_diff ?expr '( "Cap_diff" ) )

Q_diff2_5G = value(abs((imag(((VF("/vcm1") - VF("/vcm2")) / (IF("/R4/PLUS") - IF("/R5/PLUS")))) / real(((VF("/vcm1") - VF("/vcm2")) / (IF("/R4/PLUS") - IF("/R5/PLUS")))))) 5e+09 ?histoDisplay nil ?noOfHistoBins 1)

plot( Q_diff2_5G ?expr '( "Q_diff2_5G" ) )

displayMode( "strip" ) ;display in strip mode

No comments: