awvAnalog2Digital
awvAnalog2Digital(o_waveform n_vhi n_vlo n_vc n_timeX t_thresholdType[?releaseMemoryg_releaseMemory] =>o_digWave/n_digValue/nil
Description
Returns the digital form of the analog input, which can be a waveform, a list or family of waveforms, or a string representation of expressions.
Arguments
Value Returned
|
Waveform ID or a list of waveform IDs if the specified analog input is o_wave. |
|
|
Analog input cannot be converted into digital output because of an error. |
Examples
The following example creates a Waveform window and returns its window ID.
win=awvCreatePlotWindow()
=> window:3
The following example opens simulation results stored in the specified results directory.
openResults("./simulation/lib/cell/maestro/results/maestro/ExplorerRun.0/1/myTest/psf")
=> "./simulation/lib/cell/maestro/results/maestro/ExplorerRun.0/1/myTest/psf"
The following example lists the results available in the currently open results directory.
results()
=>
tran(tranOp model instance output designParamVals
primitives subckts variables
)
The following example selects the result tran.
selectResults('tran)
=> stdobj@0x2f5da0c8
The following example lists the outputs available in the selected result.
outputs()
=> ("/net1" "/net2")
The following example creates a waveform object net1, representing the waveform of the analog signal net1.
net1=v("net1")
=> srrWave:0x3548f020
The following examples create two waveform objects, dig1 and dig2 that are generated after converting the analog signal net1 into digital signals.
dig1=awvAnalog2Digital(net1 nil nil 20m nil "center")
=> srrWave:0x3548f030
dig2=awvAnalog2Digital(net1 -60m 60m nil 500n "hilo")
=> srrWave:0x3548f040
The following example plots the analog signal net1 and digital signals dig1 and dig2 in the current Waveform window.
awvPlotWaveform(
win
list(net1 dig1 dig2)
?expr list("analogSignal" "digitalSignal1" "digitalSignal2")
?color list("y12" "y6" "y18")
?lineType list("line" "line" "line")
?lineStyle list("solid" "solid" "solid")
?lineThickness list("thick" "thick" "thick")
)
=> t

Evaluation Error when Using the releaseMemory Argument
Consider an example where you have following expressions in the Outputs Setup tab of ADE Assembler.

When you run simulation, all expressions are evaluated successfully, except the expression expr3. This expression reports an evaluation error (eval err), as shown in the following figure.

The first expression net1 returns the transient waveform for the specified net net1. The analog waveform net1 is stored in the cache and used further in evaluating expressions expr1, expr2, and expr3.
After evaluating the expression expr2, memory of the analog waveform net1 is released because the argument ?releaseMemory is set to t. Therefore, when the expression expr3 is evaluated, an evaluation error (eval err) occurs.
To resolve this error, you can either set the ?releaseMemory argument to nil or use VT("/net1") instead of net1 in these expressions:
(awvAnalog2Digital(net1 nil nil 0.02 nil "center" ?releaseMemory nil) + 2)
(awvAnalog2Digital(net1 nil nil 0.02 nil "center" ?releaseMemory t) + 3)
(awvAnalog2Digital(VT("/net1") nil nil 0.02 nil "center" ?releaseMemory t) + 4)
(awvAnalog2Digital(VT("/net1") nil nil 0.02 nil "center" ?releaseMemory t) + 5)
The following figures shows these expressions specified in the Outputs Setup tab of ADE Assembler.

The following figure shows that the specified expressions are successfully evaluated and their outputs are displayed in the Results tab of ADE Assembler.

Return to top