bag3_testbenches.measurement.mos.db

Module Contents

Classes

MOSCharSpecs

A class that parses the characterization specification file.

MOSDBDiscrete

Transistor small signal parameters database with discrete width choices.

class bag3_testbenches.measurement.mos.db.MOSCharSpecs(spec_file: str, spec_dict: Optional[Dict[str, Any]] = None)[source]

Bases: bag.simulation.core.DesignSpecs

A class that parses the characterization specification file.

property dsn_basename: str[source]
class bag3_testbenches.measurement.mos.db.MOSDBDiscrete(prj: bag.core.BagProject, spec_list: List[str], interp_method: str = 'spline', vgs_res: float = 0.005, width_var: str = 'w')[source]

Transistor small signal parameters database with discrete width choices.

This class provides useful query/optimization methods and ways to store/retrieve data.

Parameters:
  • spec_list (List[str]) – list of specification file locations corresponding to widths.

  • interp_method (str) – interpolation method.

  • meas_type (str) – transistor characterization measurement type.

  • vgs_res (float) – vgs resolution used when computing vgs from vstar.

  • is_schematic (bool) – True if this is working with schematic simulation data.

  • width_var (str) – the width variable name.

property width_list: List[Union[float, int]][source]

Returns the list of widths in this database.

property env_list: List[str][source]

The list of simulation environments to consider.

property dsn_params: Sequence[str][source]

List of design parameters.

classmethod _make_ss_functions(ss_dict, corners, swp_names, interp_method)[source]
get_dsn_param_values(var) List[Any][source]

Returns a list of valid design parameter values.

set_dsn_params(**kwargs)[source]

Set the design parameters for which this database will query for.

_get_dsn_name(**kwargs) str[source]
get_function_list(name, **kwargs) List[bag.math.dfun.DiffFunction][source]

Returns a list of functions, one for each simulation environment, for the given output.

Parameters:
  • name (str) – name of the function.

  • **kwargs – design parameter values.

Returns:

output – the output vector function.

Return type:

Union[RegGridInterpVectorFunction, RegGridInterpFunction]

get_function(name, env='', **kwargs) Union[bag.math.dfun.VectorDiffFunction, bag.math.dfun.DiffFunction][source]

Returns a function for the given output.

Parameters:
  • name (str) – name of the function.

  • env (str) – if not empty, we will return function for just the given simulation environment.

  • **kwargs – design parameter values.

Returns:

output – the output vector function.

Return type:

Union[RegGridInterpVectorFunction, RegGridInterpFunction]

get_fun_sweep_params(**kwargs) Tuple[List[str], List[Tuple[float, float]]][source]

Returns interpolation function sweep parameter names and values.

Parameters:

**kwargs – design parameter values.

Returns:

  • sweep_params (List[str]) – list of parameter names.

  • sweep_range (List[Tuple[float, float]]) – list of parameter range

get_fun_arg(vgs: Optional[float] = None, vds: Optional[float] = None, vbs: float = 0.0, vstar: Optional[float] = None, env: str = '') numpy.ndarray[source]

Compute argument for small signal parameter functions for the given bias point.

Either one of vgs and vstar must be specified. If vds is not specified, we set vds = vgs. If vbs is not specified, we set vbs = 0.

You can specify vstar only if we only consider one simulation environment.

Parameters:
  • vgs (Optional[float]) – gate-to-source voltage. For PMOS this is negative.

  • vds (Optional[float]) – drain-to-source voltage. For PMOS this is negative.

  • vbs (float) – body-to-source voltage. For NMOS this is negative.

  • vstar (Optional[float]) – vstar, or 2 * id / gm. This is always positive.

  • env (str) – If not empty, will return results for this simulation environment only.

Returns:

arg – the argument to pass to small signal parameter functions.

Return type:

np.ndarray

_get_bias_point_info(vgs: Optional[float] = None, vds: Optional[float] = None, vbs: float = 0.0, vstar: Optional[float] = None, env: str = '') Dict[str, float][source]

Compute bias point dictionary from given specs.

get_fun_arg_index(name: str) int[source]

Returns the function input argument index for the given variable

Parameters:

name (str) – one of vgs, vds, or vbs.

Returns:

idx – index of the given argument.

Return type:

int

query(vgs: Optional[float] = None, vds: Optional[float] = None, vbs: float = 0.0, vstar: Optional[float] = None, env: str = '') Dict[str, numpy.ndarray][source]

Query the database for the values associated with the given parameters.

Either one of vgs and vstar must be specified. If vds is not specified, we set vds = vgs. If vbs is not specified, we set vbs = 0.

Parameters:
  • vgs (Optional[float]) – gate-to-source voltage. For PMOS this is negative.

  • vds (Optional[float]) – drain-to-source voltage. For PMOS this is negative.

  • vbs (float) – body-to-source voltage. For NMOS this is negative.

  • vstar (Optional[float]) – vstar, or 2 * id / gm. This is always positive.

  • env (str) – If not empty, will return results for this simulation environment only.

Returns:

results – the characterization results.

Return type:

Dict[str, np.ndarray]