bag.simulation.spectre

This module implements bag’s interface with spectre simulator.

Module Contents

Classes

SpectreInterface

This class handles interaction with Spectre simulators.

Functions

_write_sim_env(→ None)

_write_param_set(→ None)

_get_sweep_str(→ str)

_get_options_str(→ str)

_write_sweep_start(→ int)

_write_monte_carlo(→ int)

_write_analysis(→ List[str])

_write_save_statements(lines, save_outputs)

_format_val(→ str)

_process_hdf5(→ None)

Attributes

srr_to_sim_data

reserve_params

bag.simulation.spectre.srr_to_sim_data[source]
bag.simulation.spectre.reserve_params[source]
class bag.simulation.spectre.SpectreInterface(tmp_dir: str, sim_config: Dict[str, Any])[source]

Bases: bag.simulation.base.SimProcessManager

This class handles interaction with Spectre simulators.

Parameters:
  • tmp_dir (str) – temporary file directory for SimAccess.

  • sim_config (Dict[str, Any]) –

    the simulation configuration dictionary. Contains the following options:

    env_filestr

    the yaml path for PVT corners.

    use_pysrrbool

    True to use pysrr. Defaults to False.

    compressbool

    True to compress simulation data when saving to HDF5 file. Defaults to True.

    rtol: float

    relative tolerance for checking if 2 simulation values are the same. Defaults to 1e-8.

    atol: float

    absolute tolerance for checking if 2 simulation values are the same. Defaults to 1e-22.

    kwargsDict[str, Any]

    additional spectre simulation arguments. Contains the following options:

    commandstr

    the command to launch simulator. Defaults to spectre.

    envOptional[Dict[str, str]]

    an optional dictionary of environment variables. None to inherit from parent. Defaults to None.

    run_64bool

    True to run in 64-bit mode. Defaults to True.

    formatstr

    the output raw data file format. Defaults to psfxl.

    psfversionstr

    the version of psfxl to use. If not specified, defaults to the simulator’s default psfversion.

    optionsList[str]

    the command line simulator options. Defaults to an empty list.

property netlist_type: pybag.enum.DesignOutput[source]
create_netlist(output_path: pathlib.Path, sch_netlist: pathlib.Path, info: bag.simulation.data.SimNetlistInfo, precision: int = 6) None[source]
get_sim_file(dir_path: pathlib.Path, sim_tag: str) pathlib.Path[source]
load_sim_data(dir_path: pathlib.Path, sim_tag: str) bag.simulation.data.SimData[source]
async async_run_simulation(netlist: pathlib.Path, sim_tag: str) None[source]
async _srr_to_hdf5(compress: bool, rtol: float, atol: float, raw_path: pathlib.Path, hdf5_path: pathlib.Path, log_path: pathlib.Path, cwd_path: pathlib.Path) None[source]
async _format_monte_carlo(lines: List[str], cwd_path: pathlib.Path, compress: bool, rtol: float, atol: float, final_hdf5_path: pathlib.Path) None[source]
bag.simulation.spectre._write_sim_env(lines: List[str], models: List[Tuple[str, str]], temp: int) None[source]
bag.simulation.spectre._write_param_set(lines: List[str], params: Sequence[str], values: Sequence[bag.util.immutable.ImmutableList[float]], precision: int) None[source]
bag.simulation.spectre._get_sweep_str(par: str, swp_spec: Optional[bag.simulation.data.SweepSpec], precision: int) str[source]
bag.simulation.spectre._get_options_str(options: Mapping[str, str]) str[source]
bag.simulation.spectre._write_sweep_start(lines: List[str], swp_info: bag.simulation.data.SweepInfo, swp_idx: int, precision: int) int[source]
bag.simulation.spectre._write_monte_carlo(lines: List[str], mc: bag.simulation.data.MonteCarlo) int[source]
bag.simulation.spectre._write_analysis(lines: List[str], sim_env: str, ana: bag.simulation.data.AnalysisInfo, precision: int, has_ic: bool) List[str][source]
bag.simulation.spectre._write_save_statements(lines: List[str], save_outputs: Set[str])[source]
bag.simulation.spectre._format_val(val: Union[float, str], precision: int = 6) str[source]
bag.simulation.spectre._process_hdf5(path: pathlib.Path, rtol: float, atol: float) None[source]