7
Data Access Commands
The data access commands let you open results and select different types of results to analyze. You can get the names and values of signals and components in the selected results, and you can print different types of reports.
In this chapter, you can find information on the following data access commands
dataTypes
dataTypes(
)
=> l_dataTypes / nil
Description
Returns the list of data types that are used in an analysis previously specified with selectResult.
Arguments
Value Returned
|
Returns |
Example
selectResult( ’dcOpInfo )
dataTypes() => ("bjt" "capacitor" "isource" "mos2" "resistor" "vsource")
Returns the data types used in the selected file, in this case, dcOpInfo.
selectResult( ’model )
dataTypes() => ("bjt" "mos2")
Returns the data types used in the selected file, in this case, model.
deleteSubckt
deleteSubckt(
t_name
)
=> t / nil
Description
Deletes the specified subcircuit instance saved using the saveSubckt command.
Arguments
Value Returned
|
Returns |
||
Examples
The following example deletes the subcircuit instance I0.
deleteSubckt("/I0")
=> t
displaySubckt
displaySubckt(
t_args
t_outPort
)
=> t / nil
Description
Prints the subcircuit information to the output file.
Arguments
|
The name of the file to save the subcircuit information. If you do not specify the location with the filename, the file is saved in the current working directory. |
||
Value Returned
|
Returns |
||
|
Returns |
||
Examples
The following example prints the subcircuit information in the subckts.txt file:
fptr = outfile("/home/krajiv/subckts.txt")
=> port:"/home/krajiv/subckts.txt"
displaySubckt(nil fptr)
=> t
close(fptr)
=> t
getData
getData(t_name[?results_resultName[?resultsDirt_resultsDir] ]) =>x_number/o_waveform/ nil
Description
Returns the number or waveform for the signal name specified.
The type of value returned depends on how the command is used.
Arguments
Value Returned
Example
getData( "/net6" ) => srrWave:25178234
Returns the number or waveform for net6. In this example, the return value is equivalent tov( "/net6" ).
getData( "/V1" ?result ’ac )
=> srrWave:96879364
Returns the number or waveform for V1. In this example, the return value is equivalent to:i( "/V1" ?result ’ac ).
selectResult( ’tran ) =>
ocnPrint( getData( "net1" ) ) =>
The getData( "net1" ) command passes a waveform to the ocnPrint command. The ocnPrint command then prints the data for the waveform. In this example, the return value is equivalent to:(v( "net1" )).
ocnPrint( getData( "net1" ?result ’tran ?resultsDir "./simulation/testcell/spectre/schematic/psf")
Returns a signal on net1 for the tran result stored in the path "./simulation/testcell/spectre/schematic/psf".
getData command, you can use the type SKILL function. For scalar values, the type function returns the name of data type. For example, integer or flonum. For waveforms, it returns other.x=getData("/net10")
type(x)
The example given above returns other.
x=ymax(VT("/net10"))
type(x)
getResult
getResult ( [?results_resultName[?resultsDirt_resultsDir] ] ) =>o_results/ nil
Description
Gets the data object for a specified analysis without overriding the status of any previously executed selectResult() or openResults() commands.
Returns the data object for a particular analysis similar to the selectResult() function does. Unlike the selectResult() function, all subsequent data access commands will not internally use this information.
Arguments
Value Returned
|
Returns |
Example
getResult( ?result ’tran )
i
i(t_component[?results_resultName[?resultsDirt_resultsDir] ]) => o_waveform/ nil
Description
Returns the current through the specified component.
Arguments
Value Returned
|
Returns a waveform object. A waveform object represents simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: |
|
Example
selectResult( ’tran )
i( "/R1" )
Returns the current through the R1 component.
ocnPrint( i( "/R1" ) )
Prints the current through the R1 component.
ocnPrint( i( "/R1" ?result ’dc ) )
Prints the current through the R1 component with respect to the dc swept component.
ocnPrint( i( "/R1" ?resultsDir "./test2/psf" ?result ’dc ) )
Prints the current through the R1 component with respect to dc for the results from a different run (stored in test2/psf).
ocnHelp
ocnHelp( [?outputt_filename|p_port] [s_command] ) => t / nil
Description
Provides online help for the specified command.
If no command is specified, provides information about how to use help and provides the different categories of information contained in the help library. If you provide a filename as the ?output argument, the ocnHelp command opens the file and writes the information to it. If you provide a port (the return value of the SKILL outfile command), the ocnHelp command appends the information to the file that is represented by the port. If you do not specify ?output, the output goes to standard out (stdout).
Arguments
|
File in which to write the information. The |
|
|
Port (previously opened with |
|
Value Returned
|
Returns |
Example
ocnHelp()
=> t
Displays information about using online help.
ocnHelp( ’analysis )
=> t
Displays help for the analysis command.
ocnHelp( ?output"helpInfo")t
=>
Writes information about using online help to a file named helpInfo.
simulator('spectre)
ocnHelp('envOptions)
Displays a list of environment options that can be set for a simulator. First, set the simulator and then run the ocnHelp command.
ocnResetResults
ocnResetResults( ) => t
Description
Unsets the results opened by the openResults command. Use this command to return to the state that existed prior to using the openResults command.
Arguments
Value Returned
Example
|
|
|
|
|
Resets the results opened by |
openResults
openResults(s_jobName|t_dirName[g_enableCalcExpressions] ) =>t_dirName/ nil
Description
Opens simulation results stored in PSF files or opens the results from a specified job, depending on which parameter is called.
When openResults passes a symbol, it interprets the value as a job name and opens the results for the specified job. s_jobName is a job name and is defined when a run command is issued.
When openResults passes a text string, it opens simulation results stored in PSF files in the specified directory. The results must have been created by a previous simulation run through OCEAN or the Virtuoso® Analog Design Environment. The directory must contain a file called logFile and might contain a file called runObjFile. When you perform tasks in the design environment, the runObjFile is created. Otherwise, only logFile is created.
If you want to find out which results are currently open, you can use openResults with no argument. The directory for the results that are currently open is returned.
Note: If you run a successful simulation with distributed processing disabled, the results are automatically opened for you. Also, a job name is generated by every analysis, even if distributed processing is not enabled.
Arguments
Value Returned
|
Returns |
Example
openResults( "./simulation/opamp/spectre/schematic/psf" )
=> "./simulation/opamp/spectre/schematic/psf"
Opens the results in the psf directory within the specified path.
openResults( "./psf" )
=> psf
Opens the results in the psf directory in the current working directory.
openResults( "./psf" t )
=> psf
Opens the results in the psf directory in the current working directory. It also allows the evaluation of the Calculator expression.
outputParams
outputParams(t_compType[?results_resultName[?resultsDirt_resultsDir] ]) =>l_outputParams/ nil
Description
Returns the list of output parameters for the specified component.
You can use the dataTypes command to get the list of components for a particular set of results.
Arguments
Value Returned
|
Returns |
Example
selectResult( ’dcOpInfo )dataTypes()=> ("bjt" "capacitor" "isource" "mos2" "resistor" "vsource")outputParams( "bjt" )
Selects the dcOpInfo results, returns the list of components for these results, and returns the list of output parameters for the bjt component.
outputParams("bjt" ?result ’dcOpInfo ?resultsDir "/VADE615/simulation/ampTest/spectre/schematic/psf")
Returns a list of output parameters for the bjt component for dcOpInfo (dc analysis with save dc operating point) results stored at the location ./psf.
outputs
outputs( [?results_resultName[?resultsDirt_resultsDir] ][?typet_signalType] ) =>l_outputs/ nil
Description
Returns the names of the outputs whose results are stored for an analysis. You can plot these outputs or use them in calculations.
Arguments
Value Returned
|
Returns |
Example
outputs()
=> ( "net13" "net16" "net18" )
Returns the names of the outputs for the PSF file selected with selectResult.
outputs( ?type "V" )
Returns all the signal names that are node voltages. The dataType (signal ) returns the data type of the signal.
outputs(?result "tran" ?resultsDir "./psf")
=> ( "net11" "net15" "net17")
Returns the names of the outputs for the tran results stored at the location ./psf.
phaseNoise
phaseNoise(g_harmonicS_signalResultName[?results_noiseResultName[?resultsDirt_resultsDir] ] ) =>o_waveform/ nil
Description
Returns the phase noise waveform which is calculated using information from two PSF data files.
This command should be run on the results of the Spectre pss-pnoise analysis.
Arguments
Value Returned
Example
plot(phaseNoise(0 "pss-fd.pss"))
phaseNoise(1 "pss_fd" ?result "pnoise" ?resultsDir “./PSF")
pv
pv(t_name t_param[?results_resultName[?resultsDirt_resultsDir] ]) =>g_value/ nil
Description
Returns the value of the specified component parameter. You can use the outputParams command to get the list of parameters for a particular component.
Arguments
Value Returned
Example
selectResult( ’dcOpInfo )
pv( "/I0/M1" "vds" )
Returns the value of the vds parameter for the I0/M1 component.
pv( "/I0/M1" "vds" ?resultsDir "/VADE/simulation/ampTest/spectre/schematic/test2/psf" )
Returns the value of the vds parameter for the I0/M1 component. These values are read from the results directory, /VADE/simulation/ampTest/spectre/schematic/test2/psf.
pv( "/I0/M1" "vds" ?result "dcOpInfo" ?resultDir "/VADE/simulation/ampTest/spectre/schematic/test1/psf")
Returns the value of the vds parameter for the I0/M1 component. These values are read from the dcOpInfo results saved in the results directory, /VADE/simulation/ampTest/spectre/schematic/test1/psf.
pv("top-level" "CAP" ?result "designParamVals")
Returns the value of the CAP variable for the top-level hierarchy in the design. These values are read from the default results directory.
resultParam
resultParam( S_propertyName [?results_resultName [?resultsDirt_resultsDir ] ] ) => L_value / nil
Description
Returns the value of a header property from the selected result data.
Arguments
Value Returned
|
Value of the parameter. The data type depends on the data type of the parameter. |
|
|
Returns |
Example
resultParam("positive output signal" ?result "pnoise.pss")
=> "pif"
resultParam("negative output signal" ?result "pnoise.pss")
=> "0"
Returns the name of the positive and negative output signals from PSS-noise analysis result. In this case, the data type of the returned value is a string.
resultParam("port1.r.value" ?result "sp")
=> 40.0
resultParam("port2.r.value" ?result "sp")
=> 40.0
Returns the reference impedance of the ports in a two-port network from the S-parameter analysis result. In this case, the data type of the returned value is a floating point number.
resultParam("positive output signal" ?result "pnoise.pss" ?resultsDir "./psf")
=> "0"
Returns the names of the positive output signals from the PSS-noise analysis results stored at the location ./psf.
results
results( [?resultsDirt_resultsDir] ) =>l_results/ nil
Description
Returns a list of the type of results that can be selected.
Arguments
Value Returned
|
Returns |
Example
results()
=> ( dc tran ac )
Returns the list of results available.
results( ?resultsDir "./psf" )
Returns a list of results stored at the location ./psf.
saveSubckt
saveSubckt(t_name[ ?voltageg_voltage] [ ?currentg_current] [ ?powerg_power] [ ?vDepths_vDepth] [ ?iDepths_iDepth] [ ?pwrDepths_pwrDepth] [ ?compressg_compress] [ ?filterRCg_filterRC] [ ?portsg_ports] [ ?userOptionsg_userOptions] ) => t / nil
Description
Saves and modifies the specified subcircuit instances and signals.
Arguments
Value Returned
|
Returns |
||
Examples
Example 1
The following example saves the voltage for five levels and current for two levels of hierarchy for the subcircuit I0.
saveSubckt("/I0" ?voltage t ?current t ?vDepth "5" ?iDepth "2")
=> t
Example 2
The following example saves the voltage for two levels and power signals for one level of hierarchy for the subcircuit I1.
saveSubckt("/I1" ?voltage t ?power t ?vDepth "2" ?pwrDepth "1")
=> t
Example 3
The following example saves the voltage for two levels and power signals for one level of hierarchy for the subcircuit I1, along with the port information. The output signals are compressed.
saveSubckt("/I1" ?voltage t ?power t ?vDepth "2" ?pwrDepth "1" ?port t ?compress t)
=> t
selectResult
selectResult(S_resultsName[n_sweepValue] ) =>o_results/ nil
Description
Selects the results from a particular analysis whose data you want to examine.
The argument that you supply to this command is a data type representing the particular type of analysis results you want. All subsequent data access commands use the information specified with selectResult.
Arguments
Value Returned
|
Returns |
Example
selectResult( ’tran )
Selects the results for a transient analysis.
sweepValues(3.0 3.333333 3.666667 4.0 4.333333 4.666667 5.0 )
selectResult("tran" "3.333333")
The sweepValues command prints a list of sweep values.
The selectResult command selects a specific value for a transient analysis.
selectResult( ’tran )
Selects the results for a transient analysis.
paramAnalysis("supply" ?start 3 ?stop 5 ?step 1.0/3)
paramRun("supply")
selectResult(( ’tran car( sweepValues() )
Selects the data corresponding to the first parametric run.
sp
sp( x_iIndex x_jIndex [?results_resultName [?resultsDirt_resultsDir ] ] ) => o_waveform / nil
Description
Returns S-parameters for N port networks.
This command should be run on the results of the Spectre sp (S-parameter) analysis.
Arguments
Value Returned
Example
selectResult('sp)
s21 = sp(2 1)
s12 = sp(1 2)
plot(s21 s12)
;Plots S-parameters s21 and s12 for results of S-parameter(sp) analysis stored in
the psf of the last run simulation
For an output expression in a maestro cellview:
sp(1 1 ?result 'sp )
;Returns the S-parameter for results of S-parameter(sp) analysis stored in the
results for each point
sprobeData
sprobeData(t_anat_sprobeInst[?typet_type] [?dataDirt_dataDir] ) =>o_waveform/ nil
Description
Returns the waveform for the specified analysis and parameter type of the given sprobe instance.
|
Directory containing the PSF file. By default, it uses the current results directory that is set by the |
Value Returned
|
Waveform object that displays a series of points on a grid. srrWave:XXXXX is used as the waveform object identifier. |
|
|
Returns |
Example
The following example gets the waveform of parameter S1 of sprobe instance "I0"
sprobeData('sp_sprobe "I0" ?type "S1")
The following example gets the waveform of parameter StabIndex of sprobe instance "I0"
sprobeData('sp_sprobe\-StabIndex "I0" ?type "StabIndex")
sweepNames
sweepNames( [o_waveForm ][?results_resultName [?resultsDirt_resultsDir ] ] ) =>l_sweepName/ nil
Description
Returns the names of all the sweep variables for either a supplied waveform, a currently selected result (via selectResult()) or a specified result.
Arguments
Value Returned
|
Returns |
Example
selectResult(’tran)
sweepNames()
=> ( "TEMPDC" "time" )
Returns a list of sweep variables for the selected results. In this case, the return values indicate that the data was swept over temperature and time.
sweepNames(?result ’ac)
=> ("TEMPDC" "freq")
sweepNames()
=> ("TEMPDC" "time")
w = VT("/vout")
sweepNames( w )
=> ( "r" "time")
Returns the sweep variables for the waveform w.
sweepNames(?result ’ac ?resultsDir "./test/psf")
=> ("TEMPDC" "freq")
Returns the sweep variables for the results of the ac analysis stored at the location ./test/psf.
sweepValues
sweepValues( [o_waveForm] ) =>l_sweepValues/ nil
Description
Returns the list of sweep values of the outermost sweep variable of either the selected results or the supplied waveform. This command is particularly useful for parametric analyses.
Arguments
|
Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: |
Value Returned
|
Returns |
Example
sweepValues()
=> ( -50 -15 20 55 90.0 )
Returns a list of sweep values for the selected results. In this case, the return values indicate the temperature over which the data was swept.
w = VT("/vout")
sweepNames( w )
=> ( "r" "time" )
sweepValues( w )
=> ( 2000 4000 6000 )
Returns a list of sweep values for the wave w. In this case, the return values indicate the resistance over which the data was swept.
sweepVarValues
sweepVarValues( [t_varName] [?results_resultName[?resultsDirt_resultsDir] ] ) =>l_sweepName/ nil
Description
Returns the list of sweep values for a particular swept variable name. This command is particularly useful for parametric analyses.
Arguments
Value Returned
|
Returns nil and an error message if the list of sweep values cannot be returned. |
Example
selectResult(’tran)
sweepNames()
=> ("TEMPDC" "Vsupply" "time")
sweepVarValues("TEMPDC")
=> (0 32)
sweepNames(?result ’ac)
=> ("TEMPDC" "Vsupply" "freq")
sweepVarValues("Vsupply" ?result ’ac)
=> (5 12 15)
sweepNames(?result ’ac ?resultsDir "./simResult/psf")
=> ("TEMPDC" "freq")
sweepVarValues("TEMPDC" ?result ’ac ?resultsDir "./simResult/psf")
=> (-15 20 55)
v
v(t_net[?results_resultName[?resultsDirt_resultsDir ] ]) =>o_waveform/ nil
Description
Returns the voltage of the specified net.
Arguments
Value Returned
|
Returns a waveform object. A waveform object represents simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: |
|
Example
selectResult(’tran)
v( "/net56" )
Returns the voltage for net56.
ocnPrint( v( "/net56" ) )
Prints tabular information representing the voltage for net56.
ocnPrint( v( "net5" ?result ’dc ) )
Prints the voltage of net5 with respect to the dc swept component.
ocnPrint( v( "net5" ?resultsDir "./test2/psf" ?result ’dc ) )
Prints the voltage of net5 with respect to dc for the results from a different run (stored in test2/psf).
vswr
vswr( x_index [?results_resultName [?resultsDirt_resultsDir ] ] ) => o_waveform / nil
Description
Computes the voltage standing wave ratio.
This function is a higher level wrapper for the OCEAN expression
(1 + mag( s( x_index x_index ))) / (1 - mag( s( x_index x_index )))
This command should be run on the results of the Spectre sp (S-parameter) analysis.
Arguments
Value Returned
|
Waveform object representing the voltage standing wave ratio. |
|
Example
plot( vswr(2) )
vswr1 = vswr(1 ?result "sp" ?resultsDir "./simResult/psf")
Returns the voltage standing wave ratio value at port 1 for the results of S-parameter(sp) analysis stored at the location ./simResult/psf.
zm
zm( x_index [?results_resultName [?resultsDirt_resultsDir ] ] ) => o_waveform / nil
Description
Computes the port input impedance.
The zm function is computed in terms of the S-parameters and the reference impedance. This function is a higher level wrapper for the OCEAN expression
(1 + s( x_index x_index )) / (1 - s( x_index x_index ))
* or( zref( x_index ) 50)
This command should be run on the results of the Spectre sp (S-parameter) analysis.
Arguments
Value Returned
Example
plot(zm(2))
zm1 = zm(1 ?result "sp" ?resultsDir "./simResult/psf")
Returns input impedance at port 1 for results of S-parameter (sp) analysis stored at the location ./simResult/psf.
zref
zref( x_portIndex [?results_resultName [?resultsDirt_resultsDir ] ] ) =>f_impedance/ nil
Description
Returns the reference impedance for an N-port network.
This command should be run on the results of the Spectre sp (S-parameter) analysis.
Arguments
Value Returned
Example
Zref = zref(2)
zref1 = zref(1 ?result "sp" ?resultsDir "./simResult/psf")
Returns the reference impedance at port 1 for the results of S-parameter(sp) analysis stored at the location./simResult/psf.
Return to top