bag.simulation.data

This module handles high level simulation routines.

This module defines SimAccess, which provides methods to run simulations and retrieve results.

Module Contents

Classes

SweepSpecType

Generic enumeration.

SweepInfoType

Generic enumeration.

SweepList

SweepLinear

stop is inclusive

SweepLog

stop is inclusive

MDSweepInfo

SetSweepInfo

AnalysisType

Generic enumeration.

SPType

Generic enumeration.

AnalysisSweep1D

AnalysisDC

AnalysisAC

AnalysisSP

AnalysisNoise

AnalysisTran

AnalysisPSS

AnalysisPAC

AnalysisPNoise

JitterEvent

MonteCarlo

SimNetlistInfo

AnalysisData

A data struct that stores simulation data from a single analysis

SimData

A data structure that stores simulation data as a multi-dimensional array.

Functions

swp_spec_from_dict(→ SweepSpec)

swp_info_from_struct(→ SweepInfo)

analysis_from_dict(→ AnalysisInfo)

monte_carlo_from_dict(→ Optional[MonteCarlo])

netlist_info_from_dict(→ SimNetlistInfo)

_check_is_md(→ Tuple[Optional[Tuple[int, Ellipsis]], ...)

combine_ana_sim_envs(→ AnalysisData)

Combine multiple single-corner analysis data to a single multi-corner analysis data.

Attributes

SweepSpec

SweepInfo

T

AnalysisInfo

class bag.simulation.data.SweepSpecType[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

LIST = 0[source]
LINEAR = 1[source]
LOG = 2[source]
class bag.simulation.data.SweepInfoType[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

MD = 0[source]
SET = 1[source]
class bag.simulation.data.SweepList[source]
property start: float[source]
values: bag.util.immutable.ImmutableList[float][source]
__len__() int[source]
class bag.simulation.data.SweepLinear[source]

stop is inclusive

property step: float[source]
property stop_inc: float[source]
property values: numpy.ndarray[source]
start: float[source]
stop: float[source]
num: int[source]
endpoint: bool = True[source]
__len__() int[source]
class bag.simulation.data.SweepLog[source]

stop is inclusive

property start_log: float[source]
property stop_log: float[source]
property step_log: float[source]
property stop_inc: float[source]
start: float[source]
stop: float[source]
num: int[source]
endpoint: bool = True[source]
__len__() int[source]
bag.simulation.data.SweepSpec[source]
bag.simulation.data.swp_spec_from_dict(table: Mapping[str, Any]) SweepSpec[source]
class bag.simulation.data.MDSweepInfo[source]
property ndim: int[source]
property stype: SweepInfoType[source]
property shape: Tuple[int, Ellipsis][source]
params: bag.util.immutable.ImmutableList[Tuple[str, SweepSpec]][source]
__contains__(item: str) bool[source]
__iter__() Iterable[str][source]
default_items() Iterable[Tuple[str, float]][source]
class bag.simulation.data.SetSweepInfo[source]
property stype: SweepInfoType[source]
property shape: Tuple[int, Ellipsis][source]
params: bag.util.immutable.ImmutableList[str][source]
values: bag.util.immutable.ImmutableList[bag.util.immutable.ImmutableList[float]][source]
__contains__(item: str) bool[source]
__iter__() Iterable[str][source]
default_items() Iterable[Tuple[str, float]][source]
bag.simulation.data.SweepInfo[source]
bag.simulation.data.swp_info_from_struct(table: Union[Sequence[Tuple[str, Mapping[str, Any]]], Mapping[str, Any]]) SweepInfo[source]
class bag.simulation.data.AnalysisType[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

DC = 0[source]
AC = 1[source]
TRAN = 2[source]
SP = 3[source]
NOISE = 4[source]
PSS = 5[source]
PAC = 6[source]
PNOISE = 7[source]
class bag.simulation.data.SPType[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

S = 0[source]
Y = 1[source]
Z = 2[source]
YZ = 3[source]
bag.simulation.data.T[source]
class bag.simulation.data.AnalysisSweep1D[source]
property param_start: float[source]
param: str[source]
sweep: Optional[SweepSpec][source]
options: bag.util.immutable.ImmutableSortedDict[str, str][source]
save_outputs: bag.util.immutable.ImmutableList[str][source]
classmethod from_dict(table: Dict[str, Any], def_param: str = '') T[source]
class bag.simulation.data.AnalysisDC[source]

Bases: AnalysisSweep1D

property name: str[source]
class bag.simulation.data.AnalysisAC[source]

Bases: AnalysisSweep1D

property name: str[source]
freq: float[source]
classmethod from_dict(table: Dict[str, Any], def_param: str = '') T[source]
class bag.simulation.data.AnalysisSP[source]

Bases: AnalysisAC

property name: str[source]
ports: bag.util.immutable.ImmutableList[str][source]
param_type: SPType[source]
class bag.simulation.data.AnalysisNoise[source]

Bases: AnalysisAC

property name: str[source]
p_port: str[source]
n_port: str[source]
out_probe: str[source]
in_probe: str[source]
class bag.simulation.data.AnalysisTran[source]
property param: str[source]
property param_start: float[source]
property name: str[source]
start: float[source]
stop: float[source]
strobe: float[source]
out_start: float[source]
options: bag.util.immutable.ImmutableSortedDict[str, str][source]
save_outputs: bag.util.immutable.ImmutableList[str][source]
class bag.simulation.data.AnalysisPSS[source]
property param: str[source]
property name: str[source]
p_port: str[source]
n_port: str[source]
period: float[source]
fund: float[source]
autofund: bool[source]
strobe: float[source]
options: bag.util.immutable.ImmutableSortedDict[str, str][source]
save_outputs: bag.util.immutable.ImmutableList[str][source]
class bag.simulation.data.AnalysisPAC[source]

Bases: AnalysisAC

property name: str[source]
class bag.simulation.data.AnalysisPNoise[source]

Bases: AnalysisNoise

property name: str[source]
measurement: Optional[bag.util.immutable.ImmutableList[JitterEvent]][source]
class bag.simulation.data.JitterEvent[source]
trig_p: str[source]
trig_n: str[source]
triggerthresh: float[source]
triggernum: int[source]
triggerdir: str[source]
targ_p: str[source]
targ_n: str[source]
bag.simulation.data.AnalysisInfo[source]
bag.simulation.data.analysis_from_dict(table: Dict[str, Any]) AnalysisInfo[source]
class bag.simulation.data.MonteCarlo[source]
property name: str[source]
numruns: int[source]
seed: int[source]
options: bag.util.immutable.ImmutableSortedDict[str, Any][source]
bag.simulation.data.monte_carlo_from_dict(mc_dict: Optional[Dict[str, Any]]) Optional[MonteCarlo][source]
class bag.simulation.data.SimNetlistInfo[source]
property sweep_type: SweepInfoType[source]
sim_envs: bag.util.immutable.ImmutableList[str][source]
analyses: bag.util.immutable.ImmutableList[AnalysisInfo][source]
params: bag.util.immutable.ImmutableSortedDict[str, float][source]
env_params: bag.util.immutable.ImmutableSortedDict[str, bag.util.immutable.ImmutableList[float]][source]
swp_info: SweepInfo[source]
outputs: bag.util.immutable.ImmutableSortedDict[str, str][source]
options: bag.util.immutable.ImmutableSortedDict[str, Any][source]
monte_carlo: Optional[MonteCarlo][source]
init_voltages: bag.util.immutable.ImmutableSortedDict[str, Union[str, float]][source]
bag.simulation.data.netlist_info_from_dict(table: Dict[str, Any]) SimNetlistInfo[source]
class bag.simulation.data.AnalysisData(sweep_params: Sequence[str], data: Dict[str, numpy.ndarray], is_md: bool)[source]

A data struct that stores simulation data from a single analysis

property data_shape: Tuple[int, Ellipsis][source]
property is_md: bool[source]
property sweep_params: bag.util.immutable.ImmutableList[str][source]
property signals: List[str][source]
__getitem__(item: str) numpy.ndarray[source]
__contains__(item: str) bool[source]
classmethod combine(data_list: Sequence[AnalysisData], swp_name: str, swp_vals: Optional[numpy.ndarray] = None, axis: int = 0) AnalysisData[source]
get_param_value(name: str) numpy.ndarray[source]
items() ItemsView[str, numpy.ndarray][source]
insert(name: str, data: numpy.ndarray) None[source]
copy() AnalysisData[source]
add(new_data: Dict[str, numpy.ndarray])[source]
remove_sweep(name: str, rtol: float = 1e-08, atol: float = 1e-20) bool[source]
class bag.simulation.data.SimData(sim_envs: Sequence[str], data: Dict[str, AnalysisData], sim_netlist_type: pybag.enum.DesignOutput)[source]

A data structure that stores simulation data as a multi-dimensional array.

property group: str[source]
property group_list: List[str][source]
property sim_envs: bag.util.immutable.ImmutableList[str][source]
property sweep_params: bag.util.immutable.ImmutableList[str][source]
property signals: List[str][source]
property is_md: bool[source]
property data_shape: Tuple[int, Ellipsis][source]
property netlist_type: pybag.enum.DesignOutput[source]
__getitem__(item: str) numpy.ndarray[source]
__contains__(item: str) bool[source]
items() ItemsView[str, numpy.ndarray][source]
open_group(val: str) None[source]
open_analysis(atype: AnalysisType) None[source]
insert(name: str, data: numpy.ndarray) None[source]
add(new_data: Dict[str, numpy.ndarray])[source]
copy(rename: Optional[Dict[str, str]] = None) SimData[source]
deep_copy(rename: Optional[Dict[str, str]] = None) SimData[source]
remove_sweep(name: str, rtol: float = 1e-08, atol: float = 1e-20) bool[source]
get_param_value(name: str) numpy.ndarray[source]
classmethod combine(data_list: List[SimData], swp_name: str, swp_vals: Optional[numpy.ndarray] = None) SimData[source]
bag.simulation.data._check_is_md(num_env: int, swp_vals: List[numpy.ndarray], rtol: float, atol: float, last: Optional[int]) Tuple[Optional[Tuple[int, Ellipsis]], List[numpy.ndarray]][source]
bag.simulation.data.combine_ana_sim_envs(ana_dict: Dict[str, AnalysisData], sim_envs: List[str]) AnalysisData[source]

Combine multiple single-corner analysis data to a single multi-corner analysis data.

Parameters:
  • ana_dict (Dict[str, AnalysisData]) – dictionary mapping corner to analysis data.

  • sim_envs (List[str]) – list of corners.

Returns:

ana_data – the combined analysis data.

Return type:

AnalysisData