Product Documentation
Virtuoso Visualization and Analysis XL SKILL Reference
Product Version IC23.1, November 2023

awvAnalog2Digital

awvAnalog2Digital(
o_waveform
n_vhi
n_vlo
n_vc
n_timeX
t_thresholdType
[ ?releaseMemory g_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

o_waveform

Analog input waveform.

n_vhi

High threshold value.

This argument is used only when t_thresholdType is hilo.

n_vlo

Low threshold value.

This argument is considered only when t_thresholdType is hilo.

n_vc

Central threshold value.

This argument is used only when t_thresholdType is center.

n_timeX

The minimum duration of analog signal between n_vhi and n_vlo. It is used to determine the logic X.

t_thresholdType

Type of logic threshold.

Valid values are:

  • hilo: Any value greater than n_vhi is a high state (1). Any value less than n_vlo is a low state (0), and the rest are treated as unknown based on the value of n_timeX.
  • center: Any value greater than n_vc is a high state (1). Any value less than n_vc is a low state (0).

?releaseMemory g_releaseMemory

Specifies whether to internally release the memory of the analog waveform after converting it into a digital waveform.

Valid values are:

  • t: Memory of the analog waveform is released after its conversion into a digital waveform.
  • nil: Memory of the analog waveform is not released even after its conversion into a digital waveform. This is the default value.

Value Returned

o_digWave

Waveform ID or a list of waveform IDs if the specified analog input is o_wave.

n_digValue

A scalar value if the specified analog input is o_val.

nil

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.

Name Expression

net1

VT("/net1")

expr1

awvAnalog2Digital(net1 nil nil 0.02 nil "center")

expr2

(awvAnalog2Digital(net1 nil nil 0.02 nil "center" ?releaseMemory t) + 2)

expr3

(awvAnalog2Digital(net1 nil nil 0.02 nil "center" ?releaseMemory t) + 3)

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
 ⠀
X