awvDigital2Analog
awvDigital2Analog(o_waveform n_vHi n_vLo s_VX[?modes_mode] [?outWaveTypes_outWaveType] [?vprevSTARTs_vprevSTART] ) =>o_waveform/nil
Description
Returns the analog form of the specified digital waveform.
Arguments
Value Returned
Examples
The following example returns the waveform of the signal topLevel.net[0].
w1=v("topLevel.net[0]" ?result "tran" ?resultsDir "/servers/user/design/mixed_signal.raw")
=> srrWave:0x3603d1b0
The following example returns the waveform of the signal topLevel.net[1].
w2=v("topLevel.net[1]" ?result "tran" ?resultsDir "/servers/user/design/mixed_signal.raw")
=> srrWave:0x3603d1c0
The following example converts the analog waveform w1 to a digital waveform w3.
w3=awvAnalog2Digital(w1 1.8 0 nil 20n "hilo")
=> srrWave:0x3603d1e0
The following example converts the analog waveform w2 to a digital waveform w4.
w4=awvAnalog2Digital(w2 1.7 0 nil 20n "hilo")
=> srrWave:0x3603d1f0
The following example creates a bus busSignal from two digital signals w3 and w4.
busSignal=awvCreateBus("myBus" list(w3 w4) "Binary")
=> srrWave:0x3603d200
Returns the analog, zero transition wave representing the specified digital bus busSignal.
w5=awvDigital2Analog(busSignal 1.8 0 "vhi+vlo/2.0" ?mode "busvalue" ?outWaveType "zeroT")
=> srrWave:0x3603d210
Returns a list of analog waveforms.
waveList=awvDigital2Analog(busSignal 1.8 0 "vhi+vlo/2.0" ?mode "wavelist" ?outWaveType "pwl")
=> (srrWave:0x3603d230 srrWave:0x3603d240)
The following examples create waveform objects wave0, wave1, wave2, and wave3 with the specified x- and y-vector values.
list0=list(list(0.0 1e-06 1e-06 3e-06) list(0.0 0.0 5.0 5.0))
xvec=drCreateVec('double car(list0))
yvec=drCreateVec('double cadr(list0))
wave0=drCreateWaveform(xvec yvec)
drGetWaveformXVec(wave0)~>units="s"
drGetWaveformXVec(wave0)~>name="time"
=>
((0.0 1e-06 1e-06 3e-06)
(0.0 0.0 5.0 5.0)
)
=> srrVec:0x2d740020
=> srrVec:0x2d740030
=> srrWave:0x2d784020
=> "s"
=> "time"
list1=list(list(0.0 2e-06 2e-06 3e-06) list(0.0 0.0 5.0 5.0))
xvec=drCreateVec('double car(list1))
yvec=drCreateVec('double cadr(list1))
wave1=drCreateWaveform(xvec yvec)
drGetWaveformXVec(wave1)~>units = "s"
drGetWaveformXVec(wave1)~>name = "time"
=>
((0.0 2e-06 2e-06 3e-06)
(0.0 0.0 5.0 5.0)
)
=> srrVec:0x2d740060
=> srrVec:0x2d740070
=> srrWave:0x2d784030
=> "s"
=> "time"
list2=list(list(0.0 1e-06 1e-06 3e-06) list(5.0 5.0 0.0 0.0))
xvec=drCreateVec('double car(list2))
yvec=drCreateVec('double cadr(list2))
wave2=drCreateWaveform(xvec yvec)
drGetWaveformXVec(wave2)~>units="s"
drGetWaveformXVec(wave2)~>name="time"
=>
((0.0 1e-06 1e-06 3e-06)
(5.0 5.0 0.0 0.0)
)
=> srrVec:0x2d7400a0
=> srrVec:0x2d7400b0
=> srrWave:0x2d784040
=> "s"
=> "time"
list3=list(list(0.0 2e-06 2e-06 3e-06) list(5.0 5.0 0.0 0.0))
xvec=drCreateVec('double car(list3))
yvec=drCreateVec('double cadr(list3))
wave3=drCreateWaveform(xvec yvec)
drGetWaveformXVec(wave3)~>units="s"
drGetWaveformXVec(wave3)~>name="time"
=>
((0.0 2e-06 2e-06 3e-06)
(5.0 5.0 0.0 0.0)
)
=>srrVec:0x2d7400e0
=> srrVec:0x2d7400f0
=> srrWave:0x2d784050
=> "s"
=> "time"
The following example creates a Waveform window and returns its window ID.
win1=awvCreatePlotWindow()
=> window:3
awvPlotWaveform(
win1
list(wave3 wave2 wave1 wave0)
?expr list("bit3" "bit2" "bit1" "bit0")
?color list("y6" "y12" "y18" "y24")
?lineType list("line" "line" "line" "line")
?lineStyle list("solid" "solid" "solid" "solid")
?lineThickness list("thick" "thick" "thick" "thick")
?showSymbols list(t t t t)
?dataSymbol list(9 6 7 3)
)
=> t

The following examples create digital signals from the specified analog waveforms.
dig0=awvAnalog2Digital(wave0 nil nil 2.5 nil "centre")
dig1=awvAnalog2Digital(wave1 nil nil 2.5 nil "centre")
dig2=awvAnalog2Digital(wave2 nil nil 2.5 nil "centre")
dig3=awvAnalog2Digital(wave3 nil nil 2.5 nil "centre")
=> srrWave:0x2d784060
=> srrWave:0x2d784070
=> srrWave:0x2d784080
=> srrWave:0x2d784090
The following example creates a digital bus myBus from the specified list of digital signals dig0, dig1, dig2, and dig3.
myBus=awvCreateBus("myBus" list(dig0 dig1 dig2 dig3) "Binary")
=> srrWave:0x2d7840a0
The following example creates a Waveform window and returns its window ID.
win2=awvCreatePlotWindow()
=> window:4
The following example plots the bus myBus in the Waveform window win2.
awvPlotWaveform(
win2
list(myBus)
?expr list("myBus")
?color list("y18")
)
=> t
The following example converts myBus into a list of analog signals, each representing a single-bit digital waveform in the bus.
analogList=awvDigital2Analog(myBus 3.5 0.5 "vhi+vlo/2.0" ?mode "wavelist" ?outWaveType "pwl")
=>
(srrWave:0x2d7840b0 srrWave:0x2d7840c0 srrWave:0x2d7840d0 srrWave:0x2d7840e0)
The following example plots analog signals contained in the list analogList. in the current Waveform window.
n=0
for(
i 1 length(analogList)
plot(nth(n analogList))
++n
)

Return to top