bag3_testbenches.measurement.digital.flop.base

Module Contents

Classes

FlopInputMode

Generic enumeration.

FlopMeasFlag

Support for flags

FlopMeasMode

FlopTimingBase

Base class of all flop timing TestbenchManagers.

class bag3_testbenches.measurement.digital.flop.base.FlopInputMode[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

IN = 0[source]
SI = 1[source]
SE = 2[source]
RECOVERY = 3[source]
REMOVAL = 4[source]
class bag3_testbenches.measurement.digital.flop.base.FlopMeasFlag[source]

Bases: enum.Flag

Support for flags

property name: str[source]

The name of the Enum member.

IN_RISING[source]
SETUP_RISING[source]
HOLD_RISING[source]
MEAS_SETUP[source]
classmethod from_str(val: str) FlopMeasFlag[source]
class bag3_testbenches.measurement.digital.flop.base.FlopMeasMode(in_mode: Union[str, FlopInputMode] = FlopInputMode.IN, in_rising: bool = True, setup_rising: bool = True, hold_rising: bool = True, meas_setup: bool = True)[source]
property input_mode_name: str[source]
property name: str[source]
property is_input: bool[source]
property is_scan_in: bool[source]
property is_scan_en: bool[source]
property is_recovery: bool[source]
property is_removal: bool[source]
property is_reset: bool[source]
property input_rising: bool[source]
property is_pos_edge_clk: bool[source]
property hold_opposite_clk: bool[source]
property meas_setup: bool[source]
property opposite_clk: FlopMeasMode[source]
classmethod from_str(val: str) FlopMeasMode[source]
classmethod from_dict(val: Mapping[str, Any]) FlopMeasMode[source]
get_out_edge(rst_to_high: bool, out_invert: bool) bag3_testbenches.measurement.data.tran.EdgeType[source]
class bag3_testbenches.measurement.digital.flop.base.FlopTimingBase(*args: Any, **kwargs: Any)[source]

Bases: bag3_testbenches.measurement.tran.digital.DigitalTranTB, abc.ABC

Base class of all flop timing TestbenchManagers.

Notes

specification dictionary has the following entries in addition to the default ones:

flop_paramsMapping[str, Any]

Dictionary describing the flop data structure.

meas_modeUnion[str, FlopMeasMode]

the measurement mode.

sim_env_namestr

Use to query for sim_env dependent timing offset.

sim_paramsMapping[str, float]

Required entries are listed below.

t_rst :

the duration of reset signals.

t_rst_rf :

the reset signals rise/fall time, measured from thres_lo to thres_hi.

t_clk_per :

the clock period.

t_clk_rf :

the clock rise/fall time, measured from thres_lo to thres_hi.

t_clk_delay :

the clock delay, measured from end of reset period to 50% point.

t_rf :

the input rise/fall time, measured from thres_lo to thres_hi.

t_recovery_<reset> :

the recovery time. Only defined during recovery simulation.

t_removal_<reset> :

the removal time. Only defined during removal simulation.

c_load :

the load capacitance parameter.

Furthermore, setup time for each input pin will have the variable t_setup_<pin>_<index>. For example, pin “foo<2>” has the variable “t_setup_foo_2”, and pin “bar” has the variable “t_setup_bar_”. The same naming scheme applies to hold time.

pwr_domainMapping[str, Tuple[str, str]]

Dictionary from individual pin names or base names to (ground, power) pin name tuple.

sup_valuesMapping[str, Union[float, Mapping[str, float]]]

Dictionary from supply pin name to voltage values.

dut_pinsSequence[str]

list of DUT pins.

pin_valuesMapping[str, int]

Dictionary from bus pin or scalar pin to the bit value as binary integer.

reset_listSequence[Tuple[str, bool]]

Optional. List of reset pin name and reset type tuples. Reset type is True for active-high, False for active-low. Does not include flop reset pins.

diff_listSequence[Tuple[Sequence[str], Sequence[str]]]

Optional. List of groups of differential pins.

rtolfloat

Optional. Relative tolerance for equality checking in timing measurement.

atolfloat

Optional. Absolute tolerance for equality checking in timing measurement.

thres_lofloat

Optional. Low threshold value for rise/fall time calculation. Defaults to 0.1

thres_hifloat

Optional. High threshold value for rise/fall time calculation. Defaults to 0.9

abstract property num_cycles: int[source]
abstract property c_load_pins: Iterable[str][source]
property t_clk_expr: str[source]
property t_start_expr: str[source]
property meas_mode: FlopMeasMode[source]
property flop_params: Dict[str, Any][source]
property timing_variables: Sequence[str][source]
commit() None[source]

Commit changes to specs dictionary. Perform necessary initialization.

abstract classmethod get_default_flop_params() Dict[str, Any][source]
abstract classmethod get_meas_modes(flop_params: Mapping[str, Any]) Sequence[FlopMeasMode][source]
abstract classmethod get_output_meas_modes(flop_params: Mapping[str, Any]) Sequence[FlopMeasMode][source]
classmethod get_clk_pulse(clk_pin: str, clk_rising: bool) Mapping[str, Any][source]
classmethod get_input_pulse(pin: str, var_setup: str, var_hold: str, pos: bool, cycle_idx: int = 1, hold_opposite: bool = False) Mapping[str, Any][source]
abstract get_stimuli() Tuple[Sequence[Mapping[str, Any]], Dict[str, int], Set[str], Sequence[str]][source]
abstract get_output_map(output_timing: bool) Mapping[str, Tuple[Mapping[str, Any], Sequence[Tuple[bag3_testbenches.measurement.data.tran.EdgeType, Sequence[str]]]]][source]
get_timing_type(non_seq: bool) bag3_liberty.enum.TimingType[source]
get_timing_info(meas_mode: FlopMeasMode, in_pins: Sequence[str], clk_pin: str, cond_str: str, rst_active_high: bool, inc_delay: bool = True, non_seq: bool = False, offset: Union[float, Mapping[str, float]] = 0) Mapping[str, Any][source]
get_t_clk(data: bag.simulation.data.SimData) numpy.ndarray[source]
get_t_start(data: bag.simulation.data.SimData) numpy.ndarray[source]
get_rst_pulse(rst_pin: str, rst_active_high: bool, var_name: str = '', is_recovery: bool = False) Mapping[str, Any][source]
pre_setup(sch_params: Optional[Mapping[str, Any]]) Optional[Mapping[str, Any]][source]

Set up PWL waveform files.

print_results(data: bag.simulation.data.SimData) None[source]

Override to print results.

calc_clk_to_q(data: bag.simulation.data.SimData, out_name: str, out_edge: bag3_testbenches.measurement.data.tran.EdgeType) numpy.ndarray[source]

Get clk-to-q- delay.

Currently assumes clock parameters and voltage parameters are not swept.

Parameters:
  • data (SimData) – the simulation result data structure.

  • out_name (str) – the output pin name.

  • out_edge (EdgeType) – the output edge type.

Returns:

ans – the clk-to-q delay.

Return type:

np.ndarray

calc_out_trf(data: bag.simulation.data.SimData, out_name: str, out_edge: bag3_testbenches.measurement.data.tran.EdgeType) numpy.ndarray[source]

Get output rise/fall time.

Parameters:
  • data (SimData) – the simulation result data structure.

  • out_name (str) – the output pin name.

  • out_edge (EdgeType) – the output edge type.

Returns:

ans – the output rise/fall time.

Return type:

np.ndarray