bag3_testbenches.measurement.mos.sim
This package contains measurement class for transistors.
Module Contents
Classes
This class sets up the transistor drain current measurement testbench. |
|
This class sets up the transistor S parameter measurement testbench. |
|
This class sets up the transistor small-signal noise measurement testbench. |
|
This class measures small signal parameters of a transistor using Y parameter fitting. |
- class bag3_testbenches.measurement.mos.sim.MOSIdTB(sim: Optional[bag.simulation.base.SimAccess], work_dir: pathlib.Path, tb_name: str, impl_lib: str, specs: Mapping[str, Any], sim_view_list: Optional[Sequence[Tuple[str, str]]], env_list: Optional[Sequence[str]], precision: int = 6, logger: Optional[pybag.core.FileLogger] = None)[source]
Bases:
bag.simulation.core.TestbenchManager
This class sets up the transistor drain current measurement testbench.
- classmethod get_schematic_class() Type[bag.design.module.Module] [source]
- get_netlist_info() bag.simulation.data.SimNetlistInfo [source]
Returns the netlist information object.
- Returns:
netlist_info – the simulation netlist information object.
- Return type:
- pre_setup(sch_params: 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
- class bag3_testbenches.measurement.mos.sim.MOSSPTB(sim: Optional[bag.simulation.base.SimAccess], work_dir: pathlib.Path, tb_name: str, impl_lib: str, specs: Mapping[str, Any], sim_view_list: Optional[Sequence[Tuple[str, str]]], env_list: Optional[Sequence[str]], precision: int = 6, logger: Optional[pybag.core.FileLogger] = None)[source]
Bases:
bag.simulation.core.TestbenchManager
This class sets up the transistor S parameter measurement testbench.
- classmethod get_schematic_class() Type[bag.design.module.Module] [source]
- get_netlist_info() bag.simulation.data.SimNetlistInfo [source]
Returns the netlist information object.
- Returns:
netlist_info – the simulation netlist information object.
- Return type:
- 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
- classmethod get_ss_params(data: bag.simulation.data.SimData, sim_envs: List[str], cfit_method: str, sp_freq: float, seg: int, is_nmos: bool, **kwargs: Dict[str, Any]) Dict[str, Any] [source]
- classmethod mos_y_to_ss(sim_data: bag.simulation.data.SimData, char_freq: float, seg: int, ibias: numpy.ndarray, cfit_method: str = 'average') Dict[str, numpy.ndarray] [source]
Convert transistor Y parameters to small-signal parameters.
This function computes MOSFET small signal parameters from 3-port Y parameter measurements done on gate, drain and source, with body bias fixed. This functions fits the Y parameter to a capcitor-only small signal model using least-mean-square error.
- Parameters:
sim_data (Dict[str, np.ndarray]) – A dictionary of Y parameters values stored as complex numpy arrays.
char_freq (float) – the frequency Y parameters are measured at.
seg (int) – number of transistor fingers used for the Y parameter measurement.
ibias (np.ndarray) – the DC bias current of the transistor. Always positive.
cfit_method (str) – method used to extract capacitance from Y parameters. Currently supports ‘average’ or ‘worst’
- Returns:
ss_dict – A dictionary of small signal parameter values stored as numpy arrays. These values are normalized to 1-finger transistor.
- Return type:
Dict[str, np.ndarray]
- class bag3_testbenches.measurement.mos.sim.MOSNoiseTB(sim: Optional[bag.simulation.base.SimAccess], work_dir: pathlib.Path, tb_name: str, impl_lib: str, specs: Mapping[str, Any], sim_view_list: Optional[Sequence[Tuple[str, str]]], env_list: Optional[Sequence[str]], precision: int = 6, logger: Optional[pybag.core.FileLogger] = None)[source]
Bases:
bag.simulation.core.TestbenchManager
This class sets up the transistor small-signal noise measurement testbench.
- classmethod get_schematic_class() Type[bag.design.module.Module] [source]
- get_netlist_info() bag.simulation.data.SimNetlistInfo [source]
Returns the netlist information object.
- Returns:
netlist_info – the simulation netlist information object.
- Return type:
- 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
- class bag3_testbenches.measurement.mos.sim.MOSCharSS(*args, **kwargs)[source]
Bases:
bag.simulation.measure.MeasurementManager
This class measures small signal parameters of a transistor using Y parameter fitting.
This measurement is performed as follows:
First, given a user specified current density range, we perform a DC current measurement to find the range of vgs needed across corners to cover that range.
Then, we run a S parameter simulation and record Y parameter values at various bias points.
If user specify a noise testbench, a noise simulation will be run at the same bias points as S parameter simulation to characterize transistor noise.
- Parameters:
data_dir (str) – Simulation data directory.
meas_name (str) – measurement setup name.
impl_lib (str) – implementation library name.
specs (Dict[str, Any]) – the measurement specification dictionary.
wrapper_lookup (Dict[str, str]) – the DUT wrapper cell name lookup table.
sim_view_list (Sequence[Tuple[str, str]]) – simulation view list
env_list (Sequence[str]) – simulation environments list.
- property tbm_order: List[str][source]
Returns a list of measurement manager names in the order which should be run
- get_tbm_specs(tbm_name: str) Dict[str, Any] [source]
Get testbench manager specs by key (tbm_name)
- Parameters:
tbm_name (str) – name of testbench manager
- Return type:
Testbench manager specs
- add_tbm(tbm_name: str, sim_env: str) bag.simulation.core.TestbenchManager [source]
Add/create a testbench manager
- async async_measure_performance(name: str, sim_dir: pathlib.Path, sim_db: bag.simulation.cache.SimulationDB, dut: Optional[bag.simulation.cache.DesignInstance], harnesses: Optional[Sequence[bag.simulation.cache.DesignInstance]] = None) Mapping[str, Any] [source]
A coroutine that performs measurement.
Since some technology nodes don’t support multi-corner simulations, individual simulations are launched per corner. Post-processed values will be stored in an hdf5 file
- Parameters:
name (str) – name of this measurement.
sim_dir (Path) – simulation directory.
sim_db (SimulationDB) – the simulation database object.
dut (Optional[DesignInstance]) – the DUT to measure.
harnesses (Optional[Sequence[DesignInstance]]) – the list of DUT and harnesses to measure.
- Returns:
output – the last dictionary returned by process_output().
- Return type:
Mapping[str, Any]
- static get_work_dir(sim_db: bag.simulation.cache.SimulationDB, sim_dir: Union[pathlib.Path, str]) Optional[pathlib.Path] [source]
Returns the work directory to which long-term files should be saved. The simulation directory may point to a temporary directory to store short-term simulation data. If so, compute the long-term directory. If not, return simulation directory.
- Parameters:
sim_db (SimulationDB) – the simulation database object.
sim_dir (Path) – simulation directory.
- Returns:
output – the long-term work directory. If unable to compute, this is None.
- Return type:
Optional[Path]
- async static _run_sim(tbm_name: str, sim_dir: pathlib.Path, sim_db: bag.simulation.cache.SimulationDB, dut: Optional[bag.simulation.cache.DesignInstance], tbm: bag.simulation.core.TestbenchManager) bag.simulation.data.SimData [source]
Runs a simulation.
- Parameters:
tbm_name (str) – name of testbench manager
sim_dir (Path) – simulation directory.
sim_db (SimulationDB) – the simulation database object.
dut (Optional[DesignInstance]) – the DUT to measure.
tbm (TestbenchManager) – the testbench manager object.
- Returns:
output – the simulation data.
- Return type:
- combine_data_across_corners(data_list: List[bag.simulation.data.SimData]) bag.simulation.data.SimData [source]
Combines simulation data from separate simulations into one SimData object. Each simulation is expected to have the same setup (testbench configuration, sweep variables, etc.) except for corner.