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

busTransition

busTransition(
o_busWaveform
t_yFrom
t_yTo
[ n_nth ]
[ t_xName ]
)
=> t_nthTransition / t_nthLastTransition / t_allTransitions / nil

Description

Returns the time when a bus value is changed from a specified value to another specified value.

Arguments

o_busWaveform

Waveform object representing a bus.

t_yFrom

The starting bus value from which the bus is changed..

t_yTo

The target bus value to which the bus is changed.

n_nth

Specifies the nth transition.

  • n>0: The function returns x-axis value at which the nth time bus transition from t_yFrom to t_yTo occurs.
  • n<0: The function returns x-axis value at which the nth last time bus transition from t_yFrom to t_yTo occurs.
  • n=0: The function returns all x-axis values at which bus transitions from t_yFrom to t_yTo occur.

This is an optional argument.

If you do not specify this argument, default value n=0 is used.

t_xName

Specifies the x-axis units of the generated waveform when n=0.

Valid values are time and cycle. Default value is time.

This is an optional argument.

Value Returned

t_nthTransition

The x-axis value at which the nth time bus transition from t_yFrom to t_yTo occurs.

t_nthLastTransition

The x-axis value at which the nth last time bus transition from t_yFrom to t_yTo occurs.

t_allTransitions

All x-axis values at which bus transitions from t_yFrom to t_yTo occur.

nil

Either the specified bus does not exist or the specified transition never occurs in the bus.

Examples

The following example creates an empty Waveform window and returns its window ID.

awvCreatePlotWindow()
=> window:3

The following example creates a bus with x- and y-vector values.

xvec=drCreateVec('double '(1.1 2.2 3.3 4.4 5.5 6.6))
=> srrVec:0x31403020
yvec=drCreateVec('busVec '("11" "00" "11" "00" "11" "00"))
=> srrVec:0x31403030
myBus=drCreateWaveform(xvec yvec)
=> srrWave:0x31451020

The following example plots the waveform represented by waveform object myBus.

awvPlotWaveform(
    awvGetCurrentWindow()
    list(myBus)
    ?expr list("myBus")
    ?color list("y6")
    )
=> t

The following example returns the x-axis value at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) the third time.

busTransition(myBus "0b11" "0b00" 3)
=> 6.6

The following example returns the x-axis value at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) the second-last time.

busTransition(myBus "0b11" "0b00" -2)
=> 4.4

The following example returns all x-axis values at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) because n=0.

Note that the x-axis unit of the resulting waveform, which is stored in a variable allTransitions, is time.

allTransitions=busTransition(myBus "0b11" "0b00" 0 'time)
=> srrWave:0x31451030

The following example plots the waveform represented by allTransitions.

awvPlotWaveform(
    awvGetCurrentWindow()
    list(allTransitions)
    ?expr list("busTransitionTime")
    ?color list("y12")
    ?lineStyle list("dot")
    ?lineThickness list("thick")
    ?showSymbols list(t)
    ?dataSymbol list("x")
    )
=> t

The following example returns all x-axis values at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) because n=0.

Note that the x-axis unit of the resulting waveform, which is stored in a variable allTransitionsC, is cycle.

allTransitionsC=busTransition(myBus "0b11" "0b00" 0 'cycle)
=> srrWave:0x31451040

The following example plots the waveform represented by allTransitionsC.

awvPlotWaveform(
    awvGetCurrentWindow()
    list(allTransitionsC)
    ?expr list("busTransitionTime")
    ?color list("y12")
    ?lineStyle list("dot")
    ?lineThickness list("thick")
    ?showSymbols list(t)
    ?dataSymbol list("O")
    )
=> t


Return to top
 ⠀
X