piel.tools.hdl21.simulator#
This module provides functions to configure and run various measurement of simulations for electronic circuits using HDL21 and NGSPICE. It includes utilities to set up NGSPICE simulations, configure operating point and transient simulations, and handle the results.
Functions#
|
Configures the NGSPICE simulation for the circuit and returns a simulation options class. |
|
|
|
|
|
Runs the simulation for the circuit and returns the results. |
Module Contents#
- configure_ngspice_simulation(run_directory: piel.types.PathTypes = '.')[source]#
Configures the NGSPICE simulation for the circuit and returns a simulation options class.
- Parameters:
run_directory (PathTypes) – Directory where the simulation will be run.
- Returns:
Configured NGSPICE simulation options.
- Return type:
vsp.SimOptions
- configure_transient_simulation(testbench: piel.types.AnalogueModule, stop_time_s: float, step_time_s: float, **kwargs)[source]#
- run_simulation(simulation: Any, simulator_name: Literal['ngspice'] = 'ngspice', simulation_options: Any = None, to_csv: bool = True)[source]#
Runs the simulation for the circuit and returns the results.
- Parameters:
simulation (h.sim.Sim) – HDL21 simulation class.
simulator_name (Literal["ngspice"]) – Name of the simulator to use.
simulation_options (Optional[vsp.SimOptions]) – Options for the simulation. Defaults to None.
to_csv (bool) – Whether to save the results to a CSV file. Defaults to True.
- Returns:
Results of the simulation.
- Return type:
hs.SimResult