bag3_testbenches.measurement.search
Module Contents
Classes
Support for flags |
|
A Measurement manager that performs binary search for you. |
Functions
|
- class bag3_testbenches.measurement.search.IntervalSearchMM(*args: Any, **kwargs: Any)[source]
Bases:
bag.simulation.measure.MeasurementManagerFSM
,abc.ABC
A Measurement manager that performs binary search for you.
Assumes that no parameters/corners are swept.
- abstract process_init(cur_info: bag.simulation.measure.MeasInfo, sim_results: bag.simulation.cache.SimResults) Tuple[Dict[str, Any], bool] [source]
- abstract init_search(sim_db: bag.simulation.cache.SimulationDB, dut: bag.simulation.cache.DesignInstance) Tuple[bag.simulation.core.TestbenchManager, Mapping[str, Any], Mapping[str, Mapping[str, Any]], Mapping[str, Any], bool, bool] [source]
Initialize this MeasurementManager.
- Returns:
tbm (TestbenchManager) – the TestbenchManager object.
tb_params (Mapping[str, Any]) – the testbench schematic parameters dictionary.
intv_params (Mapping[str, Mapping[str, Any]]) – A dictionary from search parameter name to its configuration dictionary. The values have the following entries:
- lowfloat
lower bound.
- highOptional[float]
upper bound. If None, perform a unbounded binary search.
- stepfloat
initial step size for unbounded binary search.
- tolfloat
tolerance of the binary search. Terminate the search when it is below this value.
- max_errfloat
Used only in unbounded binary search. If unbounded binary search exceeds this value, raise an error.
- overhead_factorfloat
ratio of simulation startup time to time it takes to simulate one sweep point.
intv_defaults (Mapping[str, Any]) – If any interval configuration are not specified, the value is taken from this dictionary.
has_init (bool) – True to run an initialization step.
use_dut (bool) – True to instantiate DUT.
- abstract process_output_helper(cur_info: bag.simulation.measure.MeasInfo, sim_results: bag.simulation.cache.SimResults, remaining: Set[str]) Mapping[str, Tuple[Tuple[float, float], Dict[str, Any], bool]] [source]
- initialize(sim_db: bag.simulation.cache.SimulationDB, dut: bag.simulation.cache.DesignInstance) Tuple[bool, bag.simulation.measure.MeasInfo] [source]
Initialize this MeasurementManager to get ready for measurement.
- Parameters:
sim_db (SimulationDB) – the simulation database object.
dut (DesignInstance) – the design instance.
harnesses (Optional[Sequence[DesignInstance]]) – the list of harness instances.
- Returns:
done (bool) – If True, then do not run measurement.
info (MeasInfo) – the initial MeasInfo object.
- get_sim_info(sim_db: bag.simulation.cache.SimulationDB, dut: bag.simulation.cache.DesignInstance, cur_info: bag.simulation.measure.MeasInfo) Tuple[Union[Tuple[bag.simulation.core.TestbenchManager, Mapping[str, Any]], bag.simulation.measure.MeasurementManager], bool] [source]
Get the testbench manager needed for the current measurement state.
Override to customize your testbench manager.
- Parameters:
sim_db (SimulationDB) – the simulation database object.
dut (DesignInstance) – the design instance.
cur_info (MeasInfo) – the MeasInfo object representing the current measurement state.
harnesses (Optional[Sequence[DesignInstance]]) – the list of harness instances
- Returns:
sim_object (Union[Tuple[TestbenchManager, Mapping[str, Any]], MeasurementManager]) – either a TestbenchManager/tb_params tuple, or a measurement manager instance.
use_dut (bool) – True to run simulation with DesignInstance.
- process_output(cur_info: bag.simulation.measure.MeasInfo, sim_results: Union[bag.simulation.cache.SimResults, bag.simulation.cache.MeasureResult]) Tuple[bool, bag.simulation.measure.MeasInfo] [source]
Process simulation output data.
- Parameters:
cur_info (MeasInfo) – the MeasInfo object representing the current measurement state.
sim_results (Union[SimResults, MeasureResult]) – the simulation results object.
- Returns:
done (bool) – True if this measurement is finished.
next_info (MeasInfo) – the updated measurement state.