bag3_testbenches.measurement.data.tran

Transient simulation related data processing methods.

Module Contents

Classes

EdgeType

Support for flags

Functions

interp1d_no_nan(→ Callable[[Union[float, ...)

bits_to_pwl_iter(→ Iterable[Tuple[float, float, float, ...)

Convert discrete samples to PWL waveform.

get_first_crossings(, etype, rtol, atol, shape, ...)

Find the first time where waveform crosses a given threshold.

_get_first_crossings_time_1d(→ float)

_get_first_crossings_helper(→ float)

class bag3_testbenches.measurement.data.tran.EdgeType[source]

Bases: enum.Flag

Support for flags

property opposite: EdgeType[source]
RISE[source]
FALL[source]
CROSS[source]
bag3_testbenches.measurement.data.tran.interp1d_no_nan(tvec: numpy.ndarray, yvec: numpy.ndarray) Callable[[Union[float, numpy.ndarray]], numpy.ndarray][source]
bag3_testbenches.measurement.data.tran.bits_to_pwl_iter(values: Sequence[Any]) Iterable[Tuple[float, float, float, Any]][source]

Convert discrete samples to PWL waveform.

This method yields coefficients to td, tbit and trf, so user can generate symbolic PWL waveform files. Note that td must be positive.

Parameters:

values (List[float]) – list of values for each bit.

Yields:
  • td_scale (float) – coefficient for td

  • tbit_scale (float) – coefficient for tbit

  • trf (float) – coefficient for trf

  • val (Any) – the value

bag3_testbenches.measurement.data.tran.get_first_crossings(tvec: numpy.ndarray, yvec: numpy.ndarray, threshold: Union[float, numpy.ndarray], start: Union[float, numpy.ndarray] = 0, stop: Union[float, numpy.ndarray] = float('inf'), etype: EdgeType = EdgeType.CROSS, rtol: float = 1e-08, atol: float = 1e-22, shape: Optional[Tuple[int, Ellipsis]] = None) numpy.ndarray[source]

Find the first time where waveform crosses a given threshold.

tvec and yvec can be multi-dimensional, in which case the waveforms are stored in the last axis. The returned numpy array will have the same shape as yvec with the last axis removed. If the waveform never crosses the threshold, positive infinity will be returned.

bag3_testbenches.measurement.data.tran._get_first_crossings_time_1d(tvec: numpy.ndarray, yvec: numpy.ndarray, threshold: float, start: float, stop: float, etype: EdgeType, rtol: float, atol: float) float[source]
bag3_testbenches.measurement.data.tran._get_first_crossings_helper(tvec: numpy.ndarray, yvec: numpy.ndarray, threshold: float, idx0: int, arg: int) float[source]