bag3_testbenches.measurement.base

Module Contents

Classes

GenericTB

This class provide utility methods useful for all simulations.

class bag3_testbenches.measurement.base.GenericTB(*args: Any, **kwargs: Any)[source]

Bases: bag.simulation.core.TestbenchManager, abc.ABC

This class provide utility methods useful for all simulations.

Notes

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

sim_params : Mapping[str, float]

subclasses can define the following optional entries:

save_outputsSequence[str]

Optional. list of nets to save in simulation data file.

dut_pinsSequence[str]

list of DUT pins.

src_listSequence[Mapping[str, Any]]

list of DC sources.

load_listSequence[Mapping[str, Any]]

Optional. List of loads. Each dictionary has the following entries:

pin: str

Optional, the pin to connect to.

nin: str

Optional, the negative pin to connect to.

conns: Mapping[str, str]

Optional, the connection dictionary. Either specify pin (and nin), or specify conns.

typestr

the load device type.

valueUnion[float, str]

the load parameter value.

harnesses_listOptional[Sequence[Mapping[str, Any]]]

list of harnesses used in the TB with harness_idx and conns.

  • harness_idx: int

    the index of the harness cell_name from harnesses_cell

    conns: Sequence[Tuple[str, str]]

    harness connections

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.

pin_valuesMapping[str, Union[int, str]]

Dictionary from bus pin or scalar pin to the bit value as binary integer, or a pin name to short pins to nets.

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

Optional. List of groups of differential pins.

skip_srcbool

Defaults to True. If True, ignore multiple stimuli on same pin (only use the first stimuli).

property save_outputs: Sequence[str][source]
commit() None[source]

Commit changes to specs dictionary. Perform necessary initialization.

classmethod get_schematic_class() Type[bag.design.module.Module][source]
classmethod sup_var_name(sup_pin: str) str[source]
classmethod sup_src_name(sup_pin: str) str[source]
get_bias_sources(sup_values: Mapping[str, Union[float, Mapping[str, float]]], src_list: List[Mapping[str, Any]], src_pins: Set[str]) None[source]

Save bias sources and pins into src_list and src_pins.

Side effect: will add voltage variables in self.sim_params.

classmethod get_pin_supplies(pin_name: str, pwr_domain: Mapping[str, Tuple[str, str]]) Tuple[str, str][source]
classmethod get_diff_lookup(diff_list: Sequence[Tuple[Sequence[str], Sequence[str]]]) Mapping[str, Tuple[Sequence[str], Sequence[str]]][source]
classmethod get_r_src_pin(in_pin: str) str[source]
classmethod get_r_src_pin_base(pin_name: str) str[source]
pre_setup(sch_params: Optional[Mapping[str, Any]]) Optional[Mapping[str, Any]][source]

Override to perform any operations prior to calling the setup() function.

Parameters:

sch_params – the testbench schematic parameters. None means the previous testbench will be reused. This dictionary should not be modified.

Returns:

the schematic parameters to use. Could be a modified copy of the original.

Return type:

new_params

get_dut_conns(dut_pins: Iterable[str], src_pins: Set[str]) Mapping[str, str][source]
get_loads(load_list: Iterable[Mapping[str, Any]], src_load_list: List[Mapping[str, Any]]) None[source]
get_pin_supply_values(pin_name: str, data: bag.simulation.data.SimData) Tuple[numpy.ndarray, numpy.ndarray][source]
get_diff_groups(pin_name: str) Tuple[Sequence[str], Sequence[str]][source]
_get_pin_bit_values(pin_values: Mapping[str, Union[int, str]]) Mapping[str, Union[int, str]][source]